react-native-macos/index.js

771 строка
32 KiB
JavaScript
Исходник Обычный вид История

/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow
*/
'use strict';
// Components
import typeof AccessibilityInfo from './Libraries/Components/AccessibilityInfo/AccessibilityInfo';
import typeof ActivityIndicator from './Libraries/Components/ActivityIndicator/ActivityIndicator';
import typeof Button from './Libraries/Components/Button';
import typeof DatePickerIOS from './Libraries/Components/DatePicker/DatePickerIOS';
import typeof DatePickerMacOS from './Libraries/Components/DatePickerMacOS/DatePickerMacOS'; // TODO(macOS GH#774)
import typeof DrawerLayoutAndroid from './Libraries/Components/DrawerAndroid/DrawerLayoutAndroid';
import typeof FlatList from './Libraries/Lists/FlatList';
import typeof Image from './Libraries/Image/Image';
import typeof ImageBackground from './Libraries/Image/ImageBackground';
import typeof InputAccessoryView from './Libraries/Components/TextInput/InputAccessoryView';
import typeof KeyboardAvoidingView from './Libraries/Components/Keyboard/KeyboardAvoidingView';
import typeof MaskedViewIOS from './Libraries/Components/MaskedView/MaskedViewIOS';
import typeof Modal from './Libraries/Modal/Modal';
v0.63 sync from upstream (#613) * Upgrade to Metro 0.59 Summary: Upgrades RN to Metro 0.59. Changelog: [Internal] Metro Upgrade Reviewed By: motiz88 Differential Revision: D20533864 fbshipit-source-id: 3c5fb8e37d2363edf0b9a1a8cfbdefba00763415 * Fix mock for TextInput (#28332) Summary: This PR adds the `isFocused` method to the mock of the TextInput component. My understanding some of the latest changes on the TextInput to make it use a forwardRef change the way this method is mock giving an error when trying to use in on a mock. The change suggested here fixes the issue. ## Changelog [JavaScript] [Fixed] - Fix the mock for TextInput to support the `isFocused` method Pull Request resolved: https://github.com/facebook/react-native/pull/28332 Reviewed By: cpojer Differential Revision: D20538044 Pulled By: TheSavior fbshipit-source-id: be734af105ab62ffdf9ed4017bd70845e207f8cd * Properly handle LogBox errors during tests Summary: This diff fixes an issue where errors in LogBox during tests would cause the tests to crash. The crash is due to the NativeExceptionsManager module not being mocked (as all native module need to be in tests). The fix is to properly mock the NativeExceptionManger. This fix exposed an infinite loop issue where failures in LogBox will be logged to the ExceptionManager, which logs to the console, which logs to LogBox, creating a loop. This diff also fixes that look by moving the LogBox internal error check to the top of the monkey patched console methods. Changelog: [Internal] Differential Revision: D20428590 fbshipit-source-id: 7289a480c99ba8dee67772178b7629afb40b330a * Back out "Track animations and flush them" Summary: Original commit changeset: b594d0e6e9b6 D20319824 introduced a problem in LayoutAnimations, which makes surfaced as the problem in T63911344. This diff reverts D20319824. Changelog: [Internal] Reviewed By: lunaleaps Differential Revision: D20541918 fbshipit-source-id: ff72b839f57d39051122920a38b2632cbb5ec362 * Consolidate "dispatchMountItems" reentrancy prevention code, and retry code, in one function Summary: Simplifying the dispatchMountItems reentrance and retry logic. Motivation: cleanup so I can work on dispatching ViewCommands before anything else. Importantly, this gives us the properties that: 1) Only one function is responsible for calling dispatchMountItems 2) Only one function is responsible for deciding if we shouldn't call dispatchMountItems due to reentrance 3) Only one function is responsible for all cleanup 4) Only one function maintains all of the relevant flags (except dispatchPreMountItems... two total now, instead of 4 before) Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20437035 fbshipit-source-id: 5370366790eb25f653bee6c1950e747458374a61 * Only retry ViewCommand mount items if exception is marked as "Retryable" Summary: Instead of just blindly retrying all ViewCommands if they fail - which could be dangerous, since it's arbitrary imperative commands we'd be executing twice, potentially with bad app state - we only retry if the ViewCommand throws a "RetryableMountingLayerException". Changelog: [Internal] Optimization to ViewCommands Reviewed By: mdvacca Differential Revision: D20529985 fbshipit-source-id: 0217b43f4bf92442bcc7ca48c8ae2b9a9e543dc9 * Introduce early dispatch of ViewCommands in FabricUIManager Summary: Earlier this week I introduced a change in the old, non-Fabric renderer (D20378633 D20427803) that (gated behind a feature-flag) executes ViewCommands before all other types of commands, as a perf optimization and (I think) a potential fix for a category of race conditions. I've added more details in comments here. The Fabric renderer uses the same feature-flag that I introduced for the non-Fabric renderer. Changelog: [Internal] Fabric Reviewed By: mdvacca Differential Revision: D20449186 fbshipit-source-id: bb3649f565f32c417a6247369902333989a043aa * Change nightly build from hourly to nightly (daily at 00:00) (#28346) Summary: We initially added the nightly build test to run every hour, in order to more quickly validate it. Now that it has been validated we can run it every night as it is intended to do. cc hramos ## Changelog [General] [Changed] - Change nightly build from hourly to nightly Pull Request resolved: https://github.com/facebook/react-native/pull/28346 Reviewed By: cpojer Differential Revision: D20550143 Pulled By: hramos fbshipit-source-id: 9487c6785684ad6ea7e877290d50a33118090a7f * Add diffing to app bundle size reports (#28284) Summary: Add diffing to app bundle size reports. ## Changelog [Internal] [Changed] - Add diffing to app bundle size reports Pull Request resolved: https://github.com/facebook/react-native/pull/28284 Test Plan: - App bundle size reports should now display a diff where available - Right now, the database contains only one entry for the last known good iOS build - Triggering a new build should not create additional comments Reviewed By: cpojer Differential Revision: D20450158 Pulled By: hramos fbshipit-source-id: 720772275f24d3ff0a49705f4dada2efe2e99bd3 * feat: improve monorepo support by removing redundant PROJECT_ROOT (#28354) Summary: Historically, React Native didn't support a lot of custom project structures apart from the standard flat directory with `ios` and `android` folders. The CLI had to be explicitly started from the project root, otherwise Metro didn't work right. In order to resolve the project root in the most accurate way, React Native assumed that project root is always `../../` from its location in `node_modules` - this is not true when the installation gets hoisted (e.g. in a monorepo). To address that, janicduplessis brought support for custom [`PROJECT_ROOT`](https://github.com/facebook/react-native/commit/9ccde378b6e6379df61f9d968be6346ca6be7ead) that allowed overriding the `../../` in case it wasn't true. Today, CLI is able to automatically resolve the project root, no matter where it's started. It will traverse the tree of the directories upwards and stop as soon as it meets `package.json`. As a result, it doesn't really matter from where we start the CLI anymore as a part of `react-native-xcode.sh`. By replacing the default value of `$REACT_NATIVE_DIR/../../` with `$PWD, that is default for all Xcode scripts, we can make the setup for monorepo easier - nobody will need to set `$PROJECT_ROOT` in order to override the incorrect defaults. By default, all scripts defined in Xcode run from `$PWD` directory, which is the location of the iOS project. In the future, we will be able to remove `cd` entirely. To better understand this PR, let's look a few hypothetical structures as an example: #### Monorepo: > tl;dr works out of the box, no need to mess around with paths ``` - package.json - packages/ - my-app/ - index.js - package.json - ios/ - MyApp.xcodeproj ``` **Before this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $REACT_NATIVE_DIR/../../ node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - Because we change the directory to the root of monorepo, CLI throws an error. All in all, there's no `react-native` dependency at the workspace root. - Some users turn `no hoist` in an act of troubleshooting the errors, which resolves the problem - `react-native` is moved under `my-app/node_modules` which makes this mechanism resolve properly. - Some users find out about `PROJECT_ROOT` and set it to overwrite the default value. For example, setting `export PROJECT_ROOT = "$PWD/../` will set the directory to `my-app`, which has a dependency on `react-native` in a `package.json` and makes the CLI happy. **After this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $PWD node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - The `$PWD` is `packages/my-app/ios/` because that's where the Xcode project is located. CLI will automatically set the root to `../` because that's where it finds `package.json` with `react-native` dependency. It will pass that root to Metro, unless users have set a different one themselves. Thanks to that, all paths to JavaScript files remain working and unaffected. - No need to set `PROJECT_ROOT` anymore. - We don't rely on the location of `node_modules`, which is cleaner and future proof. #### Standard: > tl;dr no changes ``` - ios/ - MyApp.xcodeproj - index.js - package.json ``` **Before this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $REACT_NATIVE_DIR/../../ node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - Everything works fine. Path from `react-native` inside `node_modules` is correct - the project root is set right to `/` **After this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $PWD node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - The root will be set to where Xcode project is located, which is `/ios`. This is the PWD for all Xcode scripts. CLI will look for the `package.json` going upwards from `ios` folder. Will stop at `/`, find out it has `react-native` dependency, load it and its commands and proceed further. ## Changelog [iOS] [Feature] - Better monorepo support when building release apk Pull Request resolved: https://github.com/facebook/react-native/pull/28354 Test Plan: - All projects (standard/monorepo) run without issues. - PROJECT_ROOT is not needed. CC: Titozzz (who wrote monorepo guide), alloy, bartolkaruza Reviewed By: cpojer Differential Revision: D20558005 Pulled By: hramos fbshipit-source-id: 2551120beadcfd4c2f1393ce8a2c2fa6b93c9290 * Fix `test_android`: Remove references to fbsource cell (#28363) Summary: Fixes https://github.com/facebook/react-native/issues/28361. ## Changelog [Internal] [CI] - Fix test_android Pull Request resolved: https://github.com/facebook/react-native/pull/28363 Test Plan: Prior to fix: ``` react-native $ ./scripts/circleci/buck_fetch.sh Guessing 168a69309928ba16065cdb33b1775a4af9f924a6 as the last one used version. Using additional configuration options from /Users/hramos/.buckconfig.d/experiments, /etc/buckconfig.d/fb_chef.ini, /etc/buckconfig.d/fb_chef_override.ini Invalidating internal cached state: Watchman failed to start. This may cause slower builds. Parsing buck files: finished in 1.5 sec Buck wasn't able to parse /Users/hramos/git/react-native/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK: IOError: [Errno 2] No such file or directory: '/Users/hramos/git/react-native/tools/build_defs/platform_defs.bzl' Call stack: File "/Users/hramos/git/react-native/.buckd/resources/168a69309928ba16065cdb33b1775a4af9f924a6/buck_server/buck_parser/profiler.py", line 507, in wrapped return func(*args, **kwargs) File "/Users/hramos/git/react-native/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK", line 1 load("//tools/build_defs:platform_defs.bzl", "ANDROID") File "/Users/hramos/git/react-native/.buckd/resources/168a69309928ba16065cdb33b1775a4af9f924a6/buck_server/buck_parser/profiler.py", line 507, in wrapped return func(*args, **kwargs) This error happened while trying to get dependency '//ReactAndroid/src/main/java/com/facebook/fbreact/specs:FBReactNativeSpec' of target '//ReactAndroid/src/main/java/com/facebook/react/devsupport:devsupport' ``` After fix: ``` react-native $ ./scripts/circleci/buck_fetch.sh + buck fetch ReactAndroid/src/test/java/com/facebook/react/modules Guessing 168a69309928ba16065cdb33b1775a4af9f924a6 as the last one used version. Using additional configuration options from /Users/hramos/.buckconfig.d/experiments, /etc/buckconfig.d/fb_chef.ini, /etc/buckconfig.d/fb_chef_override.ini Invalidating internal cached state: Watchman failed to start. This may cause slower builds. Parsing buck files: finished in 1.1 sec Configuration 'ANDROID_SDK' points to an invalid directory '/opt/android_sdk'. When creating rule //ReactAndroid/src/main/java/com/facebook/hermes/instrumentation:instrumentation. ``` > Note: I don't have the Android SDK configured in this machine. Verified on Circle CI. `test_android` is now green: https://circleci.com/gh/facebook/react-native/140682?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link Reviewed By: cpojer Differential Revision: D20564934 Pulled By: hramos fbshipit-source-id: 5d843b8f113c4db5391ee39addc3ff259d962290 * Fix TextInput left/right padding Summary: This fixes two things: 1) Currently it only respects Start and End padding, and if there's a Theme default, it will override Left/Right padding. Whoops. 2) Currently it doesn't respect when a TextInput starts with padding, but then is removed. This resolves both. It still does not account for RTL support. Changelog: [Internal] Fix AndroidTextInput padding Reviewed By: mdvacca Differential Revision: D20573151 fbshipit-source-id: e89791641b6699e728cde9dbd661a8c21485fbc8 * Validate selection range passed to setTextAndSelection Summary: Changelog: [Internal] # Fabric 1. If `start` and `end` parameters in `setTextAndSelection` are -1, we don't move the cursor. Previously the cursor would be moved to beginning of text input. 2. In view commands, do not validate `eventCount`. It is passed in as undefined from JS because Fabric's text input doesn't use `eventCount`. # Paper 1. If `start` and `end` parameters in `setTextAndSelection` are -1, we don't move the cursor. Previously the cursor would be moved to beginning of text input. Reviewed By: shergin Differential Revision: D20538290 fbshipit-source-id: c7aeddc25f58697254474058ce901df958321f7c * Remove ReactTypes from fbsource and React sync Summary: See https://github.com/facebook/react/pull/18366 This contains a fork of the upstream Flow types. We shouldn't be syncing this since these leads to conflicting types. As a result, these uses have already been codemodded away. Only the imports remained. Changelog: [React Core] - Remove ReactTypes from sync. Reviewed By: gaearon Differential Revision: D20583740 fbshipit-source-id: fc86a934cbdca8ff90fe90282b86ecc945a85e5f * Fix controlled TextInput with child nodes Summary: Changelog: [Internal] # There are three changes in this diff ## _stateRevision is replaced with a BOOL `_stateRevision` was protecting against setting attributed string that is already visible to the user. Previously this was ok because the change was only coming from native, any changes from JS were ignored. Imagine following scenario: 1. User taps key. 2. Update state is called on component initiated by native. 3. New state is created with incremented revision by one. 4. `_stateRevision` gets set to new state's revision + 1. 5. Now JS wants to change something because it just learnt that user tapped the key. 6. New state is created again with incremented revision by one. 7. Update state is called on the component, but the change isn't applied to the text view because `_state->getRevision()` will equal `_stateRevision`. By having a BOOL instead of number, we very explicitly mark the region in which we don't want state changes to be applied to text view. ## Calling [_backedTextInputView setAttributedText] move cursor to the end of text input This is prevented by storing what the current selection is and applying it after `[_backedTextInputView setAttributedText]` is called. This was previously invisible because JS wasn't changing contents of `_backedTextInputView`. ## Storing of previously applied JS attributed string in state This is the mechanism used to detect when value of text input changes come from JavaScript. JavaScript sends text input value changes through props and as children of TextInput. We compare what previously was set from JavaScript to what is currently being send from JavaScript and if they differ, this change is communicated to the component. Previously only first attributed string send from JavaScript was send to the component. # Problem If children are used to set text input's value, then there is a case in which we can't tell what source of truth should be. Let's take following example We have a text field that allows only 4 characters, again this is only a problem if those 4 characters come as children, not as value. This is a controller text input. 1. User types 1234. 2. User types 5th character. 3. JavaScript updates TextInput, saying that the content should stay 1234. 4. In `TextInputShadowNode` `hasJSUpdatedAttributedString` will be set to false, because previous JS value is the same as current JS value. Reviewed By: shergin Differential Revision: D20587681 fbshipit-source-id: 1b8a2efabbfa0fc87cba210570142d162efe61e6 * Daily `arc lint --take BUCKFORMAT` Reviewed By: zertosh Differential Revision: D20593906 fbshipit-source-id: b056947c698508119dc9d4d1bba202295b8f0fda * RN picker - implement background color Summary: add support to the android implementation of the Picker component for setting the background color. Changelog: [Android] [Added] - Support item background color in Dialog Picker Differential Revision: D20566131 fbshipit-source-id: d693b40803fa1051ec955c5728994c820fecd9e9 * Fabric: Modernizing Yoga Dirty flag test. Summary: Now we using TEST_F thing that allows consilidating initialization. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D20578788 fbshipit-source-id: 103bcb8fdeb3dbf297385cfe56415bd646e16791 * Fabric: Changing signature of `ComponentDescriptor::createState` Summary: This is pure syntactic change. Often we don't have a shared pointer to ShadowNodeFamily and only have just a reference. At the same time, `ComponentDescriptor::createState` does not have to accept a shared pointer. So, it's better to accept just a reference. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20578787 fbshipit-source-id: 905277001e096d41e75007575b59ea2ea15fbf4b * Fabric: View Test: Changing state should not dirty Yoga tree (in some most cases) Summary: Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D20578789 fbshipit-source-id: 4336165217bd39fc8065cfaeb96ef7753433d48a * Get ReactiveNative compiled with Clang 10 (#28362) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/28362 Fixed a few compilation errors emitted by Clang 10. Changelog: [iOS] [Fixed] - Get ready for Clang 10 Differential Revision: D20549970 fbshipit-source-id: dc36a85d90d3e43a05f045feb57c6ab6ded67da7 * Guard against null values in object parameters for bridged methods Summary: Handles the case when a value in an object parameter of a turbo module spec is null (even if the type is nullable). For example, given: ``` export interface Spec extends TurboModule { +myFunc: ({| foo: ?string, |}) => void; } ``` and calling `NativeModule.myFunc({foo: null})`, we see an error like: ``` JSON value '<null>' of type NSNull cannot be converted to NSString ``` Guarding against this by converting NSNull's to nils ## Changelog: [iOS] [Fixed] - Fix crash when passing null value in object parameter of bridged method Reviewed By: fkgozali Differential Revision: D20591590 fbshipit-source-id: fdb90f34131427a235f2e3c99147bf1e6a9c6732 * Modify pending deletion tags to be cross manageChildren Summary: Changelog: [Internal] Removing historic layout animations index adjustment (D20323928) broke the Dating Secret Crush screen. Since flushing animations (D20319824) had to be reverted due to issues with Saved + Privacy Shortcuts (https://fburl.com/tasks/eijtmifu) we need to track pending deletions across `manageChildren` operations. Reviewed By: JoshuaGross Differential Revision: D20601079 fbshipit-source-id: c6f116683750e97abe7f988cf361d2a6449e90e6 * Enable label-actions on the react-native repository (#28374) Summary: Enhance our issue management workflow by having the bot respond automatically whenever a label is applied to the issue. ## Changelog [Internal] - CI Pull Request resolved: https://github.com/facebook/react-native/pull/28374 Test Plan: Not tested. If needed, could be applied to a different, test repository. Reviewed By: cpojer Differential Revision: D20606887 Pulled By: hramos fbshipit-source-id: 874d1464527ea76bf51394a7d3e98e4fd8f69345 * Fix Animated Value initialized with undefined in ScrollView (#28349) Summary: When passing an object to contentOffset that doesn't have `y` prop set it causes the following error: ``` Error: AnimatedValue: Attempting to set value to undefined This error is located at: in ScrollView (at src/index.js:638) ... ``` This happens since a runtime check was added to the `AnimatedValue` constructor. (a3aaa471eca58b31597b9a0669f7ade385ccb175) According to flow types the object passed to contentOffset should always contain both x and y props but since it worked before when y is undefined I think its fine to patch the runtime behaviour defensively, especially since the code change is simple. ## Changelog [General] [Fixed] - Fix Animated Value initialized with undefined in ScrollView Pull Request resolved: https://github.com/facebook/react-native/pull/28349 Test Plan: Tested that the crash no longer reproduces when passing an empty object to contentOffset. Reviewed By: cpojer Differential Revision: D20601664 Pulled By: hramos fbshipit-source-id: b098a2dd1e702f995a9a92fa6e4e9a204187dac4 * xplat/js/react-native-github/ReactCommon/fabric/components/textinput/ Summary: Changelog: [Internal] Reviewed By: scottrice Differential Revision: D20619227 fbshipit-source-id: 674337e6ce585a4e96d020f9624b874ba86e2d80 * Seed ssh known hosts with github's public key (#28370) Summary: The [previous attempt](https://github.com/facebook/react-native/pull/28304) to fix the publish step failed, so now reverting to manually configuring things. This PR adds an entry to SSH’s `known_hosts` file using github.com’s public key that I have verified as per [these instructions](https://serverfault.com/a/807363): ``` ~/C/R/react-native [master] » nmap github.com --script ssh-hostkey Nmap scan report for github.com (140.82.118.4) rDNS record for 140.82.118.4: lb-140-82-118-4-ams.github.com PORT STATE SERVICE 22/tcp open ssh | ssh-hostkey: | 1024 ad:1c:08:a4:40:e3:6f:9c:f5:66:26:5d:4b:33:5d:8c (DSA) |_ 2048 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48 (RSA) ``` These fingerprints line up with [the ones posted by GitHub](https://help.github.com/en/github/authenticating-to-github/githubs-ssh-key-fingerprints), so my setup should be good and can be trusted to grab the public key from the right host: ``` ~/C/R/react-native [master] » ssh-keyscan -t rsa -H github.com # github.com:22 SSH-2.0-babeld-d48c3acd |1|If6MU203eXTaaWL678YEfWkVMrw=|kqLeIAyTy8pzpj8x8Ae4Fr8Mtlc= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== ``` ## Changelog [Internal] [Fixed] - Make automated publishing of packages from CI work again Pull Request resolved: https://github.com/facebook/react-native/pull/28370 Test Plan: I used the command being added in this PR in [a failed CI job](https://app.circleci.com/pipelines/github/facebook/react-native/4104/workflows/916127cb-177f-4583-9f90-cae5318041d8/jobs/140810). When I invoked the publish script manually I was not greeted by the blocking prompt and the package was successfully published: https://www.npmjs.com/package/react-native/v/0.0.0-56cf99a96 Reviewed By: cpojer Differential Revision: D20601527 Pulled By: hramos fbshipit-source-id: b1a4405228408cfc4a1b3b44ab88c79522af3a66 * Fix app bundle size diff not always being compared against latest commit (#28368) Summary: - Timestamp of entries in our Firebase instance sometimes get stored as number. This means that we may not always be diffing against the latest master commit. - Size report of Android and iOS gets overwritten depending on which build finishes first. ## Changelog [Internal] [Fixed] - App bundle size diff not always being compared against latest commit [Internal] [Fixed] - Android and iOS app bundle size diff overwrite each other Pull Request resolved: https://github.com/facebook/react-native/pull/28368 Test Plan: - We are now using Firebase's own [firebase.firestore.Timestamp.now](https://firebase.google.com/docs/reference/js/firebase.firestore.Timestamp#now) to ensure that we always get a timestamp in the preferred format. This has been tested locally but can only be verified when merged to master and we start getting new data. In the meantime, I'll manually fix up all the entries in the store. - There should be one app bundle size comment for Android and one for iOS in this PR. Reviewed By: cpojer Differential Revision: D20601620 Pulled By: hramos fbshipit-source-id: 0c3e4b78a74cbd659f1957a6aa74322b016e0646 * Hopefully fix so loading crashes Summary: Changelog: [Android][Internal] Fix potential initializer interruption threading crashes. Reviewed By: mdvacca Differential Revision: D20615755 fbshipit-source-id: 58b706deeb6df1998caff5bf2ae9ec60114313fe * Fix label-actions configuration Summary: Adds back a missing label key, fixes open source issue: https://github.com/facebook/react-native/issues/28378 Changelog: [Internal] [CI] - Fix label-actions config Reviewed By: cpojer Differential Revision: D20625887 fbshipit-source-id: 63c90db249aa9c15369a4b5bcab71cbe75c6d4b8 * Changing Order Of mOverrideColorScheme In Constructor Summary: Changelog: [Android] [Updated] mOverrideColorScheme should be assigned before the first colorSchemeForCurrentConfiguration call, so the initial setting of mColorScheme will reflect the override Reviewed By: zackargyle Differential Revision: D20630173 fbshipit-source-id: a2a2d174d3fc40c14f27dce6a7fa8e67203480c9 * hermes | inspector | Don't include posix headers on non-posix systems Summary: Changelog: [Internal] Hermes inspector includes pthreads, arpa and sys headers on all OSes that would break vanilla Windows builds. This diff adds a check for posix-compliance before inclusion (Note: this ignores all push blocking failures!) Reviewed By: dulinriley Differential Revision: D20564449 fbshipit-source-id: 8e264bc3104065dc4315bb291e8560609fe65184 * Upgrade Prettier from 1.17 to 2.0.2. Summary: This gets us on the latest Prettier 2.x: https://prettier.io/blog/2020/03/21/2.0.0.html Notably, this adds support for TypeScript 3.8, which introduces new syntax, such as `import type`. Reviewed By: zertosh Differential Revision: D20636268 fbshipit-source-id: fca5833d003804333a05ba16325bbbe0e06d6c8a * Back out "Upgrade Prettier from 1.17 to 2.0.2." Differential Revision: D20639755 fbshipit-source-id: 5028563f9cf0527a30b4259daac50cdc03934bfd * Fabric: Additional temporary checks in prop parsing infra Summary: While ViewConfig infra isn't perfect we need to check some value for correctness during prop-parsing. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D20639055 fbshipit-source-id: 193dcd0769bc7777bc8d60c964ede72ebdaa83e4 * Update React package Summary: This just updates the `react` package to the latest stable version. We updated it to experimental internally earlier so this brings the open source version to the latest before the branch cut. This doesn't include any breaking changes. Changelog: [General][Changed] - Update to React 16.13.1 Reviewed By: cpojer Differential Revision: D20642909 fbshipit-source-id: 68a4c74bfe72f1abdb33b0b9071a4f4e8e568318 * Fix sketchy null checks induced by new formatting in Prettier 2.0 Summary: Update code to prepare for Prettier 2.0, which will reformat `a || (b || c)` to `a || b || c`. Changelog: [Internal] prepare for Prettier 2.0 Reviewed By: kassens Differential Revision: D20639483 fbshipit-source-id: c2932b1495884684172ba9291d56c546f51711b8 * RN picker - fix types in AndroidDialogPickerManagerInterface Summary: according to [this crash report](https://our.intern.facebook.com/intern/logview/details/facebook_android_crashes/7ba7056481015482c6166d65cb97e49d/?trace_key=1506fe36a70dd5e50cdc8968f6317f27), `value` was throwing an NPE despite being null-checked. this is because it was an `int` rather than an `Integer`, so the null check wasn't working Changelog: Fix types in AndroidDialogPickerManagerInterface Reviewed By: mdvacca Differential Revision: D20646343 fbshipit-source-id: a27587e0a48f5782bcf5ffddb604018218e65206 * Remove RCTExportModule log spam Summary: The bridge complains if modules aren't exported, which isn't really helpful with lazily loaded modules and turbo modules. I considered only turning this off when TurboModules is enabled, but figured we'd be killing this soon anyways... If anyone feels strongly I can go that approach. Changelog: [iOS][Internal] Remove RCTExportModule log spam Reviewed By: shergin Differential Revision: D20629575 fbshipit-source-id: d32d9fe244c4d06acfee982fca7c7f63da294dc5 * De-jank DevLoadingView Summary: ## Problems Repro steps: 1. Disable Fabric (because CMD + R doesn't work with Fabric right now). 2. Open up Marketplace and hit `CMD + OPT + R` 3. **Observe:** The progress bar doesn't show up right away. It also doesn't actually show progress. https://pxl.cl/140g1 RN Support post: https://fb.workplace.com/groups/rn.support/permalink/3437652016283389/ ## Fixes The first problem is that progress bar doesn't actually show progress. **Fix:** Bundle load progress is updated in `RCTCxxBridge`, where we first require `RCTDevLoadingView`, and then call its `updateProgress` method. Previously, we wouldn't lazily load `RCTDevLoadingView`, it already didn't exist. Lazily loading `RCTDevLoadingView` causes the progress view to show up. Here: https://pxl.cl/140gt If you look at the above video, you'll notice there are two stages to the progress bar: stage 1 displays the actual progress. Stage 2 prompts that we're downloading the JS bundle. As you can see, stage 1 and stage 2 have different background colors, even though both of them are green. **Fix:** I adjusted the JS to match the Native color. Here: https://pxl.cl/140gT We're almost there, but the progress bar is dismissed twice? **Fix:** I dug into the code, and the reason why was because when we hit `CMD + R`, we invalidate the bridge, and immediately re-initialize it. This means that we asynchronously invalidate the old TurboModuleManager, and immediately create a brand new one. Therefore, two `RCTDevLoadingView` modules can (and do) exist at once. So, I moved `RCTDevLoadingView` to be an instance member of `FBReactModule`, to ensure that it doesn't get cleaned up and re-created when TurboModuleManager is deleted and re-created. This finally fixed the progress bar jank: https://pxl.cl/140hn Changelog: [iOS][Fixed] - Remove RCTDevLoadingView jank Reviewed By: rickhanlonii Differential Revision: D20607815 fbshipit-source-id: 05825c67adaf3cfda70be0fa2dc92d413dc8921b * Fix retaining self in block in LogBox impl Summary: Logbox has a retain cycle (see linked task for my deeper investigation). This diff doesn't fix the retain cycle, but it's just good practice to not retain self strongly in blocks. Changelog: [iOS][Internal] Fix retaining self in block in LogBox implementation Reviewed By: shergin Differential Revision: D20630693 fbshipit-source-id: cf399495e9bcd1917932fcc0e9c9d2d2a32bf6f0 * Flow type infoLog Summary: Changelog: [General][Internal] flow type infoLog Reviewed By: zackargyle Differential Revision: D20577939 fbshipit-source-id: eed4401b2ae0a6bf845fdcb54c6abe1fe98fe7c1 * Replace fbsource// with // in xplat/js/ files [1] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: scottrice Differential Revision: D20495655 fbshipit-source-id: a57b72f694c533e2e16dffe74eccb8fdec1f55f5 * Deploy Flow 0.121 to Xplat (#901) Summary: Deploy Flow 0.121 to Xplat bypass-lint allow-large-files Closes https://github.com/facebook/flipper/pull/901 Changelog: [Internal] Reviewed By: panagosg7 Differential Revision: D20570316 fbshipit-source-id: a76983d6f46c8b995ce2dd5cd1e014534790698a * Replace fbsource// with // in xplat/js/ files [3] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D20656211 fbshipit-source-id: deb91b917d349bc500acbb03d734ff621f6e1fc7 * Replace fbsource// with // in xplat/js/ files [4] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: JoshuaGross, shergin Differential Revision: D20656696 fbshipit-source-id: 10f02decb1dc969fd3491ac90d97f09e2bda59e7 * Add Needs: Repro bot action (#28397) Summary: Add automated response for Needs: Repro ## Changelog [Internal] [Added] - Add automated response for Needs: Repro Pull Request resolved: https://github.com/facebook/react-native/pull/28397 Test Plan: Bot should add a comment with the Needs: Repro label. Reviewed By: cpojer Differential Revision: D20665378 Pulled By: hramos fbshipit-source-id: 1c7d878faacf935a640849f74c81f119e5c7e92d * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D20666684 fbshipit-source-id: 32255ac7509e0257693969a7b4b044569af30df7 * ✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392) Summary: Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`. Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job. What was done in this PR: * The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use. * The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument. * The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument * The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument ## Changelog [Internal] [CI] - ✅ Green CI, disabled test infrastructure work Pull Request resolved: https://github.com/facebook/react-native/pull/28392 Test Plan: Verified on Circle CI Reviewed By: cpojer Differential Revision: D20665512 Pulled By: hramos fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726 * Upgrade internal packages to support ESLint >= 6 (#28393) Summary: Fixes https://github.com/facebook/react-native/issues/28293 I've tested it with https://github.com/react-native-community/react-native-template-typescript and it seems to be working as expected - no warnings, supports typescript 3.8. (note: I didn't upgrade the package version as I don't know how the releases work for this package) ## Changelog [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/28393 Reviewed By: hramos Differential Revision: D20647112 Pulled By: cpojer fbshipit-source-id: ca6b67971f625dc8125a58f9220dfcd86250ba94 * Fabric: Fixing a deadlock in RCTSurfacePresenter Summary: This is another attempt to fix an issue very similar to T59424871. The previous attempt was in D19249490. I don't know why we don't see production crashes (stalls) but it happened to me (and not to me) in the debugger. The previous attempt didn't work because we still could have a deadlock because we tried to acquired shared mutex already owned exclusively by the `suspend` method. Here is another approach: Instead of using one shared mutex, now we use two. One is similar to what we had and another that protects `suspend` and `resume`. Besides that, now we pass a Scheduler to functions that use that explicitly. This way we can be more explicit about acquiring mutexes and the overall flow of execution. The idea is: Now an arbitrary code that can be reentrant does not cover with mutexes, so the deadlock is not possible. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20639228 fbshipit-source-id: 98515742f00f2ae94b50b585c9f1f0611e169ebe * Update React Hooks Plugin Summary: Updates `eslint-plugin-react-hooks` to 3.0.0. This introduces a new lint error when you use a Hook inside a class. Changelog: [General][Changed] - Updated the React Hooks ESLint Plugin Reviewed By: cpojer Differential Revision: D20675528 fbshipit-source-id: d0cbe9748fd15df7a4c6de00bd1462610e0a43d6 * Upgrade React DevTools 4.0.6 -> 4.6.0 Summary: Upgrading the embedded version of React DevTools, primarily to pull in [this PR](https://github.com/facebook/react/pull/18397) which will reduce the impact of this package on `node_modules` size. # Update process Following a similar process as D15973709, I began by searching for [all of the references](https://our.intern.facebook.com/intern/biggrep/?corpus=xplat&filename=.json&case=false&view=default&extre=&s=%22react-devtools&engine=apr_strmatch&context=false&filter[uninteresting]=false&filter[intern]=false&filter[test]=false&grep_regex=) to the `react-devtools-core` package and updated all v4 usage to to point to the new 4.6.0 release: 1: Manually update "react-devtools-core" versions: ``` js/package.json js/react-native-github/package.json nuclide/package.json sonar/desktop/app/package.json sonar/desktop/plugins/reactdevtools/package.json vscode/modules/vscode-webview/package.json ``` 2: Setup Yarn proxy: ``` yarn config set proxy http://fwdproxy:8080/ yarn config set https-proxy http://fwdproxy:8080 ``` 3: Run "yarn" in each of the above directories. 4: Run the lockfile shell script: ``` ~/xplat/js/scripts/update-oss-yarn-lockfile.sh ``` 5: Update the generated `MOBILE_JS_NODE_MODULE_DEPS.bzl` by running ``` js1 build buckfiles ``` ## Changelog: [General] [Changed] - Upgrade embedded React DevTools backend from v4.0.6 to v4.6.0. Reviewed By: cpojer, gaearon Differential Revision: D20676091 fbshipit-source-id: 99865bdba9bce45e2a7d582d5fb550cfdbeeca3a * Make ScrollView use ForwardRef Summary: Have ScrollView use forwardRef so that the host component methods like `measure` and `measureLayout` are available without having to call `getNativeScrollRef`. Instead, you can use `<ScrollView ref={myRef} />` and directly call all methods of ScrollView and host components on `myRef`. Previous usage: ``` const myRef = React.createRef<React.ElementRef<typeof ScrollView>>(); <ScrollView ref={myRef} /> const innerViewRef = myRef.current.getNativeScrollRef(); innerViewRef.measure(); ``` New usage: ``` const myRef = React.createRef<React.ElementRef<typeof View>>(); <ScrollView ref={myRef} /> // now, myRef.current can be used directly as the ref myRef.current.measure(); myRef.current.measureLayout(); // Additionally, myRef still has access to ScrollView methods myRef.current.scrollTo(...); ``` Changes: * Added deprecation warnings to ScrollView methods `getNativeScrollRef`, `getScrollableNode`, and `getScrollResponder` * Added the forwardRef call to create `ForwardedScrollView` - this takes in `ref` and passes it into the class ScrollView as `scrollViewRef`. * Forwarded the ref to the native scroll view using `setAndForwardRef`. * Added statics onto `ForwardedScrollView` so that `ScrollView.Context` can still be accessed. * Added type `ScrollViewImperativeMethods`, which lists the public methods of ScrollView. * Converted all public methods of ScrollView to arrow functions. This is because they need to be bound to the forwarded ref. * Bound all public methods of ScrollView to the forwarded ref in the `setAndForwardRef` call. * Flow typed the final output (ForwardedScrollView) as an abstract component that takes in the props of the `ScrollView` class, and has all methods of both the inner host component (`measure`, `measureLayout`, etc) and the public methods (`scrollTo`, etc). Changes to mockScrollView: * Changed mockScrollView to be able to mock the function component instead of a class component * Updated necessary tests Changelog: [General] [Changed] - Make ScrollView use forwardRef Reviewed By: TheSavior Differential Revision: D19304480 fbshipit-source-id: 6c359897526d9d5ac6bc6ab6d5f9d82bfc0d8af4 * Fix issue with onEndReached Summary: onEndReached can be triggered twice when more items are added to the end of the list. This change makes it so that a second call to onEndReached won't happen until the user scrolls down to the new end of the list. Changelog: [General] [Fixed] - Fix double call to onEndReached in VirtualizedList Reviewed By: sahrens Differential Revision: D20066740 fbshipit-source-id: 129d7ae6bfd241eeea18fe0bb12b82be67735874 * Remove console warnings from ScrollView methods Summary: The newly added console warnings in D19304480 are adding a lot of warning noise due to missed infra callsites. Those callsites need to be updated before these warnings can be added. Changelog: [Removed] Remove console warnings from ScrollView methods Reviewed By: rickhanlonii Differential Revision: D20700917 fbshipit-source-id: cb618ee3a291d26e1942e4f91bbc02dee41fb78b * Upgrade react-docgen, jscodeshift and flow-parser Summary: In preparation for upgrading babel, I'm updating some of our source transform tools to the latest versions. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D20675201 fbshipit-source-id: fa4fee2652529c6677087e42cdd1325a8080e46f * Ship State Reconciliation 100% on all platforms Summary: State Reconciliation has been running 50/50 for a while and all metrics look stable. This is necessary for providing a good experience so we should ship to everyone unconditionally. Changelog: [Internal] Fabric diffing reconciliation process improvement Reviewed By: mdvacca Differential Revision: D20715694 fbshipit-source-id: 25b2635ecc29b67e2911679c9db66bc84d37dec1 * Core telemetry tests: update so they pass on my machine Summary: `std::this_thread::sleep_for` is not really precise and will attempt to sleep for "at least" that much time, but may sleep much longer depending on what CPUs are doing and scheduling policies. To get this to pass on my machine, I had to substantially increase the thresholds. Changelog: [Internal] Reviewed By: shergin Differential Revision: D20689571 fbshipit-source-id: f159420d24a95da2b5d95d49ed7882e783291e98 * Optimize diff algorithm to produce fewer remove+insert ("move") paired instructions Summary: An evolution of D20633188 but more performant. There are three optimized paths before the slow path. The first optimized path tries to pair identical nodes from old/new tree, and generate Update mutations, until we hit nodes that are different (indicating either a remove or an insert). This already existed. The next two optimizations, introduced by Tim in his JS pseudocode, were inspired by ReactJS's diffing algorithm. They work in cases where the rest of the nodes are (1) all removals/deletes or (2) all creates+inserts. Finally, if those final two optimized paths can't run, it's because there is a mix of delete+remove, create+insert, and "move" operations, mixed at the beginning, middle, and/or end of the list. This has slightly better average/best-case complexity as the previous implementation. In particularly pathological cases where all nodes are arbitrarily reordered, or reversed, for instance (ABCDE->EDCBA) the algorithm has the same complexity as the previous algorithm (quadratic). For now iOS is pinned to the older differ Changelog: [Internal] Experiment to optimize diffing algorithm in Fabric Reviewed By: shergin Differential Revision: D20684094 fbshipit-source-id: d29fba95a0328156c023e1c87804f23770ee1d91 * Unit test for V2 "minimal instruction" diffing algorithm Summary: This unit test is to verify that the new diffing algorithm generates a "minimal" instruction set, with regards to removes and inserts ("moves"). These unit tests are here to verify the expected behavior in this new algorithm, but these tests may be modified or deleted in the future if we decide we want to change this behavior. Changelog: [Internal] fabric unit test Reviewed By: mdvacca Differential Revision: D20706592 fbshipit-source-id: 5f9991498e0d788ecbf88d938bfe6d3f0f27af40 * Add ES Lint rules for `DynamicColorIOS()`and `ColorAndroid()` (#28398) Summary: The [PlatformColor PR](https://github.com/facebook/react-native/pull/27908) added support for iOS and Android to express platform specific color values. The primary method for an app to specify such colors is via the `PlatformColor()` method that takes string arguments. The `PlatformColor` method returns an opaque Flow type enforcing that apps use the PlatformColor method instead of creating Objects from scratch -- doing so would make it harder to write static analysis tools around Color values in the future. But in addition to `PlatformColor()`, iOS has a `DynamicColorIOS()` method that takes an Object. The Flow type for this Object cannot be opaque, but we still want to enforce that app code doesn't pass variables instead of Object literals or that values in the Objects are variables. To ensure `DynamicColorIOS()` can be statically analyzed this change adds an ESLint rule to enforce that `DynamicColorIOS()` takes an Object literal of a specific shape. A `ColorAndroid()` was also introduced not for practical use but just to test having platform specific methods for more than one platform in the same app. A second ESLint rule is created for `ColorAndroid` as well. ## Changelog [General] [Changed] - Add ES Lint rules for `DynamicColorIOS()`and `ColorAndroid()` Pull Request resolved: https://github.com/facebook/react-native/pull/28398 Test Plan: `yarn lint` passes. Reviewed By: cpojer Differential Revision: D20685383 Pulled By: TheSavior fbshipit-source-id: 9bb37ccc059e74282b119577df0ced63cb9b1f53 * fix: Android gradle config when bundling for release (#28415) Summary: This fix aims to address the issue when bundling an Android app for release and getting the error exhibited in https://github.com/facebook/react-native/issues/28002 which I also encountered myself. The config was changed sometime in November 2019 (as part of https://github.com/facebook/react-native/issues/26940, commit https://github.com/facebook/react-native/commit/a3b08048674e324dbe1f0ca816f35607e9e06a2f) to be very opinionated when it comes to the use of `npx` which Gradle itself cannot find anyway (I have `npx` installed globally and it didn't pick it up). Another issue that the use of `npx` creates is that Gradle should only ever use the currently installed react-native cli rather than a (possibly) higher version which may not always have backward compatibility. The proposed change simply throws a more descriptive error rather than defaulting to a tool which may or may not exist on the machine, be it CI or a development environment. I've also modified the RNTester app to reflect the correct config implementation relative to the RNTester app itself. In real projects, the config inside `android/app/build.gradle` should look similar to the following snippet: ``` project.ext.react = [ cliPath: "$rootDir/../node_modules/react-native/cli.js", entryFile: "index.js" ]; ``` ## Changelog [Android] [Fixed] - Gradle release config Pull Request resolved: https://github.com/facebook/react-native/pull/28415 Test Plan: - [x] Successfully bundled an Android release build with correct config - [x] Works with RNTester app Reviewed By: mdvacca Differential Revision: D20714372 Pulled By: hramos fbshipit-source-id: 4d66139249c6f840582a71a48c64e6a6595f7af0 * Reimplement D19965405: Small improvements in Differentiator/TinyMap Summary: Two things: 1) I reimplement Valentin's idea in D19965405, so that TinyMaps can be iterated over, with a couple of bugfixes (calling front() or back() on an empty vector will crash). 2) I now use TinyMap instead of better::map in the "optimized" diffing algorithm. 3) `erase` now actually removes elements from the vector, but only when more than half of elements have been erased. 4) If you repeatedly erase elements at the beginning of the vector, they will no longer be iterated over. This is a specific optimization for our heaviest TinyMap use-cases. These amount to some small but hopefully somewhat meaningful perf improvements. Changelog: [Internal] Fabric perf Reviewed By: shergin Differential Revision: D20718719 fbshipit-source-id: 91f4b2e2e0f6387ae484e43d5b0095103087baa6 * Remove LayoutInspectingPolicy.includeScrollViewContentOffset Summary: `LayoutInspectingPolicy` has two flags, `includeTransform` and `includeScrollViewContentOffset`. `includeScrollViewContentOffset` seems to be redundant for two reasons. # 1st From looking at callers, they have always the same value. I looked at all call sites, and they are either always both set to true or both set to false. # 2nd The way we include scroll view content offset, is through transformation, so setting `includeTransform` to true and `includeScrollViewContentOffset` to false will include content offset anyway. In order to make both flags work, we would need to introduce further changes to `getRelativeLayoutMetrics`. But since the flag isn't used anyway, I think it is better to get rid of it for now. If we need it in the future, we could re-introduce it. Reviewed By: shergin Differential Revision: D20622256 fbshipit-source-id: fb6156c66b752319ea928239fa723ff90688b0a0 * Add support for translation and rotation to operator * between Rect and Transform Summary: Changelog: [Internal] Until now `Rect operator*(Rect const &rect, Transform const &transform)` supported only scaling. Now it supports translation and rotation as well. Reviewed By: shergin Differential Revision: D20622876 fbshipit-source-id: 1b65393bd3fd6fd9a8941903e0f2681a10097e4a * Include transform property when calling getRelativeLayoutMetrics Summary: Changelog: [Internal] Current implementation of `measure` doesn't take transform into account.. So if you had a view which has width and height 100 and had `Scale(0.5, 0.5, 1)` (this will shrink view by half). Calling `getRelativeLayoutMetrics` would report its size being `{100, 100}`. This applies if view's parent has transformation as well, because transformation is applied to all subviews of the view as well. Reviewed By: mdvacca Differential Revision: D20621590 fbshipit-source-id: 2cf902a0494291c821ecada56f810c5e6620db5a * feat: migrate appveyor to circleci (#28245) Summary: This issue closes https://github.com/facebook/react-native/issues/28241 Migrated Windows test from AppVeyor to CircleCI ## Changelog [Internal] [Changed] - Migrated Windows test from AppVeyor to CircleCI Pull Request resolved: https://github.com/facebook/react-native/pull/28245 Test Plan: For CircleCI to Pass Reviewed By: cpojer Differential Revision: D20689163 Pulled By: hramos fbshipit-source-id: 285c762457ef00f7884ee9157b3f336044c0452f * Remove "Debug with Nuclide" option Summary: This is no longer needed. Reviewed By: cpojer Differential Revision: D20722274 fbshipit-source-id: 5bc3104e90811d724f42aadbf137ab8eff718ca0 * experiment to preload RN bridge after fb4a bookmarks render Summary: Changelog: [Android][Internal] add internal supermodule label Reviewed By: mdvacca Differential Revision: D20434200 fbshipit-source-id: fae50309cdd0df4a4523c2f88d1c8e01a7163575 * Fix CursorDrawable Color Tint for Android 10+ Summary: Accessing this field via reflection is explicitly blacklisted by Google in Android 10 and higher. They have provided a new API to change the color, which I have implemented here. [The old setColorFilter is deprecated](https://developer.android.com/reference/android/graphics/drawable/Drawable#setColorFilter(int,%20android.graphics.PorterDuff.Mode)) so I also updated that method call as well. Changelog: [General] [Fixed] Use new setTextCursorDrawable API for Android 10 Reviewed By: JoshuaGross Differential Revision: D20656068 fbshipit-source-id: 58a92b57c0a892c7c87fc5d735e4ceaa4e987ec7 * Early return on tinting CursorDrawable if no color supplied Summary: There's (potentially) a lot of expensive reflection calls here that, as best I can tell, end up being ignored if the supplied color is null. Better to early return. Changelog: [General] [Internal] Preclude reflection when setting cursor color if color is null Reviewed By: JoshuaGross Differential Revision: D20670594 fbshipit-source-id: 480a988355bbd79008002c4326d4b35035ec2a95 * Partial React Sync for Inspector Summary: Partial sync for React that includes: - https://github.com/facebook/react/pull/18388 - https://github.com/facebook/react/commit/dd7e5e4f5ac2ffac3171ef61daee2cb1edc69635 Created from this branch: https://github.com/facebook/react/compare/master...rickhanlonii:rh-partial-3-24?expand=1 Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20651395 fbshipit-source-id: 67baf7c407f75d9fd01c17f2203a77a38567100e * Enable inspector for Fabric Summary: ## Overview This diff refactors the Inspector, moving logic to look up view data for a touched view inside the renderer as `getInspectorDataForViewAtPoint`. We then implement that same function for Fabric in order to support the inspector in that renderer. Requires https://github.com/facebook/react/pull/18388 ## Motivation Reason one for this refactor is that, previously, the inspector held all of the logic to look up view data for a given x,y touch coordinate. To do this, it would take the React tag and coordinates, look up the native view tag, measure it, and then ask React internals for the Fiber information of that tag. All of this is deeply coupled to React internals, yet the logic is outside of React core in the Inspector. Reason two is that, for Fabric, the logic for getting the view data is different than Paper. In Fabric, we pass the x,y coordinates to native directly, which returns an instance handle. That handle can be used to measure the ShadowNode, or retrieve the Fiber information. By moving the logic into the renderer in React core, we decouple the implementation details of looking up view data for a tapped point and allow ourselves the ability to add and change renderer-specific code for the actual lookup without impacting outsiders like the Inspector. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D20291710 fbshipit-source-id: a125223f2e44a6483120c41dc6146ad75a0e3e68 * chore: update url of warning message from deprecated imports (#28452) Summary: Some of the repository name of Lean Core(https://github.com/facebook/react-native/issues/23313) libraries has been renamed. This PR updates the warning message to display the updated url. ## Changelog [General] [Changed] - Update warning message of deprecated imports Pull Request resolved: https://github.com/facebook/react-native/pull/28452 Test Plan: updated URL can be accessed. Reviewed By: cpojer Differential Revision: D20745184 Pulled By: TheSavior fbshipit-source-id: 2c3ed6a000b45022ca6c4862305aa567c4d18b2e * Add `upgrade-support` link on issue creation (#28411) Summary: This PR adds a https://github.com/react-native-community/upgrade-support link for the user when creating an issue. Changelog: [Internal] Pull Request resolved: https://github.com/facebook/react-native/pull/28411 Reviewed By: cpojer Differential Revision: D20714274 Pulled By: hramos fbshipit-source-id: 4ca42224a50e386b95f21f0fb236a917e1b6b982 * Update PixelRatio 'getFontScale' method description (#28407) Summary: Refs facebook/react-native-website#1776. Despite in-code description `PixelRatio.getFontScale()` is working properly on the iOS (it also reflects the user settings). This PR updates the in-code description to match current behaviour. I have decided to skip in the code information about additional setting in `Accessibility` menu and in `Control Centre`, but if you think it is important just let me know, I can update this PR. ## Changelog [Internal] [Fixed] - Fix PixelRatio getFontScale method description Pull Request resolved: https://github.com/facebook/react-native/pull/28407 Test Plan: N/A Differential Revision: D20750260 Pulled By: shergin fbshipit-source-id: c40ec2fd49cd60e2975351c3a1c453aab0045da4 * Remove allowDisablingImmediateExecutionOfScheduleMountItems feature flag Summary: No longer needed. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20747684 fbshipit-source-id: a8077519b7670d72e23267b1c1423556ec97be3f * RuntimeExecutor helpers that modify the way of the callback is being executed. Summary: Here we implement a bunch of helper methods that allow customizing the behavior of a RuntimeExecutor "on-demand" on the caller side. We will use it in the next diff(s). Changelog: [Internal] Fabric-specific internal change. Reviewed By: PeteTheHeat Differential Revision: D20551411 fbshipit-source-id: 51d3cd02b69753110c0e1155347c6e52eb882c7d * Fabric: Using `executeSynchronouslyOnSameThread_CAN_DEADLOCK` in MainRunLoopEventBeat Summary: We are replacing inline-ed implementation with practically the same one implemented as the helper method. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20551409 fbshipit-source-id: fcc6f497cd240af65fba534051c217fe5746ce82 * Set RootNodeKind trait in ModalHostViewShadowNode Summary: Changelog: [internal] `ModalHostViewShadowNode` didn't have `RootNodeKit` trait, therefore `getRelativeLayoutMetrics` was including nodes in ancestors that it shouldn't have. Reviewed By: shergin Differential Revision: D20735801 fbshipit-source-id: 6b81e3b174c2f82e530abc2bca2da8bebc2270b0 * mention RNTester app in contributor guide (#28042) Summary: motivation is following - the RNTester app is imho the best place to try out any changes that a contributor would make, yet it is not directly mentioned in the contributor guide. This fixes it. ## Changelog [Internal] - Docs Pull Request resolved: https://github.com/facebook/react-native/pull/28042 Test Plan: not necessary Reviewed By: TheSavior Differential Revision: D20401260 Pulled By: hramos fbshipit-source-id: 01c1b7dff56b59909c94b2feb609650f0baba1a9 * Buck: Use Android SDK 29 during build (#28455) Summary: Fixes `test_android` and `test_docker` build failures. Thanks to dulmandakh for identifying the fix. Changelog: [Internal] [Android] [Changed] - Use Android SDK 29 to build during CI tests Pull Request resolved: https://github.com/facebook/react-native/pull/28455 Test Plan: Circle CI shows `test_android` and `test_docker` passing: https://app.circleci.com/jobs/github/facebook/react-native/142273 Reviewed By: sturmen Differential Revision: D20766589 Pulled By: hramos fbshipit-source-id: 8ef8a8ce3a6e7353ae47425accb3bd26cf1608c4 * Assign orderIndex_ in ConcreteViewShadowNode constructor instead of ViewShadowNode's constructor Summary: Changelog: [Internal] `orderIndex_` was only being assigned for `ViewShadowNode`, not for other `ShadowNodes` that are later represented on the screen. Reviewed By: shergin Differential Revision: D20746477 fbshipit-source-id: c04c2cfea14b9141d22bc3d9e9bb4c0c59925754 * Implement nativePerformanceNow to improve Profiler API results (#27885) Summary: When experimenting with React Profiler API (https://reactjs.org/docs/profiler.html), I noticed that durations are integers without a debugger, but they are doubles with higher precision when debugger is attached. After digging into React Profiler code, I found out that it's using `performance.now()` to accumulate execution times of individual units of work. Since this method does not exist in React Native, it falls back to Javascript `Date`, leading to imprecise results. This PR introduces `global.nativePerformanceNow` function which returns precise native time, and a very basic `performance` polyfill with `now` function. This will greatly improve React Profiler API results, which is essential for profiling and benchmark tools. Solves https://github.com/facebook/react-native/issues/27274 ## Changelog [General] [Added] - Implement `nativePerformanceNow` and `performance.now()` Pull Request resolved: https://github.com/facebook/react-native/pull/27885 Test Plan: ``` const initialTime = global.performance.now(); setTimeout(() => { const newTime = global.performance.now(); console.warn('duration', newTime - initialTime); }, 1000); ``` ### Android + Hermes ![Screenshot_1580198068](https://user-images.githubusercontent.com/13116854/73245757-af0d6c80-41b5-11ea-8130-dde14ebd41a3.png) ### Android + JSC ![Screenshot_1580199089](https://user-images.githubusercontent.com/13116854/73246157-92256900-41b6-11ea-87a6-ac222383200c.png) ### iOS ![Simulator Screen Shot - iPhone 8 - 2020-01-28 at 10 06 49](https://user-images.githubusercontent.com/13116854/73245871-f136ae00-41b5-11ea-9e31-b1eff5717e62.png) Reviewed By: ejanzer Differential Revision: D19888289 Pulled By: rickhanlonii fbshipit-source-id: ab8152382da9aee9b4b3c76f096e45d40f55da6c * Save/restore IP when leaving the interpreter Summary: This diff implements the instruction pointer save/restore trick Tzvetan came up with; allowing us to observe and modify the IP from outside the interpreter loop with negligible overhead. From Tzvetan's internal post on the subject: > [Today] the interpreter IP is just a local variable in the interpreter function, so there is no way to get to its value from outside the function. It lives in a register and we don't want to make it a Runtime field since the overhead [of accessing it via memory in the interpeter loop] would kill us. > However, if you really think about it, it only lives in a register while the interpreter function is running. For the rest of the time, it is spilled by the C++ compiler onto the stack. So, precisely when we need it, it is actually stored in memory. The only problem is, we don't know where! Admittedly, that is an annoying problem, but it feels like it should be solvable. > What if, instead of relying on the compiler to spill the IP register, we manually spill it ourselves, to a known location? It works. Example: https://godbolt.org/z/ftSDnp This diff implements this approach across the whole interpreter loop: whenever we call out of the loop we capture/publish the IP and restore it again immediately after the external call returns. This means we can now see the IP outside the interpret loop and even change it. This is effectively "for free" as the compiler now skips spilling/restoring the IP behind the scenes. The immediate benefit of this is knowing the current IP allows us to have more accurate stack-traces during execution. In future this may enabled tricks like changing the IP before returning to the interpreter loop, allowing things outside the interpreter to affect program flow without adding logic to the interpreter loop. Reviewed By: tmikov Differential Revision: D20151091 fbshipit-source-id: 3814382639800208d8985a32ede31ba8f7ff7c80 * Plumb through memory allocation profiler feature to Chrome Inspector Summary: Changelog: Make allocation profiler feature of Chome Inspector work Reviewed By: dulinriley Differential Revision: D20383003 fbshipit-source-id: 8a10c310d5a639a6644763adb53f2f0017057587 * chore: update lint config in template (#28443) Summary: Updating the eslint config and metro-preset used in project template. ## Changelog [General] [Changed] - Upgrade eslint-config and metro-preset in project template Pull Request resolved: https://github.com/facebook/react-native/pull/28443 Test Plan: - Start new project with `npx react-native init TestLint` - upgrade lint and metro-config - run lint and start up emulator on iOS and android Reviewed By: cpojer Differential Revision: D20771048 Pulled By: hramos fbshipit-source-id: a6d387b8687cee348681bcb10d22c7e3de291ed7 * Apply buckformat in preparation for updating buildifier Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D20773287 fbshipit-source-id: 144bb13191312eef246646b99e1dc06304c6d210 * Circle CI Housekeeping: Windows, e2e (#28471) Summary: Circle CI Housekeeping: * Integrate Windows job into `tests` workflow * Add parametrized e2e tests command * Move js e2e tests out of the disabled test quarantine area * Parametrize and split `test_ios` job to reduce total execution time by ~13 minutes **Before:** Longest running iOS job at 39 minutes. | Setup Job Runtime | Job | Job Runtime | Total Runtime | | - | - | - | - | | 01:24 | test_ios | 38:04 | **39:28** | | 01:24 | test_ios_frameworks | 38:02 | 39:26 | ![Screen Shot 2020-03-31 at 12 40 29 PM](https://user-images.githubusercontent.com/165856/78068308-044c3280-734d-11ea-96bf-2e50691a0ef7.png) **After:** Longest running iOS job down to 26 minutes. | Setup Job Runtime | Job | Job Runtime | Total Runtime | | - | - | - | - | | 01:26 | test_ios_unit | 20:48 | 22:14 | | 01:26 | test_ios_unit_frameworks | 22:52 | 24:18 | | 01:26 | test_ios_detox | 24:35 | 39:28 | | 01:26 | test_ios_detox_frameworks | 24:54 | **26:20** | ![Screen Shot 2020-03-31 at 12 39 22 PM](https://user-images.githubusercontent.com/165856/78068294-fe565180-734c-11ea-96da-8836231d7747.png) ## Changelog [Internal] [CI] - CI Housekeeping Pull Request resolved: https://github.com/facebook/react-native/pull/28471 Test Plan: Circle CI Reviewed By: cpojer Differential Revision: D20774521 Pulled By: hramos fbshipit-source-id: 4a2f5a4083cd76dcb51d5ccaf726cd204fca222e * Fix bug in optimized differ Summary: The differ was still producing correct, but not minimal, instruction sets in some cases due to an optimization that was buggy. This affected cases where 2+ nodes were inserted at the beginning of a list. It would trigger the old behavior where all nodes after the first would be removed, deleted, then reinserted. See the test case (which was failing and now passed) and P128190998 (the 3->4 transition) for samples. Changelog: [Internal] Fabric differ Reviewed By: mdvacca Differential Revision: D20785729 fbshipit-source-id: 2fea6a816753066abb358ed7bb51003140cd5fc4 * Use `buildCodeFrameError` in babel-plugin-inline-view-configs Summary: The next version of Babel changes how it prints file names in errors. This diff fixes the test by using `/` as the `cwd` and switches the plagin to use `path.buildCodeFrameError` so errors will be more helpful for users. I renamed the `nodePath` variable to `path` because that's what babel plugins usually do. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D20781805 fbshipit-source-id: cc149dce6389aa9402ce70ea30035c74a6150ea3 * Swap left and right yoga position with start and end in RTL context Summary: Changelog: [Internal] Paper swaps right and left in RTL setting, this logic is in [RCTShadowView.m](https://our.intern.facebook.com/intern/diffusion/FBS/browse/master/xplat/js/react-native-github/React/Views/RCTShadowView.m?commit=cdd504cfbee66ae0659495604c4ff7b5764a1d9e&lines=529-549). For Fabric instead of doing it during yoga props assignment, I swap the left/right with start/end just before we pass yoga nodes to layout calculation. Reviewed By: shergin Differential Revision: D20420040 fbshipit-source-id: b777f2658f56c173743b2034b8b5059e3e0c9840 * Fix inline-view-configs test on Windows. Summary: *facepalm* The file path is platform specific. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D20793023 fbshipit-source-id: 4fbcbf982911ee449a4fa5067cc0c5d81088ce04 * Pass isRTL flag from FabricUIManager Fabric core Summary: Changelog: [Internal] Send `isRTL` flag and `doLeftAndRightSwapInRTL` flags from Java to Fabric Core. Reviewed By: JoshuaGross, mdvacca Differential Revision: D20776005 fbshipit-source-id: 946c239d9a11ebea958b0a6d04f2316b7cd77311 * Promote shadowColor to formsStackingContext property Summary: Changelog: [Internal] View with `ShadowColor` was getting flattened and therefore views didn't have shadow property set. This is fixed by promoting ShadowColor so in case it is set, it forms stacking context. Reviewed By: shergin Differential Revision: D20792201 fbshipit-source-id: 1033ac00e32047ffbb14e61b7c26348c578d132d * Get CallInvokers from the bridge Summary: ## Context For now, assume TurboModules doesn't exist. **What happens when we call an async NativeModule method?** Everytime JS calls an async NativeModule method, we don't immediately execute it. The legacy infra pushes the call into some queue managed by `MessageQueue.js`. This queue is "flushed" or "emptied" by the following events: - **Flushed:** A C++ -> JS call. NativeModule async methods can called with an `onSuccess` and/or `onFail` callback(s). Calling `NativeToJsBridge::invokeCallback` to invoke one of these callbacks is one way for ObjC++/C++/Java to call into JS. Another way is via JSModule method calls, which are initiated by `NativeToJsBridge::callFunction`. - **Flushed:** When `JSIExecutor::flush` is called. Since TurboModules don't exist, this only happens when we call `JSIExecutor::loadApplicationScript`. - **Emptied:** When more than 5 ms have passed, and the queue hasn't been flushed/emptied, on the next async NativeModule method call, we add to the queue. Afterwards, we empty it, and invoke all the NativeModule method calls. **So, what's the difference between flushed and emptied?** > Note: These are two terms I just made up, but the distinction is important. If the queue was "flushed", and it contained at least one NativeModule method call, `JsToNativeBridge` dispatches the `onBatchComplete` event. On Android, the UIManager module is the only module that listens to this event. This `onBatchComplete` event doesn't fire if the queue was "emptied". **Why does any of this matter?** 1. TurboModules exist. 2. We need the TurboModules infra to have `JsToNativeBridge` dispatch `onBatchComplete`, which depends on: - **Problem 1:** The queue being flushed on calls into JS from Java/C++/ObjC++. - **Problem 2:** There being queued up NativeModule async method calls when the queue is flushed. In D14656466, fkgozali fixed Problem 1 by making every C++/Java/Obj -> JS call from TurboModules also execute `JSIExecutor::flush()`. This means that, with TurboModules, we flush the NativeModule async method call queue as often as we do without TurboModules. So far, so good. However, we still have one big problem: As we convert more NativeModules to TurboModules, the average size of the queue of NativeModule method calls will become smaller and smaller, because more NativeModule method calls will be TurboModule method calls. This queue will more often be empty than not. Therefore, we'll end up dispatching the `onBatchComplete` event less often with TurboModules enabled. So, somehow, when we're about to flush the NativeModule method call queue, we need `JsToNativeBridge` to understand that we've executed TurboModule method calls in the batch. These calls would have normally been queued, which would have led the queue size to be non-zero. So if, during a batch, some TurboModule async method calls were executed, `JsToNativeBridge` should dispatch `onBatchComplete`. **So, what does this diff do?** 1. Make `Instance` responsible for creating the JS `CallInvoker`. 2. Make `NativeToJsBridge` responsible for creating the native `CallInvoker`. `Instance` calls into `NativeToJsBridge` to get the native `CallInvoker`. 3. Hook up `CatalystInstanceImpl`, the Android bridge, with the new JS `CallInvoker`, and the new native `CallInvoker`. This fixes `onBatchComplete` on Android. iOS work is pending. Changelog: [Android][Fixed] - Ensure `onBatchComplete` is dispatched correctly with TurboModules Reviewed By: mdvacca Differential Revision: D20717931 fbshipit-source-id: bc3ccbd6c135b7f084edbc6ddb4d1e3c0c7e0875 * Make HermesRuntime::description() always include "HermesRuntime" Summary: If name is passed in as part of RuntimeConfig, that is included in the description, too. Changelog: [Internal] Reviewed By: dulinriley Differential Revision: D20716320 fbshipit-source-id: f2fba6df32f496090dee787d8b7f55a6a4dd8ed8 * Fix Yoga flexshrink with min-width sizing issue Summary: While resolving the flexible items we calculate totalFlexShrinkScaledFactors which uses the flexBasis or initial width of node (Not min-width). At a later stage during distribution of space we are subtracting value from this which also takes care of min-width. For example If node has flexShrink 1 and width 100 and min-width 301 then totalFlexShrinkScaledFactors will become -1*100 = -100 but later we are subtracting -1 * 301 (min-width) = -301 which is ambiguous and causing layout inconsistencies with how web behaves. Fixed this by only using the flexBasis or width for these calculations. Changelog: [Internal][Yoga] Fix layout issue when flexShrink and min-width are used together Reviewed By: pasqualeanatriello Differential Revision: D20219419 fbshipit-source-id: 948fbc06ca541d4ad307c88c8a2df65d157778b1 * More consistent snapshots on windows (#28482) Summary: Get jest tests to be runnable on windows, and match current snapshots ## Changelog [Internal] [Fixed] - More consistent snapshots on windows Pull Request resolved: https://github.com/facebook/react-native/pull/28482 Test Plan: run `yarn test` on a windows machine, and hit the test_windows circleci tests Reviewed By: hramos Differential Revision: D20799002 Pulled By: cpojer fbshipit-source-id: da3db0171c34a43199c7d3dc17b622b37bc91701 * Improve component stack parsing Summary: Update the error log message parsing to fix missing component stacks in console.errors. Changelog: [Internal] Reviewed By: cpojer Differential Revision: D20801985 fbshipit-source-id: ae544200315a8c3c0310e8370bc38b0546734f38 * Implement RCTWarn equivalent on Android Summary: ## Overview This diff is an RFC to port a logging feature from iOS to Android. Changelog: [Internal] ## Motivation On iOS we have the following log functions and behaviors available for logging native warnings and errors: - **Warnings** (`RCTLogWarn`) - Log level 'warn' to console - Display warning in LogBox - **Errors** (`RCTLogError`) - Log level 'error' to console - Display a native RedBox (needs converted to show a LogBox if available) - **Logs** - We also have `RCTLog`, `RCTTrace`, `RCTAdvice`, `RCTInfo`, which just log to the console. In Java, we have: - **Warnings** - **None**, added in this diff - **Errors** (`DevSupportManager.showNewJavaError`) - Log level 'error' to console with `FLog.e` - Display a native RedBox (needs converted to show a LogBox if available - **Logs** - `ReactSoftException` (crashes the app??) - `ReactNoCrashSoftException` (only logs??) - Others? ## Details This diff adds a method to pair with `RCTLogWarn`, `DevSupportManager.showNewJavaWarning`, which will log to the console and show a LogBox warning if LogBox is available. ## Concerns I have a few concerns/questions about the state of logging on Android: - Should/can we move all of the logging to it's own class, like how RCTLog works? - Why does some logging happen on DevSupportManager and some in other classes? - If we moved it all to it's own class, how could we access the reactContext to call the RCTLog JS module Reviewed By: JoshuaGross Differential Revision: D20056394 fbshipit-source-id: 32d57e300685e46da8039fc77cb22b4084acf81a * Remove unused feature flag: useMapNativeAccessor Summary: useMapNativeAccessor isn't being used anywhere. Changelog: [Internal] Removing unused internal feature flags: mUseMapNativeAccessor and mUseArrayNativeAccessor Reviewed By: mdvacca Differential Revision: D20788147 fbshipit-source-id: bf670508326813602cb544f86d3d2164651d3394 * Remove unused Feature Flag: lazilyLoadViewManagers Summary: Remove unused feature flag. This is not used within Facebook and I'm not aware of usage outside of FB. Changelog: [Removed] Removing Android feature flag: lazilyLoadViewManagers Reviewed By: mdvacca Differential Revision: D20788210 fbshipit-source-id: 435316e3de7830d7cb7f14537351883e4fc6eeaa * Remove unused feature flag: enableExtraWebViewLogs Summary: Hard-coded to false everywhere, and write-only. We never read from this. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20788252 fbshipit-source-id: ae117ebc51db7045947b9713602527ff4220833e * Remove unused feature flag: logDroppedViews Summary: Remove unused internal feature flag, logDroppedViews. Changelog: [Internal] Reviewed By: lunaleaps Differential Revision: D20797353 fbshipit-source-id: 1bfea7fcce9e80cdb92cda59a89c7dd817d4a581 * Split loadApplicationScript into initializeRuntime and loadBundle (#27844) Summary: This is the first of three PRs related to enabling multi-bundle support in React Native. More details, motivation and reasoning behind it can be found in RFC [here](https://github.com/react-native-community/discussions-and-proposals/issues/152). Logic responsible for installing globals was pulled out from `loadApplicationScript` to `initializeRuntime` since it should be ran only once, what was left was renamed to `loadBundle`. It's based on dratwas work from [here](https://github.com/callstack/react-native/tree/feat/multibundle/split-load-application), but applied to current `master` to avoid rebasing 3-months old branch and issues that come with that. ## Changelog [Internal] [Changed] - split `loadApplicationScript` into `initializeRuntime` and `loadBundle` to enable multi-bundle support in the future Pull Request resolved: https://github.com/facebook/react-native/pull/27844 Test Plan: Initialized new RN app with CLI, set RN to build from source and verified the still app builds and runs OK using code from this branch. Reviewed By: rickhanlonii Differential Revision: D19888605 Pulled By: ejanzer fbshipit-source-id: 24ace48ffe8978796591fe7c6cf53a61b127cce6 * Back out "Fix controlled TextInput with child nodes" Summary: Changelog: [Internal] Original commit changeset: 1b8a2efabbfa Original diff D20587681 breaks non-controlled text input. Reviewed By: motiz88 Differential Revision: D20815935 fbshipit-source-id: 70577ed1e5701850ff0e30a6592945a31c2a8bec * Fixed crash in JSIExecutor::NativeModuleProxy Summary: JSIExecutor::NativeModuleProxy is an object created by JSIExecutor and essentially representing that in JavaScript world. Before this change, JSIExecutor::NativeModuleProxy had a raw reference to JSIExecutor which (I believe) caused a crash because JSIExecutor can be deallocated before JSIExecutor::NativeModuleProxy. Now, instead of storing a pointer to JSIExecutor, we store a weak pointer to JSINativeModules which we can safely validate before calling on it. Changelog: [Internal] Fixed crash in JSIExecutor Now the configuration looks like this: ``` + - - - - - - - - - - - - - - - - - - - - - Something else | | shared_ptr<jsi::Runtime> runtime --+ | | + - - - - - - - - - - - - - - - - - - - - - | | | +------------------------------------------+ | | | | | JSExecutorFactory | | +--------------------------------+-------------------------------+ | | +-----------------------+ | | | +------------------------------------------+ | | v | | | +------------------------------------------+ | +--------------------------+ | | | | | | | | ModuleRegistry | | v | | | | | +------------------------------------------+ | | +------------------------------------------+ | | HermesRuntimeImpl | | | | | | (jsi::Runtime) |--+ | | +->+------------------------------------------+ | | | | | | | |std::unordered_map<std::string, size_t> | | +------------------------------------------+ | | | | |modulesByName_ | | | | | | | | | | | | | +------------------------------------------+ | | | | +->+------------------------------------------+ | +-----------------------+ | | |std::vector<std::unique_ptr<NativeModule>>| | | | | |modules_ | | | | | | | | v | | +------------------------------------------+ | +------------------------------------------+ | | | | | | | | | JSIExecutor::NativeModuleProxy | | | | | | | | | +------------------------------------------+ | | | +------------------------------------------+ | | | | | | +->+------------------------------------------+ | | | | NativeToJsBridge | |shared_ptr<JSINativeModules> | | | | | | |nativeModules_ | | | | +------------------------------------------+ +------------------------------------------+--+-----+------------------------------------+ | | | | | | +->+------------------------------------------+ | | | | | |unique_ptr<JSExecutor> | | | | | | |m_executor | | | | | | |(`::destroy()` resets it.) | | | | | | +------------------------------------------+--------------------------------+ | | | | +->+------------------------------------------+ | | | | | | |shared_ptr<JsToNativeBridge> | | | | | | | |m_delegate | | | | | | | +------------------------------------------+--+ v | | | | +->+------------------------------------------+ | +------------------------------------------+ | | | | |shared_ptr<MessageQueueThread> | | | | | | | | |m_executorMessageQueueThread | | | HermesExecutor: JSIExecutor: JSExecutor | | | | | +------------------------------------------+ | | | | | | | | +------------------------------------------+ | | | | | | | | | | | +->+------------------------------------------+ | | | | | | |shared_ptr<jsi::Runtime> | | | | | | | |runtime_ | | | | | | | +------------------------------------------+--+ | | | | +->+------------------------------------------+ | | | | | |shared_ptr<JSINativeModules> | | | | | | |nativeModules_ | | | | | | +------------------------------------------+--------+------------------------------------+ | +--------------------------+ +->+------------------------------------------+ | | | | |std::shared_ptr<ExecutorDelegate> | | v | | |delegate_ | | +------------------------------------------+ | | +------------------------------------------+--+ | | | | | | | | JSINativeModules | | | | | | | | | | | +------------------------------------------+ | | | | | | | | | +-->+------------------------------------------+ | +-----------------------------------------------------------------------------------+ | |m_moduleRegistry | | | | |(shared_ptr) | | | | +------------------------------------------+--+ | | | | v | +------------------------------------------+ | | | | | JsToNativeBridge: ExecutorDelegate | | | | | +------------------------------------------+ | | | +->+------------------------------------------+ | |shared_ptr<ModuleRegistry> | | |m_registry | | +------------------------------------------+-----------------------------------------------------------------+ ``` Reviewed By: RSNara Differential Revision: D20817257 fbshipit-source-id: 9ae378dbe880aaabfef7ae783dae2f94ee4b0af5 * Fix crash caused by <Modal> trying to present view controller twice Summary: Changelog: [Internal] `_viewController` was being presented twice causing following exception ``` 'Application tried to present modally an active controller <FBReactRootViewController: 0x7fe741818b80; ``` Reviewed By: shergin Differential Revision: D20820395 fbshipit-source-id: 5c9489011e5f99d8bd37befbd544d2d55a650589 * Loosen up restrictions for internal changelogs (#28486) Summary: Do not nag on PRs that contain internal changelogs (meaning, the change doesn't need to be called out in release notes). ## Changelog [Internal] - This should be acceptable. Pull Request resolved: https://github.com/facebook/react-native/pull/28486 Test Plan: See PR. Reviewed By: cpojer Differential Revision: D20817454 Pulled By: hramos fbshipit-source-id: a7082c4db05ec53ad27349db7e5bce2cfffd6930 * Fix TextInlineViews when UIImplementation processes two roots at the same time Summary: This diff cleans the variable NativeViewHierarchyOptimizer.mTagsWithLayoutVisited right after all the view updates for a rootShadowNode have been processed by the UIImplementation class. This intends to fix the bug reported in the task: T61185028, which root cause seems related to the fact that the variable NativeViewHierarchyOptimizer.mTagsWithLayoutVisited is not cleaned up when updating multiple rootShadowNodes as part of the same batch changelog: [Android][internal] internal bug fix Reviewed By: JoshuaGross Differential Revision: D20812921 fbshipit-source-id: 28067ee29a931d7a9e9c33c90aceb4e3512dac1a * Add a React Feature Flag to control TextInlineView fix Summary: This diff adds a temporary Feature Flag to control a fix in TextInlineView (see previous diffs of the stack) changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D20812920 fbshipit-source-id: 90fece9b29ba173546d96e4d9baf1ccabb3031b2 * Pass native CallInvoker to ObjCTurboModule constructor Summary: This is necessary to integrate TurboModule async method dispatch with the bridge's `onBatchComplete` event. See D20717931 for more details. This diff is similar to D20480971. **Note:** This stack doesn't really make any functional changes, since the native CallInvoker is `nullptr` right now. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809199 fbshipit-source-id: bf465a3a51bdddb8b56d1e696ca510fdf071f9ec * Manual changes required to make ObjCTurboModule accept native CallInvoker Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809200 fbshipit-source-id: d540eec9a3360a031f75d76a6ab9fb15303f8af5 * Codemod all getTurboModuleWithJsInvoker methods to accept a native CallInvoker Summary: To make iOS TurboModules integrate with the bridge's onBatchComplete event, they need to use a native CallInvoker. This call invoker is created by the `NativeToJsBridge`, and ObjCTurboModule will use this native CallInvoker to dispatch TurboModule method calls. This diff makes sure that ObjCTurboModules are created with that native CallInvoker. ## Script ``` var withSpaces = (...args) => args.join('\s*') var regexString = withSpaces( '-', '\(', 'std::shared_ptr', '<', '(?<turboModuleClass>(facebook::react::|react::|::|)TurboModule)', '>', '\)', 'getTurboModuleWithJsInvoker', ':', '\(', 'std::shared_ptr', '<', '(?<callInvokerClass>(facebook::react::|react::|::|)CallInvoker)', '>', '\)', '(?<jsInvokerInstance>[A-Za-z0-9]+)', 'perfLogger', ':', '\(', 'id', '<', 'RCTTurboModulePerformanceLogger', '>', '\)', '(?<perfLoggerInstance>[A-Za-z0-9]+)', '{', 'return', 'std::make_shared', '<', '(?<specName>(facebook::react::|react::|::|)Native[%A-Za-z0-9]+SpecJSI)', '>', '\(', 'self', ',', '\k<jsInvokerInstance>', ',', '\k<perfLoggerInstance>', '\)', ';', '}', ) var replaceString = `- (std::shared_ptr<$<turboModuleClass>>) getTurboModuleWithJsInvoker:(std::shared_ptr<$<callInvokerClass>>)$<jsInvokerInstance> nativeInvoker:(std::shared_ptr<$<callInvokerClass>>)nativeInvoker perfLogger:(id<RCTTurboModulePerformanceLogger>)$<perfLoggerInstance> { return std::make_shared<$<specName>>(self, $<jsInvokerInstance>, nativeInvoker, $<perfLoggerInstance>); }` const exec = require('../lib/exec'); const abspath = require('../lib/abspath'); const relpath = require('../lib/relpath'); const readFile = (filename) => require('fs').readFileSync(filename, 'utf8'); const writeFile = (filename, content) => require('fs').writeFileSync(filename, content); function main() { const tmFiles = exec('cd ~/fbsource && xbgs -n 10000 -l getTurboModuleWithJsInvoker:').split('\n').filter(Boolean); tmFiles .filter((filename) => !filename.includes('microsoft-fork-of-react-native')) .map(abspath) .forEach((filename) => { const source = readFile(filename); const newSource = source.replace(new RegExp(regexString, 'g'), replaceString); if (source == newSource) { console.log(relpath(filename)); } writeFile(filename, newSource); }); } if (!module.parent) { main(); } ``` Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809202 fbshipit-source-id: 5d39b3cacdaa5681b70ce1803351d0432dd74550 * Make RCTTurboModuleManagerDelegate getTurboModule accept native CallInvoker and PerfLogger Summary: Might be worthwhile to just kill this method instead, since we're having all NativeModules provide their TurboModule jsi::HostObjects. But I'll leave that decision to a later time. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809201 fbshipit-source-id: ee73d4b5454a76460832a54f9b864841e5b2b9c0 * eslint-config: add version badge and add homepage for eslint-config (#28506) Summary: Add version badge to README of eslint-config, and add specific url for the homepage so people looking at the npm package can find out where the package is from. ## Changelog [Internal] [Changed] - Add version badge to README of eslint-config Pull Request resolved: https://github.com/facebook/react-native/pull/28506 Test Plan: Not required as the only changes are made in README and homepage prop of package.json Differential Revision: D20837085 Pulled By: cpojer fbshipit-source-id: 820d3b44b069780ec8764c6152d2e7fd5220933c * Rename Instance::getNativeCallinvoker to Instance::getDecoratedNativeCallInvoker Summary: Now, instead of accepting a `std::function` that schedules work, and returning a `CallInvoker`, `Instance::getDecoratedNativeCallInvoker` will accept a `CallInvoker` that schedules work, and return a decorated `CallInvoker`. I think this change will help with readability. It also clarifies that the bridge is adding additional behaviour to the native `CallInvoker`. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20826885 fbshipit-source-id: a2c5681d10a4544ee3d2a0d1f1cbd386ef06d0e6 * Add CallInvoker::invokeSync Summary: We'll be using a native CallInvoker to dispatch sync and async method calls to ObjC NativeModules. This native CallInvoker will hold a reference to the ObjC NativeModule's method queue. **Why is the native CallInvoker required for ObjC NativeModules?** In the case where the ObjC NativeModule neither provides nor requests a method queue, we must create a method queue for it. When we go to invoke a method from JS, for these NativeModules specifically, there is no way to access this method queue. A native CallInvoker is a convenient abstraction that holds on to that method queue. For async calls, we'll just call `CallInvoker::invokeAsync`, and for sync calls, we'll just call `CallInvoker::invokeSync`. **Why do we need sync call support for native `CallInvoker`?** In ObjC, sync NativeModule method calls block the JS thread, then execute synchronously on the NativeModule's method queue, and then unblock the JS thread. This is what'll be implemented by `CallInvoker::invokeSync`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20829955 fbshipit-source-id: efb9d5408a1ade81069a943c865f232d4d10acfe * Export Instance::getDecoratedNativeCallInvoker from RCTCxxBridge Summary: `RCTTurboModuleManager` will create a native `CallInvoker` for each ObjC NativeModule. This `CallInvoker` will be used to dispatch calls from JS to native. Before passing the native `CallInvoker` to the `ObjCTurboModule`, it'll first use `RCTCxxBridge decorateNativeCallInvoker` to get a bridge-aware decorated native `CallInvoker`. That way, the bridge remains informed about async TurboModule method calls that took place since the last time it was flushed. This ensures that we don't end up dispatching `onBatchComplete` any less with TurboModules on than we do with TurboModules off. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20831546 fbshipit-source-id: b2eb4e0097e0dabf8c4bd8fdc4c850a0858af699 * Add Author Feedback label automatically (#28484) Summary: Improve issue triage by automatically adding the "Needs: Author Feedback" label. NOTE: The old label-actions app should be disabled when this PR is merged: https://github.com/apps/label-actions/installations/7445225 ## Changelog [Internal] - Issue Triage Pull Request resolved: https://github.com/facebook/react-native/pull/28484 Test Plan: Verified the same `label-actions.yml` and workflow config on a private repo. Reviewed By: cpojer Differential Revision: D20817443 Pulled By: hramos fbshipit-source-id: 39732dd67509c9fb9cf6ff7306913f5ec088266d * docs: add README and specify file in package.json (#28507) Summary: Adding a README for `react-native-codegen` since the package was published. Also added a `files` prop in package.json so unused file won't be included in the package. ## Changelog [Internal] [Changed] - Add README for react-native-codegen. Pull Request resolved: https://github.com/facebook/react-native/pull/28507 Test Plan: verify js files to function correctly without including files other than `src` Reviewed By: rickhanlonii Differential Revision: D20836113 Pulled By: cpojer fbshipit-source-id: e860f14760e9c1dbe121f5fb95ccf72d4ddb2af1 * Make the link easier to copy. (#28516) Summary: Making a PR from GitHub, I need to copy-paste the link, and it would be easier to just triple-click a line with the URL rather than carefully selecting the URL from the text. <img width="723" alt="Screen Shot 2020-04-03 at 17 33 47" src="https://user-images.githubusercontent.com/100233/78378550-6c12af80-75d1-11ea-93a4-2eae568ce602.png"> ## Changelog [General] [Changed] - Make PR template easier to use with changelog URL. Pull Request resolved: https://github.com/facebook/react-native/pull/28516 Reviewed By: fkgozali Differential Revision: D20842238 Pulled By: hramos fbshipit-source-id: 3fef7a994f36a996bbbc52556600d468a56210a9 * Upgrade tests to Xcode 11.3.1 (#28498) Summary: Upgrade Sandcastle and Circle CI tests to use Xcode 11.3.1 across the board. Pull Request resolved: https://github.com/facebook/react-native/pull/28498 Pull Request resolved: https://github.com/facebook/react-native/pull/28501 Changelog: [Internal] - Use Xcode 11.3.1 in iOS tests Reviewed By: fkgozali Differential Revision: D20821844 fbshipit-source-id: b250ca82bdf2c9fb7faa765d3e2433eb46efd692 * Fixes iOS reload through metro "r" command key (#28477) Summary: This allows the iOS device to be reloaded through the metro command line, besides the fact that whenever packagerServerHost is called, it will only get the IP address once when debugging. ## Changelog [iOS] [Fixed] - Fixed connection of metro reload command to iOS device Pull Request resolved: https://github.com/facebook/react-native/pull/28477 Test Plan: - Build any react-native project in debug mode to an iOS device connected through USB - Press the “r” key on the terminal that is running metro - The device should now reload the project Reviewed By: cpojer Differential Revision: D20818462 Pulled By: TheSavior fbshipit-source-id: 6d9792447d205223dad8fbd955518885427cbba8 * Create method queues for NativeModules that neither provide nor request one Summary: ## Problem: Let `A` be the set of all ObjC NativeModules that neither provide nor reqeust a method queue. The TurboModule system dispatches all method calls to NativeModules in `A` synchronously to the JS thread. Here is the relevant logic: **RCTTurboModule.mm:** Link: https://fburl.com/diffusion/nz9gqje8 ``` jsi::Value performMethodInvocation( // ... ) { // ... dispatch_queue_t methodQueue = NULL; if ([instance_ conformsToProtocol:protocol(RCTBridgeModule)] && [instance_ respondsToSelector:selector(methodQueue)]) { methodQueue = [instance_ performSelector:selector(methodQueue)]; } if (methodQueue == NULL || methodQueue == RCTJSThread) { // This is the default mode of execution: on JS thread. block(); } else if (methodQueue == dispatch_get_main_queue()) { ``` **Why does this end up happening?** 1. NativeModules that request a method queue have `synthesize methodQueue = _methodQueue` in their `implementation` section. This generates a `methodQueue` getter for the NativeModule, and also creates an ivar to back that getter. The TurboModule system generates a `dispatch_queue_t` and uses ObjC's KVC API to write to the ivar. So in the above logic, for NativeModules that provide a method queue, methodQueue will neither be `NULL` nor `RCTJSThread`, so we don't dispatch synchronously to the JS thread. 2. NativeModules that provide a method queue will return something that is not `NULL` or something that is `RCTJSThread`. If they return `NULL`, the infra will throw an error early. If they return `RCTJSThread`, we'll dispatch synchronously to the JS thread, as we should (...wait. For async NativeModule methods that dispatch to `RCTJSThread`, should we dispatch asynchronously to the JS thread, via jsInvoker? **Edit:** Nope: https://fburl.com/diffusion/ivt9b40s.). In all other cases, we dispatch to appropriately to the respective method queue. 3. For NativeModules that neither provide nor request a method queue (i.e: NativeModules in `A`), they don't implement the `methodQueue` selector. Therefore, we dispatch synchronously to the JS thread. ## The fix (Part 1): The first step towards fixing this problem is to generate `dispatch_queue_t`s for NativeModules in `A`. That's what this diff accomplishes. Changelog: [iOS][Fixed] - Create method queue for NativeModules that don't provide nor request one. Reviewed By: fkgozali Differential Revision: D20821054 fbshipit-source-id: 17a73550ad96766c5c7e719e28e1cc879e36465c * Rename duplicate name `<ScrollView>` example on RNTester (#28515) Summary: Tiny change. When searching for `scro` in the RNTester, two `<ScrollView>`s come up, from different example files. One is the "simple" one and the other is the "regular" one. Before: <img width="370" alt="Screen Shot 2020-04-03 at 17 14 01" src="https://user-images.githubusercontent.com/100233/78377338-c6ab0c00-75cf-11ea-9c45-2dcdd6460f6d.png"> After: <img width="369" alt="Screen Shot 2020-04-03 at 17 13 38" src="https://user-images.githubusercontent.com/100233/78377371-cf034700-75cf-11ea-89ea-aa3ff2f3988c.png"> ## Changelog [Internal] [Changed] - Rename the "simple" ScrollView example in RNTester to "ScrollSimpleView". Pull Request resolved: https://github.com/facebook/react-native/pull/28515 Test Plan: - Try to search for `scro` in RNTester. Reviewed By: fkgozali Differential Revision: D20842264 Pulled By: hramos fbshipit-source-id: 3db54a826ae774108e62690e7f154e85b541520f * Fix Fabric SSTs, so they actually run in Fabric instead of Paper, convert ServerSnapshotTestsAppImpl to functional component Summary: Update instrumentation test infra for Fabric tests. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D19961919 fbshipit-source-id: 17264b6308712dddece730effd57832817e148cf * Fixed scrollview inset when RN view is embedded in another view (#27607) Summary: I'm using RNN, which embeds RN view inside native view controllers. On iOS 13, a modal view controller is "floating" and is offset from the top of the screen. This causes the calculation of inset in `KeyboardAvoidingView` incorrect as it mixes local view controller coordinate space, with keyboard's screen coordinate space. ## Changelog [iOS] [Fixed] - Fixed `KeyboardAvoidingView` inset in embedded views (i.e modal view controllers on iOS 13) Pull Request resolved: https://github.com/facebook/react-native/pull/27607 Test Plan: 1. Tested before and after in a simple view controller (should stay the same) 2. Tested before and after in a modal view controller (should be offset before, and fixed after) 3. Repeated no. 2 with each device rotation (upsideDown, landscapeLeft, landscapeRight) Reviewed By: cpojer Differential Revision: D20812231 Pulled By: TheSavior fbshipit-source-id: fbd72739fb7152655028730e284ad26ff4a5da73 * Bump react-native-codegen to 0.0.2 Summary: Changelog: [Internal] Reviewed By: cpojer Differential Revision: D20843514 fbshipit-source-id: c611bf91d311c6ce8a7e469d267a0417b2ee58e5 * Rename ScrollViewSimpleExample Summary: Changelog: [Internal] - Rename ScrollViewSimpleExample in RNTester Reviewed By: fkgozali Differential Revision: D20846977 fbshipit-source-id: 397589cb0a17beaf37a25b91ad8efa4a2bc62358 * Remove console warnings for innerViewNode/Ref Summary: Remove these warnings until the methods in ScrollResponder have been moved into ScrollView, so that unactionable warnings aren't firing. Changelog: [General][Removed] Remove console warnings for innerViewNode/Ref in ScrollView Reviewed By: TheSavior Differential Revision: D20850624 fbshipit-source-id: ce90988e204c3cc3b93536842ec3caa12cf6994e * Make TurboModules dispatch method calls via native CallInvoker Summary: This diff: 1. Has ObjC NativeModules use the native `CallInvoker` to invoke JS -> native sync/async calls. 2. Integrates the native `CallInvoker` for each ObjC NativeModule with the bridge. This way, the bridge is informed of all JS -> native TurboModule method calls, and dispatches `onBatchComplete` appropriately. Changelog: [iOS][Fixed] Integrate ObjC TurboModules async method calls with the bridge Reviewed By: fkgozali Differential Revision: D20831545 fbshipit-source-id: da1cbb4ecef4cae85841ca7ef625ab8e380760cd * add ripple config object to Pressable (#28156) Summary: Motivation is to support ripple radius just like in TouchableNativeFeedback, plus borderless attribute. See https://github.com/facebook/react-native/pull/28009#issuecomment-589489520 In the current form this means user needs to pass an `android_ripple` prop which is an object of this shape: ``` export type RippleConfig = {| color?: ?ColorValue, borderless?: ?boolean, radius?: ?number, |}; ``` Do we want to add methods that would create such config objects - https://facebook.github.io/react-native/docs/touchablenativefeedback#methods ? ## Changelog [Android] [Added] - support borderless and custom ripple radius on Pressable Pull Request resolved: https://github.com/facebook/react-native/pull/28156 Test Plan: Tested locally in RNTester. I noticed that when some content is rendered after the touchables, the ripple effect is "cut off" by the boundaries of the next view. This is not specific to Pressable, it happens to TouchableNativeFeedback too but I just didn't notice it before in https://github.com/facebook/react-native/pull/28009. As it is an issue of its own, I didn't investigate that. ![pressable](https://user-images.githubusercontent.com/1566403/75098762-785f2200-55ba-11ea-8842-e648317610e3.gif) I changed the Touchable example slightly too (I just moved the "custom ripple radius" up to show the "cutting off" issue), so just for completeness: ![touchable](https://user-images.githubusercontent.com/1566403/75098763-81e88a00-55ba-11ea-9528-e0343d1e054b.gif) Reviewed By: yungsters Differential Revision: D20071021 Pulled By: TheSavior fbshipit-source-id: cb553030934205a52dd50a2a8c8a20da6100e23f * Make TurboModule creation thread-safe Summary: NativeModules can be created from any number of threads. In the legacy system, `ModuleHolder`, the class responsible for creating NativeModules, has built-in concurrency control to ensure that NativeModule creation is thread-safe. This diff introduces that thread-safety to the TurboModule infra. Basically, after this diff, if `n` threads race to create a TurboModule x, only the first thread will create x. All other threads will wait until x is created. Changelog: [Android][Fixed] - Make TurboModule creation thread-safe Reviewed By: mdvacca Differential Revision: D20659799 fbshipit-source-id: 2b720fe1ea49e40ae0d6dae50d422f23a6f45520 * Remove unused fields from error dialog Summary: Removed in https://github.com/facebook/react/pull/18487 Changelog: [React Core] Logging changes Reviewed By: gaearon Differential Revision: D20853086 fbshipit-source-id: 4b0002f21269f415769a2ac8305ba5750245f7d1 * Fix crash when enabling Performance Monitor on iOS 13.4 (#28512) Summary: This PR fixes a crash when opening the Performance Monitor on iOS 13.4. Detailed info: https://github.com/facebook/react-native/issues/28414 ## Changelog `[iOS] [Fixed] - Fix crash when enabling Performance Monitor on iOS 13.4` ## How This PR prevents the JavaScriptCore option from being set altogether. This ensures that the performance monitor keeps working, but on iOS 13.4 and higher, it will no longer crash trying to show the GC usage. Pull Request resolved: https://github.com/facebook/react-native/pull/28512 Test Plan: Tested on iOS 13.4 (simulator): ![image](https://user-images.githubusercontent.com/6184593/77903803-c6370c00-7283-11ea-8b71-b6b6546c82f6.png) Tested on iOS 13.1 (simulator) ![image](https://user-images.githubusercontent.com/6184593/77903499-41e48900-7283-11ea-9d14-83f67a3b7b77.png) - Verified that the `setOption` was called, but the Performance Monitor didn't show any GC usage regardless. - Identical PR https://github.com/expo/react-native/pull/21 has been shipped and tested in Expo Client 37 Fixes https://github.com/facebook/react-native/issues/28414 Reviewed By: PeteTheHeat Differential Revision: D20851131 Pulled By: TheSavior fbshipit-source-id: ff96301036e8487db59f95947bbe6841fe230e1e * Modify warning message (#28514) Summary: Modify deprecation warning message for `AccessibilityInfo.fetch` - https://reactnative.dev/docs/accessibilityinfo#isscreenreaderenabled - https://github.com/facebook/react-native/commit/523ab8333800afbfb169c6fd70ab6611fe07cc2a ## Changelog [Internal] [Changed] - Modify deprecation warning message for `AccessibilityInfo.fetch` Pull Request resolved: https://github.com/facebook/react-native/pull/28514 Test Plan: Try using `AccessibilityInfo.fetch` and check log Reviewed By: cpojer Differential Revision: D20850223 Pulled By: TheSavior fbshipit-source-id: e21bb20b7a02d9f2ed6e27e2bfecbac0aebf9e09 * Set _borderLayer.frame when border changes Summary: Changelog: [Internal] Setting `_borderLayer.frame` inside `-[RCTViewComponentView layoutSubviews]` causes unwanted animation because it is not wrapped in `CATransaction`. Moving it to `-[RCTViewComponentView updateLayoutMetrics]` which is called inside `CATransaction`. Reviewed By: shergin Differential Revision: D20836890 fbshipit-source-id: 2048a25fd2edb8109f6275c1186c0adae4b9f504 * Add API for getting sourceURL directly from ReactContext Summary: In bridgeless mode, the CatalystInstance doesn't exist, but we still need to be able to access the sourceURL in SourceCodeModule (which is needed to render the images in LogBox warnings and errors). This diff adds a new API for getting the sourceURL directly from ReactContext, instead of having to call context.getCatalystInstance().getSourceURL(), and updates SourceCodeModule to use it. Changelog: [Internal] Reviewed By: RSNara Differential Revision: D20848700 fbshipit-source-id: 3ecda81a17121178b76bbb3e9b0f27f103c1961a * imp: Remove unused `npx` reference (#28544) Summary: Recently we removed `npx` usage from `react-native-cli` flow. After checking usages in this repo I found unused reference. ## 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] [Removed] - Remove unused `npx` reference Pull Request resolved: https://github.com/facebook/react-native/pull/28544 Test Plan: Tests pass Reviewed By: cpojer Differential Revision: D20873090 Pulled By: hramos fbshipit-source-id: 12e05e9635a83f19439024766817e4599320af98 * Add debug logs to track down T62192299 exception source Summary: Add debug logs to track down T62192299 exception source Changelog: [Internal] Reviewed By: RSNara Differential Revision: D20878063 fbshipit-source-id: 94acd56c45d4b529a695d1b4d2bfd10d8f725e63 * Back out "Fixed scrollview inset when RN view is embedded in another view" Summary: Original commit changeset: fbd72739fb71 Changelog: Back out "[react-native][PR] Fixed scrollview inset when RN view is embedded in another view" Reviewed By: TheSavior Differential Revision: D20878607 fbshipit-source-id: 0d77b9fb08c637f7894c399a219a242e472b0700 * Fail silently in AppStateModule.sendEvent if CatalystInstance is not available Summary: According to our logs, 80% of these warnings are coming from AppStateModule. It's not particularly interesting or surprising that the CatalystInstance would be torn down when there's some app event, so let's stop taking up DB space with a useless message. Reviewed By: ejanzer, mdvacca Differential Revision: D20879426 fbshipit-source-id: b1182461aed4a66d82cb34bbd4b12782af6ed7b3 * Move DebugEnvironment helper to open source Summary: This is an internal only module that we use to detect whether we are in async debugging mode. Changelog: [Internal] Reviewed By: yungsters Differential Revision: D20879780 fbshipit-source-id: 5915f4e1c54a3fda0cf607c77f463120264fdbc4 * Fix Appearance module when using Chrome Debugger Summary: The appearance module uses sync native module methods which doesn't work with the chrome debugger. This broke in 0.62: https://github.com/facebook/react-native/issues/26705 This fix makes the appearance module return 'light' when using the chrome debugger. Changelog: [Fixed] Appearance `getColorScheme` no longer breaks the debugger Reviewed By: yungsters Differential Revision: D20879779 fbshipit-source-id: ad49c66226096433bc9f270e004ad4a6f54fa8c2 * Extend Android ImageViewManager to support analyticsTag prop Summary: This diff extends the Android Image View manager to support the new analyticsTag prop. this prop is going to be used to track performance for images in android changelog: [Android][Added] Add analyticsTag prop into ImageView component Reviewed By: JoshuaGross Differential Revision: D20880602 fbshipit-source-id: e302e8fa83706e6517b228d44a3094a1686830f7 * Extend Image.android to support analyticsTag prop Summary: Quick diff to extend Image.android component to support analytics tag prop changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D20880601 fbshipit-source-id: 99bc11f36ce46953c00480f7c8d628cf6c0a9263 * Create ImageContext object to allow udpating the analyticsTag prop for RN sections Summary: As part of this diff I create the new ImageContext object that will be used to allow the update of the analyticsTag prop for components that contain multiple images in their view hierarchy changelog: [JS][Added] Add ImageContext object, this object can be used to update the Imageview's analyticsTag prop on RN components that contain multiple images in their view hierarchy Reviewed By: JoshuaGross Differential Revision: D20880603 fbshipit-source-id: f2094bfd3ab1c867cf7c107e678a098aab7e94a8 * Ez cleanup in ImageProps Summary: Ez cleanup in ImageProps, this import is not being used anymore changelog: [internal] internal change Reviewed By: JoshuaGross Differential Revision: D20880600 fbshipit-source-id: 7d903b5a6e16c37e61dec661b6bd1f9a6b442cc3 * Exclude all FlipperKit transitive dependencies from iOS Release builds (#28504) Summary: The `:configuration` option from `pod` only affects the specified pod and not its dependencies [1]. Therefore in order to avoid all transitive dependencies being linked in the resulting Release IPA we need to list them in the `Podfile`. Note that this will still build Flipper's pods when doing a Release, but it won't link it in the resulting IPA. [1] https://guides.cocoapods.org/syntax/podfile.html#pod Fixes https://github.com/react-native-community/upgrade-support/issues/28 Related https://github.com/CocoaPods/CocoaPods/issues/9658 ## Changelog * [iOS] [Fixed] - Exclude Flipper from iOS Release builds Pull Request resolved: https://github.com/facebook/react-native/pull/28504 Test Plan: Create a new React Native 0.62 project, run `pod install`, then diff: ``` ProjectName/ios/Pods/Target Support Files/Pods-ProjectName/Pods-ProjectName.debug.xcconfig` ``` and ``` ProjectName/ios/Pods/Target Support Files/Pods-ProjectName/Pods-ProjectName.relaese.xcconfig ``` ![image](https://user-images.githubusercontent.com/855995/78337679-a3fa0280-7591-11ea-8142-6f82cbc6be58.png) Reviewed By: passy Differential Revision: D20894406 Pulled By: priteshrnandgaonkar fbshipit-source-id: 680780f0f5a85fd8423b85a271a499bd12f06d00 * Fix crash in FabricUIManager.onMeasure Summary: Changelog: [Internal] The cause of crash was `NullPointerException`, which happened because of `mReactContextForRootTag.get(rootTag)` returning `null`. This is solved by checking whether it returns `null` before passing it to `I18nUtil`. Reviewed By: mdvacca Differential Revision: D20890623 fbshipit-source-id: c884c6838b83b944a5438375a4c060c1f5b1dc6e * Fix flow types of ImageContext Summary: ez diff to Fix flow types of ImageContext changelog: [internal] internal change to update flow types of ImageContext Reviewed By: TheSavior Differential Revision: D20883647 fbshipit-source-id: 6dba83ab431e56a71f96c39005ebcccf39a7da9a * Avoid passing analyticsTag prop to native if this is set to null Summary: This diff avoids passing the analyticsTag prop to native if this is set to null changelog: [internal] internal optimization Reviewed By: TheSavior Differential Revision: D20904498 fbshipit-source-id: f1ea1e5aa3199ef073668df86ca7cf6e20f70c5b * Rename analyticsTag -> internal_analyticsTag in ImageView component Summary: This diff renames the analyticsTag prop for the intenral_analyticsTag in ImageView component changelog: [internal] Creation of internal_analyticTag prop in ImageView, for now this prop is meant to be used internally. Reviewed By: TheSavior Differential Revision: D20904497 fbshipit-source-id: 2a28f746772ee0f9d657ec71549020c1f3e9d674 * Make Vibration.vibrate compatible with TurboModules (#27951) Summary: This PR fixes a compatibility issue with the Vibration module and TurboModules. The TurboModules spec doesn't allow nullable arguments of type Number, causing the following problem: ![IMG_3758](https://user-images.githubusercontent.com/1247834/73803879-10be6f80-4790-11ea-92d4-a008f0007681.PNG) ## Changelog [iOS] [Fixed] - Make Vibration library compatible with TurboModules. Pull Request resolved: https://github.com/facebook/react-native/pull/27951 Test Plan: Just submitted a PR to my own app to fix the issue [here](https://github.com/rainbow-me/rainbow/pull/340) The problem should be reproducible on RNTester due to this line: https://github.com/facebook/react-native/blob/91f139b94118fe8db29728ea8ad855fc4a13f743/RNTester/js/examples/Vibration/VibrationExample.js#L66 and should be working on this branch. Reviewed By: TheSavior Differential Revision: D19761064 Pulled By: hramos fbshipit-source-id: 84f6b62a2734cc09d450e906b5866d4e9ce61124 * Fix Cocoapods builds Summary: ## Problem For some reason, D20831545 broke the `use_frameworks!` build of RNTester. ## Building RNTester ``` pushd ~/fbsource/xplat/js/react-native-github/RNTester && USE_FRAMEWORKS=1 pod install && open RNTesterPods.xcworkspace && popd; ``` ## Error I built RNTester locally, and the error was this: ``` Undefined symbols for architecture x86_64: "facebook::jsi::HostObject::set(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&, facebook::jsi::Value const&)", referenced from: vtable for facebook::react::ObjCTurboModule in RCTImageEditingManager.o vtable for facebook::react::ObjCTurboModule in RCTImageLoader.o vtable for facebook::react::ObjCTurboModule in RCTImageStoreManager.o "facebook::jsi::HostObject::getPropertyNames(facebook::jsi::Runtime&)", referenced from: vtable for facebook::react::ObjCTurboModule in RCTImageEditingManager.o vtable for facebook::react::ObjCTurboModule in RCTImageLoader.o vtable for facebook::react::ObjCTurboModule in RCTImageStoreManager.o ld: symbol(s) not found for architecture x86_64 ``` ## Fix It looked like libraries that depend on "ReactCommon/turbomodule/core" weren't linking to JSI correctly. So, I modified all such Podspecs to also depend on "React-jsi": ``` arc rfr ' s.dependency "ReactCommon/turbomodule/core", version' ' s.dependency "ReactCommon/turbomodule/core", version\n s.dependency "React-jsi", version' ``` This seemed to do the trick. In buck, we'd fix this problem using exported_dependencies. I skimmed through cocoapods, and couldn't find such a configuration option there. So, I guess this will have to do? Changelog: [iOS][Fixed] - Fix Cocoapods builds of RNTester Reviewed By: fkgozali, hramos Differential Revision: D20905465 fbshipit-source-id: 60218c8274ec165752a428f2a7a9a546607c8fec * Add minimumSize to RCTRootView & RCTRootShadowView Summary: This adds a `minimumSize` property to RCTRootView, and forwards any changes to it's shadow view. This **does not** change any default behaviour, as the default minimum size is `CGSizeZero` before & after this diff. Changelog: [iOS][Internal] Add minimumSize to RCTRootView & RCTRootShadowView Reviewed By: RSNara Differential Revision: D20905456 fbshipit-source-id: a03f880e782891f60ef86b9c898965e05a5e796e * Make RCTNativeAnimatedModule into a TurboModule Summary: D20831545 integrated TurboModules with the bridge's `onBatchComplete` event. This fixed the RCTNativeAnimatedModule jank, so I'm re-converting RCTNativeAnimatedModule into a TurboModule. Changelog: [iOS][Fixed] - Make RCTNativeAnimatedModule TM-compatible Reviewed By: PeteTheHeat Differential Revision: D20850744 fbshipit-source-id: bb85a1bb27963e7d39bf149d0a3d7b71c88175da * upgrade to flow 0.122.0 Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D20919782 fbshipit-source-id: 3d5dc54ea4daafb8a1d96cad6c35a2dab4c24097 * Switch order of onSelectionChange and onChange events send from native Summary: Changelog: [Internal] UIKit uses either `UITextField` or `UITextView` as its UIKit element for `<TextInput>`. `UITextField` is for single line entry, `UITextView` is for multiline entry. There is a problem with order of events when user types a character. In `UITextField` (single line text entry), typing a character first triggers `onChange` event and then `onSelectionChange`. JavaScript depends on this order of events because it uses `mostRecentEventCount` from this even to communicate to native that it is in sync with changes in native. In `UITextView` (multi line text entry), typing a character first triggers `onSelectionChange` and then `onChange`. As JS depends on the correct order of events, this can cause issues. An example would be a TextInput which changes contents based as a result of `onSelectionChange`. Those changes would be ignored as native will throw them away because JavaScript doesn't have the newest version. Reviewed By: JoshuaGross Differential Revision: D20836195 fbshipit-source-id: fbae3b6c0d388fc059ca2541ae980073b8e5f6c7 * Maintain selection and cursor location when setting string on TextInput Summary: Changelog: [Internal] Calling `_backedTextInputView.attributedText = attributedString` causes cursor to be moved to the end of text input. This applies to both, `UITextField` and `UITextView`. This is not desired as when JS sets a new text, we don't want the cursor to be moved to the end of text input. JS has the option to use view commands if it wishes to move cursor somewhere. Reviewed By: JoshuaGross Differential Revision: D20836201 fbshipit-source-id: 9234e54cfbc5fc206f723626988e505275788aae * Implement event count for TextInput Summary: Changelog: [Internal] Implementation of event count for Fabric's Text input. Reviewed By: JoshuaGross Differential Revision: D20800185 fbshipit-source-id: 988692cb2fc786649821cccb06e629b40b9b0479 * Migrate setNativeProps to commands in iOS text input Summary: Changelog: Move from setNativeProps to ViewCommands. Reviewed By: JoshuaGross Differential Revision: D20843018 fbshipit-source-id: 9be9d2bbee01f2e15279e3c3ae785c1a5b163765 * Update default Podfile to not depend on a path (#28572) Summary: Recently, a default Podfile has been modified to not contain all the React Native pods, but use a helper method `use_react_native!`. While this is great, it assumes a hardcoded path of `../node_modules/react-native` to be always the correct location of the React Native. https://github.com/facebook/react-native/blob/d4d8887b5018782eeb3f26efa85125e6bbff73e4/scripts/autolink-ios.rb#L7-L9 Unfortunately, due to the way Ruby works, this completely hides the path away from the users. Before, they could have seen the wrong path explicitly in a Podfile and knew to update it to resolve path-related issues. With the current version in `master`, I can see a lot of issues where developers wonder how to resolve the path issues and how to pass the path itself. https://github.com/facebook/react-native/blob/4118d798265341061105f3a53550db83c66a71cb/template/ios/Podfile#L5-L10 This PR uses React Native CLI configuration (that is already used to link 3rd party dependencies) to explicitly define the correct path to the React Native. As a result, we don't have to change the paths here whether we're running monorepo or not. ## Changelog [IOS] [INTERNAL] - Always provide an explicit path to React Native Pull Request resolved: https://github.com/facebook/react-native/pull/28572 Differential Revision: D20945194 Pulled By: TheSavior fbshipit-source-id: 010f9754f2ed78ef62fd52f4d201f296f5af6d27 * chore: update CLI * fix: do not throw on missing `cliPath`, use the default value (#28625) Summary: The `cliPath` has always been optional value and in fact, even had its default value hardcoded in the React gradle file. In this PR, I am just taking use of it and remove throwing an error, which is going to be a really annoying breaking change. ## Changelog [ANDROID] [INTERNAL] - Don't require `cliPath` Pull Request resolved: https://github.com/facebook/react-native/pull/28625 Test Plan: Run Android project, everything works. Provide custom `cliPath`, it gets respected Reviewed By: cpojer Differential Revision: D21044222 Pulled By: TheSavior fbshipit-source-id: 8029f988d92abb9f64f30e05932c0d407d0c997e * chore: remove Kotlin version from the default template * (eslint-config) update community eslint plugin in eslint config (#28642) Summary: Updating the community eslint-plugin used in the eslint-config to the latest version. expecting new eslint-config version to be released with this change so that it can be included in new project template for 0.63 https://github.com/react-native-community/releases/issues/186 ## 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] - Update community eslint plugin in the eslint config Pull Request resolved: https://github.com/facebook/react-native/pull/28642 Test Plan: yarn lint passes Differential Revision: D21048976 Pulled By: cpojer fbshipit-source-id: 2c3ec0ef450cf357d8c88db7873f4ca1154b2034 * [0.63.0-rc.0] Bump version numbers * Upgrade Hermes dependency to 0.5.0 Summary: Use the latest published release of hermes-engine. Update RN to invoke `hermesc` instead of `hermes`. Changelog: [Android] [Changed] - Upgraded to Hermes 0.5.0 allow-large-files Reviewed By: mhorowitz Differential Revision: D20998564 fbshipit-source-id: 4824e273bcb044029a5a7e9379f168d3da47da50 * Remove the post install step (#28651) Summary: Removes the post install step for Flipper, as the latest version of YogaKit is compatible with swift 5. cc alloy ## 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 --> [Flipper] [Template] - Remove the post install step for Flipper Pull Request resolved: https://github.com/facebook/react-native/pull/28651 Test Plan: Tested a newly created RN app without post install step and it built successfully. Reviewed By: passy Differential Revision: D21064653 Pulled By: priteshrnandgaonkar fbshipit-source-id: da56d0754d918e30a0ebe480c77590f0139d48ac * Allow iOS PlatformColor strings to be ObjC or Swift UIColor selectors (#28703) Summary: Per discussion in https://github.com/react-native-community/releases/issues/186 the iOS `PlatformColor()` function is documented to use the semantic color names provided by the system. The referenced HIG documentation itself links to the `UIColor` documentation for semantic colors names. However, these names differ depending on if you are viewing the new Swift API docs or the Objective C docs. The current Objective C implementation in react-native assumes Objective C UIColor selector names that are suffixed 'Color'. But in Swift, Apple provides a Swift Extension on UIColor that makes aliases without the the 'Color' suffix and then makes the original selectors invalid presumably via `NS_UNAVAILABLE_SWIFT`. Since both selector names are valid depending on if you are using Objective C or Swift, let's make both forms be legal for `PlatformColor()`. In `RCTConvert.m` there is a dictionary of legal selector names. The code already supports the ability to have names be aliases of other selectors via a RCTSelector metadata key. The change adds code to the initialization of the map: it iterates over the keys in the map, which are all ObjC style UIColor selectors, and creates aliases by duplicating the entries, creating key names by stripping off the ObjC "Color" suffix, adds the RCTSelector key referring to the original and then appends these new Swift aliases to the map. ## Changelog [iOS] [Changed] - Allow iOS PlatformColor strings to be ObjC or Swift UIColor selectors Pull Request resolved: https://github.com/facebook/react-native/pull/28703 Test Plan: The PlatformColorExample.js is updated to use the new, shorter Swift selector names. There are still other examples in the same file and in unit tests that exercise the ObjC selector names. <img width="492" alt="PlatformColor" src="https://user-images.githubusercontent.com/30053638/79809089-89ab7d00-8324-11ea-8a9d-120b92edeedf.png"> Reviewed By: shergin Differential Revision: D21147404 Pulled By: TheSavior fbshipit-source-id: 0273ec855e426b3a7ba97a87645859e05bcd4126 * Fix folly::dynamic crash when attaching a debugger to Hermes Summary: folly_futures was compiled with and exported -DFOLLY_MOBILE=1, while folly_json did not. This flag disables fancy F14 data structures for folly::dynamic in favor of a simple std::unordered_map. This caused inlined/templated code from modules depending on folly_futures to disagree with the implementations in folly_json, leading to a crash. The only such libraries were libhermes-inspector and (transitively) libhermes-executor-debug, and these only use folly::dynamic for CDP serialization, which is why the problem was not more apparent. Changelog: [Internal] Fix crash when attaching a Hermes debugger Reviewed By: mhorowitz Differential Revision: D21193307 fbshipit-source-id: 2b795bb6f4f7f991e2adaacec62d62616117322b * Update react.gradle (#28776) Summary: Running `./gradlew assembleRelease` fails as the path to the CLI contains a new line at the end. We don't run this command in `debug` mode, hence it passed the testing. My bad. Fixed, checked in both `debug` with `bundleInDebug: true` and `release`. Fixes https://github.com/facebook/react-native/issues/28700 ## Changelog [INTERNAL] [ANDROID] - Fix `React.gradle` to build Android apps in production Pull Request resolved: https://github.com/facebook/react-native/pull/28776 Test Plan: Running `./gradlew assembleRelease` works Reviewed By: hramos Differential Revision: D21287789 Pulled By: TheSavior fbshipit-source-id: dc3ec8eef7a919b072b562d2bd455e2f704bc083 * Revert D21064653: Remove the post install step Differential Revision: D21064653 Original commit changeset: da56d0754d91 fbshipit-source-id: 1086cfdeca9aa3830370ea115ba7b5f05d3fb124 * Bump @react-native-community/eslint-config in new app template Summary: Changelog: [Changed][General] Update react-native-community/eslint-config to 1.1.0, adding the new color rule Reviewed By: rickhanlonii Differential Revision: D21342153 fbshipit-source-id: ac1367353d4d3e69b6df29dc16f9fcb60cde3519 * [0.63.0-rc.1] Bump version numbers * Upgrade Flipper to 0.37.0 (#28545) Summary: Bump flipper to 0.37 for both iOS and Android [Android] [Changed] - Upgrade Flipper to 0.37.0 [iOS] [Changed] - Upgrade Flipper to 0.37.0 Pull Request resolved: https://github.com/facebook/react-native/pull/28545 Test Plan: RNTester build pass Reviewed By: rickhanlonii Differential Revision: D20930069 Pulled By: hramos fbshipit-source-id: a7cb719da3e51e6a42d27d5e64bc664398d0d3c5 * Enable with CocoaPods `:configuration` (#28796) Summary: ~~⚠️ Depends on https://github.com/facebook/flipper/pull/1086 and a new Flipper release.~~ Fixes https://github.com/facebook/react-native/commit/17f025bc26da13da795845a3f7daee65563420c0#commitcomment-38831234 Currently user’s are being told to add a definition of the `FB_SONARKIT_ENABLED` macro and examples, including those in stock React Native templates, set this for the user by making use of a `post_install` hook in the user’s `Podfile`. This leads to confusion, fragile code [when a user’s project dir structure deviates from vanilla], and is ultimately not necessary as CocoaPods already has dedicated mechanisms to: * specify build settings (through the `xcconfig` property); * and selectively include certain pods only in certain build configurations (e.g. debug). ## 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] [Changed] - Entirely control Flipper being enabled through inclusion in Podfile and optionally limiting to certain build configurations using the `:configuration` directive. Pull Request resolved: https://github.com/facebook/react-native/pull/28796 Test Plan: Tested using the changes of https://github.com/facebook/flipper/pull/1086 in a new app that uses RN `master`. Reviewed By: priteshrnandgaonkar Differential Revision: D21449754 Pulled By: passy fbshipit-source-id: 9ff7c7f4ffc32b364b1edd82b94e0b80c3997625 * Pressable: Rename pressRectOffset to pressRetentionOffset to be consistent with other touchables Summary: Text and the other Touchables have this prop called pressRetentionOffset. Pressable should be consistent with that. Changelog: [Breaking][General]: Pressable: Rename pressRectOffset to pressRetentionOffset to be consistent with other touchables Reviewed By: yungsters Differential Revision: D21552255 fbshipit-source-id: 31e64bad9e48ac98e4934dd2f4c0a7f526de5cb6 * iOS: Fix Animated image crash when CADisplayLink target in RCTWeakProxy is nil Summary: When self is nil, this may crash in RCTUIImageViewAnimated.m. ``` _displayLink = [CADisplayLink displayLinkWithTarget:[RCTWeakProxy weakProxyWithTarget:self] selector:selector(displayDidRefresh:)]; ``` Replace `RCTWeakProxy` with a concrete class `RCTDisplayWeakRefreshable` that has the displayDidRefresh method, that calls the displayDidRefresh method in its weak target. https://github.com/facebook/react-native/pull/28070#issuecomment-619295254 Changelog: [iOS] [Fixed] - Fix Animated image crash when CADisplayLink target in RCTWeakProxy is nil Reviewed By: shergin Differential Revision: D21419385 fbshipit-source-id: da7c3c38f81ea54f633da7f59359e07680ea2faf * Pressable: Add Support for Inspector Overlay Summary: Adds support for the debug overlay (enabled via the Inspector) that the legacy touchable components supported. Changelog: [General][Added] - Added Inspector overlay support for Pressable Reviewed By: TheSavior Differential Revision: D21614412 fbshipit-source-id: b884e04f8dba1bfd35e61de25d33d6d47bc34b03 * Changed iOS LaunchScreen from xib to storyboard (#28239) Summary: > Starting April 30, 2020, all apps submitted to the App Store must use an Xcode storyboard to provide the app’s launch screen and all iPhone apps must support all iPhone screens. Updated iOS Launch screen as per [App Store policy change](https://developer.apple.com/news/?id=03042020b). Community discussion: https://github.com/react-native-community/discussions-and-proposals/issues/209 ## Changelog Changed iOS Launch Screen from a `xib` to `storyboard`. The `LaunchScreen.xib` file has been replaced with `LaunchScreen.storyboard`. Xcode automatically picks up the new Launch Screen no additional change is required. [iOS] [Deleted] - Deleted LaunchScreen.xib [iOS] [Added] - Added LaunchScreen.storyboard Pull Request resolved: https://github.com/facebook/react-native/pull/28239 Test Plan: Build the Xcode project under `template/iOS` and verify that the new launch screen is identical to the previous one. Reviewed By: cpojer Differential Revision: D20408892 Pulled By: hramos fbshipit-source-id: 9c38df58d1304088a23f3d73e0fbd87675804f1a * Fix debugging on android for 0.63 (#29204) Summary: Currently on react native 0.63-rc.0 and 0.63-rc.1 enabling debugging throws an exception. It looks like something may have been missed in unregistering JSDevSupport in this commit c20963e ![crash](https://user-images.githubusercontent.com/14797029/85500252-2acae400-b5b1-11ea-938a-674b55e649b2.gif) This should fix https://github.com/facebook/react-native/issues/28746 and https://github.com/facebook/react-native/issues/29136 ## Changelog [Android] [Fixed] - Fix crash when enabling debug Pull Request resolved: https://github.com/facebook/react-native/pull/29204 Test Plan: To recreate the bug: npx react-native init RN063 --version 0.63.0-rc.1 react-native start react-native run-android Enable debug mode from react native dev menu After this commit, the crash no longer occurs ![non crash](https://user-images.githubusercontent.com/14797029/85500241-269ec680-b5b1-11ea-8cfe-85bfda4dd222.gif) Reviewed By: TheSavior Differential Revision: D22395406 Pulled By: RSNara fbshipit-source-id: 046df77ae1c1de96870fb46f409d59e7d6a68c0d * [0.63.0] Bump version numbers * Add ProGuard rule for hermes (#28571) Summary: This adds a ProGuard for `hermes` rule so it does not have to be added by users manually. https://github.com/facebook/react-native/issues/28270 ## 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 --> [Android] [Added] - ProGuard rule for hermes Pull Request resolved: https://github.com/facebook/react-native/pull/28571 Test Plan: 1. Create a project with/without hermes. 2. Enable proguard. Reviewed By: cpojer Differential Revision: D20947095 Pulled By: hramos fbshipit-source-id: 79b166ad2dd060f20041d9f5cfe2f794c754843d * Fix rounded border drawing when border-radius is smaller than border-width (#28358) Summary: This PR fixes the drawing of the border rounded edges when the border-radius is small than the border-width. The current implementation capped the possible border-radius making it impossible to set smaller border-radii when using thicker borders. After inspection it was found that the rounded-rect calculation is incorrect. ## Changelog `[Android] [Fixed] - Fix rounded border-drawing when border-radius is smaller than border-width` Pull Request resolved: https://github.com/facebook/react-native/pull/28358 Test Plan: **Faulty situation:** As you can see, when the border-radius becomes very low, the border is stuck at a minimum value. Only after setting the border-radius fully to 0 is it again rendered correctly. ![ezgif com-video-to-gif (2)](https://user-images.githubusercontent.com/6184593/77183540-c3435b00-6ace-11ea-950d-29a0ea1757bd.gif) **After the fix:** ![ezgif com-video-to-gif (3)](https://user-images.githubusercontent.com/6184593/77183619-e837ce00-6ace-11ea-93a5-910127d352b7.gif) Differential Revision: D21124739 Pulled By: shergin fbshipit-source-id: cefd1776b77b5b9fb335e95fd7fdd7f345579dc4 * Fix border-stroke drawing after resetting border-radius (#28356) Summary: This PR fixes incorrect drawing of the View borders on Android, after changing the border-radius back to 0 *(and when no background-color is defined)*. This happens because the `drawRoundedBackgroundWithBorders` function in ReactViewBackgroundDrawable changes the style on the Paint object to `STROKE`. This style is however never reverted back to `FILL`. This change ensures that the Paint style is set to `FILL` for the full execution of the `drawRectangularBackgroundWithBorders` function. ## Changelog `[Android] [Fixed] - Fix border-drawing when changing border-radius back to 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28356 Test Plan: **Faulty situation:** ![ezgif com-video-to-gif](https://user-images.githubusercontent.com/6184593/77153163-9759b280-6a99-11ea-82bb-33a1e0a4934c.gif) **After the fix:** ![ezgif com-video-to-gif (1)](https://user-images.githubusercontent.com/6184593/77153825-c91f4900-6a9a-11ea-8e0c-a4280b9e72b8.gif) Differential Revision: D21124741 Pulled By: shergin fbshipit-source-id: 2044f8e8ad59a58df42b64d7ee8c4ad1d3b562f1 * Fixes TextInput shaking when typing Chinese (#28805) Summary: Fixes https://github.com/facebook/react-native/issues/28488. ## Changelog [iOS] [Fixed] - Fixes TextInput shaking when typing Chinese Pull Request resolved: https://github.com/facebook/react-native/pull/28805 Test Plan: Demo see https://github.com/facebook/react-native/issues/28488. Differential Revision: D21376803 Pulled By: shergin fbshipit-source-id: b1fe6cc5f67d42ef98a6c12b8ab9990feac0e2a7 * Set black as default text color for <TextInput/> on iOS (#28708) Summary: This is a follow-up pull request to https://github.com/facebook/react-native/issues/28280 (reviewed by shergin). This pull request tried to solve the problem of the default color in a TextInput in dark mode on iOS being white instead of black. I got suggested to solve the problem not on the level of RCTTextAttributes, but on the level of RCTUITextField. Setting `self.textColor = [UIColor black];` in the constructor did not work, because it gets overwritten by nil in `RCTBaseTextInputView.m`. There I implemented the logic that if NSForegroundColorAttributeName color is nil then the color is being set to black. I think the `defaultTextAttributes` property confuses here, because it ends up being the effective text attributes, e.g. if I unconditionally set the default text color to black, it cannot be changed in React Native anymore. So I put the nil check in. ## Changelog [iOS] [Fixed] - TextInput color has the same default (#000) on iOS whether in light or dark mode Pull Request resolved: https://github.com/facebook/react-native/pull/28708 Test Plan: I have manually tested the following: - The default text color in light mode is black - The default text color in dark mode is black - The color can be changed using the `style.color` attribute - Setting the opacity to 0.5 results in the desired behavior, the whole TextInput becoming half the opacity. – Setting the `style.color` to rgba(0, 0, 0, 0.5) works as intended, creating a half-opaque text color. Differential Revision: D21186579 Pulled By: shergin fbshipit-source-id: ea6405ac6a0243c96677335169b214a2bb9ccc29 * Enable array buffers in JSCRuntime.cpp (#28961) Summary: The JavaScriptCore implementation of JSI [does not currently support array buffers](https://github.com/facebook/react-native/blob/master/ReactCommon/jsi/JSCRuntime.cpp#L925-L943). The comments in the code suggest the JSC version used by React Native does not work with array buffers, but this seems to be out of date since the current version of JSC used by React Native does indeed support array buffers. This change just enables array buffers in JSCRuntime.cpp. NOTE: See https://github.com/react-native-community/discussions-and-proposals/issues/91#issuecomment-632371219 for more background on this change. ## Changelog [General] [Added] - Support for array buffers in the JavaScriptCore implementation of JSI Pull Request resolved: https://github.com/facebook/react-native/pull/28961 Test Plan: To test these changes, I just made some temporary changes to RNTester to use JSI to inject a test function into the JS runtime that reads from and writes to an array buffer, and call that function from the JS of the RNTester app (see https://github.com/ryantrem/react-native/commit/28152ce3f4ae0fa906557415d106399b3f072118). For the JS side of this, specifically look at https://github.com/ryantrem/react-native/blob/28152ce3f4ae0fa906557415d106399b3f072118/RNTester/js/RNTesterApp.android.js#L13-L18 For the native side of this, specifically look at https://github.com/ryantrem/react-native/blob/28152ce3f4ae0fa906557415d106399b3f072118/RNTester/android/app/src/main/cpp/JSITest.cpp#L22-L38 Reviewed By: shergin Differential Revision: D21717995 Pulled By: tmikov fbshipit-source-id: 5788479bb33c24d01aa80fa7f509e0ff9dcefea6 * Fix font variant crash on Android < 4.4 (#29176) Summary: In RN 0.62 support for `fontVariant` was added on Android. Using that prop crashes the app on Android below KitKat (4.3 and below) To reproduce just add any Text with the `fontVariant` styling prop in the app: ```js <Text style={{fontVariant: ['tabular-nums']}}>This will crash</Text> ``` It will crash any device running Android below KitKat with the error: ![image](https://user-images.githubusercontent.com/4534323/85073452-18206b80-b1bb-11ea-8d7e-96f27fa1a320.png) This is caused by `java.utils.Objects` only being available on Android 4.4+ ## Changelog [Android] [Fixed] - Fix font variant crash on Android < 4.4 Pull Request resolved: https://github.com/facebook/react-native/pull/29176 Test Plan: [TextUtils.equals](https://developer.android.com/reference/android/text/TextUtils#equals) was added as soon as API level 1, so no compatibility issue here. Tested on Emulator running Android 4.1, no crash anymore. I've searched for other occurences of `java.utils.Objects` in the project, and this was the only one, so no need to remove other occurences ✅ Reviewed By: JoshuaGross Differential Revision: D22337316 Pulled By: mdvacca fbshipit-source-id: 5507b21b237a725d596d47b5c01e269895b16d4a * Fix LogBox.ignoreAllLogs used with no argument (#29310) Summary: When you call `LogBox.ignoreAllLogs()` it should ignore logs. This fixes a bug that made this equivalent to `LogBox.ignoreAllLogs(false)` ## Changelog [General] [Fixed] - LogBox.ignoreAllLogs() should ignore logs Pull Request resolved: https://github.com/facebook/react-native/pull/29310 Test Plan: Added tests Reviewed By: TheSavior Differential Revision: D22448436 Pulled By: rickhanlonii fbshipit-source-id: 6ba12b9d9c1f29cf3ac503946ac5ca0097425a7a * Pressable: Minimum Press Duration Summary: When a `Pressable` has a configured (or the default) `delayPressIn` and no (or the default) `delayPressOut`, tapping very quickly can lead to intantaneous invocation of `onPressIn` and `onPressOut`. The end result is that users may never experience any intended visual press feedback. This changes `Pressable` to accept (and be preconfigured with a default) **minimum press duration**. The minimum press duration ensures that even if the press is released before `delayPressIn` has elapsed, `onPressOut` will still wait the remaining time up to `minPressDuration` before firing. Note that setting a non-zero `delayPressOut` is insufficient because if a user holds down on a `Pressable` for longer than `delayPressIn`, we still want `onPressOut` to fire immediately when the press is released. Changelog: [General][Changed] - Added `minPressDuration` to `Pressable`. Reviewed By: TheSavior Differential Revision: D21614708 fbshipit-source-id: 502f3d8ad6a40e7762435b6df16809c8798dd92c * chore: bring back script to org shape * [0.63.1] Bump version numbers * Exclude okhttp from flipper dependency (#29260) Summary: This fixes https://github.com/facebook/react-native/issues/28481. As explained in [this comment](https://github.com/facebook/react-native/issues/28481#issuecomment-645546195), the flipper network plugin pulls a more recent version of okhttp (3.14), but only versions of okhttp up to 3.12 works on Android API 21 and less. This prevented being able to run the app in debug mode, it was still working fine in release mode. ## 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 --> [Android] [Fixed] - Fix unable to run in debug mode on Android API < 21 Pull Request resolved: https://github.com/facebook/react-native/pull/29260 Test Plan: Using `yarn react-native run-android` the app would instantly crash with this error in `adb logcat`: ``` E/AndroidRuntime( 5079): java.lang.RuntimeException: Unable to create application com.awesometsproject.MainApplication: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created E/AndroidRuntime( 5079): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4154) E/AndroidRuntime( 5079): at android.app.ActivityThread.access$1300(ActivityThread.java:130) E/AndroidRuntime( 5079): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1255) E/AndroidRuntime( 5079): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 5079): at android.os.Looper.loop(Looper.java:137) E/AndroidRuntime( 5079): at android.app.ActivityThread.main(ActivityThread.java:4745) E/AndroidRuntime( 5079): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 5079): at java.lang.reflect.Method.invoke(Method.java:511) E/AndroidRuntime( 5079): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) E/AndroidRuntime( 5079): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) E/AndroidRuntime( 5079): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 5079): Caused by: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:90) E/AndroidRuntime( 5079): at com.facebook.react.ReactInstanceManager.<init>(ReactInstanceManager.java:238) E/AndroidRuntime( 5079): at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:281) E/AndroidRuntime( 5079): at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:87) E/AndroidRuntime( 5079): at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:39) E/AndroidRuntime( 5079): at com.awesometsproject.MainApplication.onCreate(MainApplication.java:47) E/AndroidRuntime( 5079): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:999) E/AndroidRuntime( 5079): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4151) E/AndroidRuntime( 5079): ... 10 more E/AndroidRuntime( 5079): Caused by: java.lang.reflect.InvocationTargetException E/AndroidRuntime( 5079): at java.lang.reflect.Constructor.constructNative(Native Method) E/AndroidRuntime( 5079): at java.lang.reflect.Constructor.newInstance(Constructor.java:417) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:80) E/AndroidRuntime( 5079): ... 17 more E/AndroidRuntime( 5079): Caused by: java.lang.NoClassDefFoundError: java.util.Objects E/AndroidRuntime( 5079): at okhttp3.CertificatePinner.withCertificateChainCleaner(CertificatePinner.java:231) E/AndroidRuntime( 5079): at okhttp3.OkHttpClient.<init>(OkHttpClient.java:238) E/AndroidRuntime( 5079): at okhttp3.OkHttpClient$Builder.build(OkHttpClient.java:1015) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevServerHelper.<init>(DevServerHelper.java:132) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerImpl.<init>(DevSupportManagerImpl.java:183) E/AndroidRuntime( 5079): ... 20 more W/ActivityManager( 1456): Force finishing activity com.awesometsproject/.MainActivity ``` With this fix, the app launch successfully in debug mode, without having to remove flipper altogether from our config. Reviewed By: passy Differential Revision: D22521109 Pulled By: mdvacca fbshipit-source-id: 3c0263642438bd7c0d09b045e15a933bd8a26734 * Send key when onKeyPress event is fired from TextInput Summary: Changelog: [Internal] In `onKeyPress` event, we were not returning `key` property. This diff adds `key` property to `onKeyPress` event and removes other, redundant properties from `onKeyPress` event. The implementation has been translated from Paper. Reviewed By: shergin Differential Revision: D21250411 fbshipit-source-id: f1e31381667acb9dec02d0b33883df8f8f5b2a4b * Calling Paper TextInput setTextAndSelection view command now dirties layout Summary: Changelog: [Internal] Previously `setTextAndSelection` was not dirtying layout. This would cause an issue where `setTextAndSelection` causes layout change. For example calling setTextAndSelection with empty string on a multiline auto expanding text input. I changed one example in TextInputSharedExamples.js, "Live Re-Write (no spaces allowed) and clear" example is now multiline. This allows to test whether `setTextAndSelection` dirties layout. Enter multiline string to to the example text input and press clear. Observe that the text input shrinks to single line height. Reviewed By: shergin Differential Revision: D21182990 fbshipit-source-id: de8501ea0b97012cf4cdf8d5f658649139f92da6 * Remove setMostRecentEventCount from TextInput view commands Summary: Changelog: [Internal] We don't use view command `setMostRecentEventCount`, let's get rid of it. Reviewed By: JoshuaGross Differential Revision: D21016600 fbshipit-source-id: 6491c063e9d6a89252300cb47c010b248e473f4b * Restore Previous Behavior for StyleSheet Validation of Null/Undefined Styles (#29171) Summary: https://github.com/facebook/react-native/issues/27264 changed stylesheet validation to avoid enumerating properties on the prototype of a style. It introduces a secondary behavior change, where null/undefined styles used to be tolerated but now lead to an exception. This is because `for in undefined` will noop where `for of Object.keys(undefined)` will throw. This scenario of undefined/null styles seems to actually show up in practice and was previously well tolerated. E.g. `Button.js` has code that looks like this: ```jsx const styles = StyleSheet.create({ button: Platform.select({ ios: {}, android: { elevation: 4, // Material design blue from https://material.google.com/style/color.html#color-color-palette backgroundColor: '#2196F3', borderRadius: 2, }, }), ``` For non ios/Android platforms, that creates a style object which looks like: ```js { button: undefined, ... } ``` This previously meant that the component would be unstyled if created, but now means out-of-tree platforms throw if the builtin Button component is required. This change restores the previous `for in` loop but adds a `hasOwnProperty` check to avoid properties on prototypes. ## Changelog [General] [Fixed] - Restore Previous Behavior for StyleSheet Validation of Null/Undefined Styles Pull Request resolved: https://github.com/facebook/react-native/pull/29171 Test Plan: Validated that importing Buttons will no longer cause an exception, and that invalid properties are still caught. Reviewed By: JoshuaGross Differential Revision: D22118379 Pulled By: TheSavior fbshipit-source-id: 650c64b934ccd12a3dc1b75e95debc359925ad73 * Set windowTranslucentNavigation to false (#29399) Summary: This fixes https://github.com/facebook/react-native/issues/29397. Without this, apps that specify `android:windowTranslucentNavigation` draw the `LogBox` buttons underneath the soft navigation bar, making the buttons unpressable. Before | After :-------------------------:|:-------------------------: <img src="http://ashoat.com/AndroidTranslucentNavigationLogBox.png" width="300" /> | <img src="http://ashoat.com/AndroidTranslucentNavigationLogBoxFixed.png" width="300" /> ## Changelog [Android] [Fixed] - Set LogBox windowTranslucentNavigation to false Pull Request resolved: https://github.com/facebook/react-native/pull/29399 Test Plan: I tested this change on the [repo](https://github.com/Ashoat/LogBoxTest) I set up to reproduce the issue. I set it up to [build `ReactAndroid` from source](https://github.com/Ashoat/LogBoxTest/commit/3a2cdab8777ac381cd3be5a84a5bf3250751ac11) and then edited `node_modules/react-native/ReactAndroid/src/main/res/devsupport/values/styles.xml` directly. Reviewed By: rickhanlonii Differential Revision: D22602970 Pulled By: mdvacca fbshipit-source-id: 8c2adc149aa0157825075022f00bb695956d3121 * Fix image cannot show in iOS 14 (#29420) Summary: This PR is to fix https://github.com/facebook/react-native/issues/29279, which image cannot show in iOS 14 As https://github.com/facebook/react-native/issues/29279#issuecomment-658244428 mention, this issue can be fixed by calling ` [super displayLayer:layer];` it it is still image, to let `UIImageView` handle still image rendering ## Changelog [iOS] [Fixed] - Fix image cannot show in iOS 14 Pull Request resolved: https://github.com/facebook/react-native/pull/29420 Test Plan: Image can be shown in iOS 14 build with Xcode 12 beta, using ```js <Image source={require('./images/some_local_image.jpg')}/> ``` It may also need to test gif image is render correctly ```js <Image source={{uri: 'https://some_remote_gif_image.gif'}}/> ``` Reviewed By: p-sun Differential Revision: D22619448 Pulled By: shergin fbshipit-source-id: f4d0ad83af945a6b8099d4eaea5a5f1933c7bfd2 * [0.63.2] Bump version numbers * botched merge changes 1 * more hermes changes needed from upstream, botched merge? * [RCTPicker] Guard UIKit only API on macOS * [RCTSegmentedControl] Make UIKit agnostic * [RCTDisplayWeakRefreshable] Make platform agnostic * [RCTImageLoader] Make platform agnostic * [RCTDevLoadingView] Make platform agnostic * botched merge changes 2 * [RCTPushNotificationManager] Guard for macOS * v0.63 TODO * [RCTBaseTextInputViewManager] Make platform agnostic * [RCTBaseTextInputView] Make platform agnostic * [RNTester-macOS] Fix * [RCT-Folly] Fix build * [PlatformColorValueTypes] Add macOS shim * [package] Update CLI to no longer require config This makes a previous change more explicit: https://github.com/microsoft/react-native-macos/pull/602 * Fix iOS build failures. * Get RNTester to launch * [CODEOWNERS] Add myself * [flow] Remove deprecated rule in newer Flow https://github.com/facebook/flow/commit/759970c1b6dc0a25171d9969e34eaf5dae70f130 * [flow] Get iOS checks green * [PlatformColor] Duplicate iOS code for macOS This is a naive version of this change, there should likely be some code sharing happening between iOS and macOS. * [test] Make green with macOS fork changes * [test] Get macOS test bundle to build * [Color] Rename alternating colors to match to assumptions * [PlatformExample] Fix examples on macOS * [transform] Use iOS implementation for macOS * [circle] Fix config * [ci] Update metro config as per upstream * [ci] Ignore metro config in e2e tests * Revert "[ci] Ignore metro config in e2e tests" This reverts commit 25f7006bc9ba76b1e002b721954a823b3d710c5c. * Revert "[ci] Update metro config as per upstream" This reverts commit b47ca570be00394bbd92b349eab02083787301e7. * [ci] Only disable custom metro config in e2e test * [ci] Ignore metro config in e2e tests * [ci] Switch to experimental CocoaPods CDN * Revert "[ci] Switch to experimental CocoaPods CDN" This reverts commit 44a92f7f08397406429672b14930d44b6aa06b5e. * [ci] Skip Android tests in Apple PR on master * [rnm-init] Fix pod reference * [rnm-init] Update minimum iOS deployment target Co-authored-by: Christoph Nakazawa <cpojer@fb.com> Co-authored-by: Sergio Estevao <sergioestevao@gmail.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: Sam Mathias Weggersen <sawegger@microsoft.com> Co-authored-by: Tommy Nguyen <tonguye@microsoft.com> Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Héctor Ramos <hector@hectorramos.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Sebastian Markbage <sema@fb.com> Co-authored-by: generatedunixname89002005287564 <generatedunixname89002005287564@fb.com> Co-authored-by: Eddie Dugan <ejd@fb.com> Co-authored-by: Valentin Shergin <shergin@fb.com> Co-authored-by: Max Ovtsin <maxovtsin@fb.com> Co-authored-by: Alexander Kawrykow <akawry@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Spencer Ahrens <sahrens@fb.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Jack Wang <shoubowang@fb.com> Co-authored-by: Oleg Bogdanov <boguscoder@fb.com> Co-authored-by: Michael Bolin <mbolin@fb.com> Co-authored-by: Dan Abramov <gaearon@fb.com> Co-authored-by: Peter Argany <petetheheat@fb.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: George Zahariev <gkz@fb.com> Co-authored-by: Jason Safaiyeh <safaiyeh@protonmail.com> Co-authored-by: Pedro Barbiero <pedrobarbiero@gmail.com> Co-authored-by: Brian Vaughn <bvaughn@fb.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Martin Sherburn <mns@fb.com> Co-authored-by: Tom Underhill <tomun@microsoft.com> Co-authored-by: Ventsislav Dimitrov <4097884+vdmtrv@users.noreply.github.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: Lucas Bento <lucas.bsilva@outlook.com> Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com> Co-authored-by: Vojtech Novak <vonovak@gmail.com> Co-authored-by: Emilis Baliukonis <emilisb@wix.com> Co-authored-by: Jacob Bower <jbower@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: Marc Horowitz <mhorowitz@fb.com> Co-authored-by: Sidharth Guglani <sidharthguglani@fb.com> Co-authored-by: Andrew Coates (REDMOND) <acoates@microsoft.com> Co-authored-by: maciej simka <mcj.simka@gmail.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Pavlos Vinieratos <pvinis@gmail.com> Co-authored-by: Cristiano Santos <cristianomnsantos@gmail.com> Co-authored-by: Daniel Cohen Gindi <Danielgindi@gmail.com> Co-authored-by: Eli White <eliwhite@fb.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: jiggag <jiggag90@gmail.com> Co-authored-by: Emily Janzer <janzer@fb.com> Co-authored-by: Kacper Wiszczuk <kacperwiszczuk@gmail.com> Co-authored-by: Xiaoyu Yin <xyin@fb.com> Co-authored-by: Javier Cuevas <javi@diacode.com> Co-authored-by: Bruno Barbieri <brunobar79@gmail.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Will Holen <willholen@fb.com> Co-authored-by: Pritesh Nandgaonkar <prit91@fb.com> Co-authored-by: sunnylqm <sunnylqm@qq.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Tim Yung <yungsters@fb.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: Devon Deonarine <hello@devondeonarine.ca> Co-authored-by: Radek Czemerys <radko93@gmail.com> Co-authored-by: Hein Rutjes <IjzerenHein@users.noreply.github.com> Co-authored-by: zhongwuzw <zhongwuzw@qq.com> Co-authored-by: Jonny Burger <jonathanburger11@gmail.com> Co-authored-by: Ryan Tremblay <ryan.tremblay@microsoft.com> Co-authored-by: almouro <contact@almouro.com> Co-authored-by: Rick Hanlon <rickhanlonii@gmail.com> Co-authored-by: Matthieu Harlé <bonjour@matthieuharle.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Ashoat Tevosyan <ashoat@gmail.com> Co-authored-by: Tom Cheung <cheungch@gmail.com>
2020-09-30 19:38:06 +03:00
import typeof Pressable from './Libraries/Components/Pressable/Pressable';
import typeof ProgressBarAndroid from './Libraries/Components/ProgressBarAndroid/ProgressBarAndroid';
import typeof ProgressViewIOS from './Libraries/Components/ProgressViewIOS/ProgressViewIOS';
import typeof RefreshControl from './Libraries/Components/RefreshControl/RefreshControl';
import typeof SafeAreaView from './Libraries/Components/SafeAreaView/SafeAreaView';
import typeof ScrollView from './Libraries/Components/ScrollView/ScrollView';
import typeof SectionList from './Libraries/Lists/SectionList';
import typeof SegmentedControlIOS from './Libraries/Components/SegmentedControlIOS/SegmentedControlIOS';
import typeof Slider from './Libraries/Components/Slider/Slider';
import typeof StatusBar from './Libraries/Components/StatusBar/StatusBar';
import typeof Switch from './Libraries/Components/Switch/Switch';
import typeof Text from './Libraries/Text/Text';
import typeof TextInput from './Libraries/Components/TextInput/TextInput';
import typeof Touchable from './Libraries/Components/Touchable/Touchable';
import typeof TouchableHighlight from './Libraries/Components/Touchable/TouchableHighlight';
import typeof TouchableNativeFeedback from './Libraries/Components/Touchable/TouchableNativeFeedback';
import typeof TouchableOpacity from './Libraries/Components/Touchable/TouchableOpacity';
import typeof TouchableWithoutFeedback from './Libraries/Components/Touchable/TouchableWithoutFeedback';
import typeof View from './Libraries/Components/View/View';
import typeof VirtualizedList from './Libraries/Lists/VirtualizedList';
import typeof VirtualizedSectionList from './Libraries/Lists/VirtualizedSectionList';
// APIs
import typeof ActionSheetIOS from './Libraries/ActionSheetIOS/ActionSheetIOS';
import typeof Alert from './Libraries/Alert/Alert';
import typeof AlertMacOS from './Libraries/Alert/AlertMacOS'; // TODO(macOS GH#774)
import typeof Animated from './Libraries/Animated/Animated';
import typeof Appearance from './Libraries/Utilities/Appearance';
import typeof AppRegistry from './Libraries/ReactNative/AppRegistry';
import typeof AppState from './Libraries/AppState/AppState';
import typeof AsyncStorage from './Libraries/Storage/AsyncStorage';
import typeof BackHandler from './Libraries/Utilities/BackHandler';
import typeof Clipboard from './Libraries/Components/Clipboard/Clipboard';
import typeof DeviceInfo from './Libraries/Utilities/DeviceInfo';
import typeof DevSettings from './Libraries/Utilities/DevSettings';
import typeof Dimensions from './Libraries/Utilities/Dimensions';
import typeof Easing from './Libraries/Animated/Easing';
import typeof ReactNative from './Libraries/Renderer/shims/ReactNative';
import typeof I18nManager from './Libraries/ReactNative/I18nManager';
import typeof ImagePickerIOS from './Libraries/Image/ImagePickerIOS';
import typeof InteractionManager from './Libraries/Interaction/InteractionManager';
import typeof Keyboard from './Libraries/Components/Keyboard/Keyboard';
import typeof LayoutAnimation from './Libraries/LayoutAnimation/LayoutAnimation';
import typeof Linking from './Libraries/Linking/Linking';
import typeof LogBox from './Libraries/LogBox/LogBox';
import typeof NativeDialogManagerAndroid from './Libraries/NativeModules/specs/NativeDialogManagerAndroid';
import typeof NativeEventEmitter from './Libraries/EventEmitter/NativeEventEmitter';
import typeof Networking from './Libraries/Network/RCTNetworking';
import typeof PanResponder from './Libraries/Interaction/PanResponder';
import typeof PermissionsAndroid from './Libraries/PermissionsAndroid/PermissionsAndroid';
import typeof PixelRatio from './Libraries/Utilities/PixelRatio';
import typeof PushNotificationIOS from './Libraries/PushNotificationIOS/PushNotificationIOS';
import typeof Settings from './Libraries/Settings/Settings';
import typeof Share from './Libraries/Share/Share';
import typeof StyleSheet from './Libraries/StyleSheet/StyleSheet';
import typeof Systrace from './Libraries/Performance/Systrace';
import typeof ToastAndroid from './Libraries/Components/ToastAndroid/ToastAndroid';
import typeof * as TurboModuleRegistry from './Libraries/TurboModule/TurboModuleRegistry';
import typeof UIManager from './Libraries/ReactNative/UIManager';
import typeof useColorScheme from './Libraries/Utilities/useColorScheme';
import typeof useWindowDimensions from './Libraries/Utilities/useWindowDimensions';
import typeof UTFSequence from './Libraries/UTFSequence';
import typeof Vibration from './Libraries/Vibration/Vibration';
v0.63 sync from upstream (#613) * Upgrade to Metro 0.59 Summary: Upgrades RN to Metro 0.59. Changelog: [Internal] Metro Upgrade Reviewed By: motiz88 Differential Revision: D20533864 fbshipit-source-id: 3c5fb8e37d2363edf0b9a1a8cfbdefba00763415 * Fix mock for TextInput (#28332) Summary: This PR adds the `isFocused` method to the mock of the TextInput component. My understanding some of the latest changes on the TextInput to make it use a forwardRef change the way this method is mock giving an error when trying to use in on a mock. The change suggested here fixes the issue. ## Changelog [JavaScript] [Fixed] - Fix the mock for TextInput to support the `isFocused` method Pull Request resolved: https://github.com/facebook/react-native/pull/28332 Reviewed By: cpojer Differential Revision: D20538044 Pulled By: TheSavior fbshipit-source-id: be734af105ab62ffdf9ed4017bd70845e207f8cd * Properly handle LogBox errors during tests Summary: This diff fixes an issue where errors in LogBox during tests would cause the tests to crash. The crash is due to the NativeExceptionsManager module not being mocked (as all native module need to be in tests). The fix is to properly mock the NativeExceptionManger. This fix exposed an infinite loop issue where failures in LogBox will be logged to the ExceptionManager, which logs to the console, which logs to LogBox, creating a loop. This diff also fixes that look by moving the LogBox internal error check to the top of the monkey patched console methods. Changelog: [Internal] Differential Revision: D20428590 fbshipit-source-id: 7289a480c99ba8dee67772178b7629afb40b330a * Back out "Track animations and flush them" Summary: Original commit changeset: b594d0e6e9b6 D20319824 introduced a problem in LayoutAnimations, which makes surfaced as the problem in T63911344. This diff reverts D20319824. Changelog: [Internal] Reviewed By: lunaleaps Differential Revision: D20541918 fbshipit-source-id: ff72b839f57d39051122920a38b2632cbb5ec362 * Consolidate "dispatchMountItems" reentrancy prevention code, and retry code, in one function Summary: Simplifying the dispatchMountItems reentrance and retry logic. Motivation: cleanup so I can work on dispatching ViewCommands before anything else. Importantly, this gives us the properties that: 1) Only one function is responsible for calling dispatchMountItems 2) Only one function is responsible for deciding if we shouldn't call dispatchMountItems due to reentrance 3) Only one function is responsible for all cleanup 4) Only one function maintains all of the relevant flags (except dispatchPreMountItems... two total now, instead of 4 before) Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20437035 fbshipit-source-id: 5370366790eb25f653bee6c1950e747458374a61 * Only retry ViewCommand mount items if exception is marked as "Retryable" Summary: Instead of just blindly retrying all ViewCommands if they fail - which could be dangerous, since it's arbitrary imperative commands we'd be executing twice, potentially with bad app state - we only retry if the ViewCommand throws a "RetryableMountingLayerException". Changelog: [Internal] Optimization to ViewCommands Reviewed By: mdvacca Differential Revision: D20529985 fbshipit-source-id: 0217b43f4bf92442bcc7ca48c8ae2b9a9e543dc9 * Introduce early dispatch of ViewCommands in FabricUIManager Summary: Earlier this week I introduced a change in the old, non-Fabric renderer (D20378633 D20427803) that (gated behind a feature-flag) executes ViewCommands before all other types of commands, as a perf optimization and (I think) a potential fix for a category of race conditions. I've added more details in comments here. The Fabric renderer uses the same feature-flag that I introduced for the non-Fabric renderer. Changelog: [Internal] Fabric Reviewed By: mdvacca Differential Revision: D20449186 fbshipit-source-id: bb3649f565f32c417a6247369902333989a043aa * Change nightly build from hourly to nightly (daily at 00:00) (#28346) Summary: We initially added the nightly build test to run every hour, in order to more quickly validate it. Now that it has been validated we can run it every night as it is intended to do. cc hramos ## Changelog [General] [Changed] - Change nightly build from hourly to nightly Pull Request resolved: https://github.com/facebook/react-native/pull/28346 Reviewed By: cpojer Differential Revision: D20550143 Pulled By: hramos fbshipit-source-id: 9487c6785684ad6ea7e877290d50a33118090a7f * Add diffing to app bundle size reports (#28284) Summary: Add diffing to app bundle size reports. ## Changelog [Internal] [Changed] - Add diffing to app bundle size reports Pull Request resolved: https://github.com/facebook/react-native/pull/28284 Test Plan: - App bundle size reports should now display a diff where available - Right now, the database contains only one entry for the last known good iOS build - Triggering a new build should not create additional comments Reviewed By: cpojer Differential Revision: D20450158 Pulled By: hramos fbshipit-source-id: 720772275f24d3ff0a49705f4dada2efe2e99bd3 * feat: improve monorepo support by removing redundant PROJECT_ROOT (#28354) Summary: Historically, React Native didn't support a lot of custom project structures apart from the standard flat directory with `ios` and `android` folders. The CLI had to be explicitly started from the project root, otherwise Metro didn't work right. In order to resolve the project root in the most accurate way, React Native assumed that project root is always `../../` from its location in `node_modules` - this is not true when the installation gets hoisted (e.g. in a monorepo). To address that, janicduplessis brought support for custom [`PROJECT_ROOT`](https://github.com/facebook/react-native/commit/9ccde378b6e6379df61f9d968be6346ca6be7ead) that allowed overriding the `../../` in case it wasn't true. Today, CLI is able to automatically resolve the project root, no matter where it's started. It will traverse the tree of the directories upwards and stop as soon as it meets `package.json`. As a result, it doesn't really matter from where we start the CLI anymore as a part of `react-native-xcode.sh`. By replacing the default value of `$REACT_NATIVE_DIR/../../` with `$PWD, that is default for all Xcode scripts, we can make the setup for monorepo easier - nobody will need to set `$PROJECT_ROOT` in order to override the incorrect defaults. By default, all scripts defined in Xcode run from `$PWD` directory, which is the location of the iOS project. In the future, we will be able to remove `cd` entirely. To better understand this PR, let's look a few hypothetical structures as an example: #### Monorepo: > tl;dr works out of the box, no need to mess around with paths ``` - package.json - packages/ - my-app/ - index.js - package.json - ios/ - MyApp.xcodeproj ``` **Before this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $REACT_NATIVE_DIR/../../ node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - Because we change the directory to the root of monorepo, CLI throws an error. All in all, there's no `react-native` dependency at the workspace root. - Some users turn `no hoist` in an act of troubleshooting the errors, which resolves the problem - `react-native` is moved under `my-app/node_modules` which makes this mechanism resolve properly. - Some users find out about `PROJECT_ROOT` and set it to overwrite the default value. For example, setting `export PROJECT_ROOT = "$PWD/../` will set the directory to `my-app`, which has a dependency on `react-native` in a `package.json` and makes the CLI happy. **After this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $PWD node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - The `$PWD` is `packages/my-app/ios/` because that's where the Xcode project is located. CLI will automatically set the root to `../` because that's where it finds `package.json` with `react-native` dependency. It will pass that root to Metro, unless users have set a different one themselves. Thanks to that, all paths to JavaScript files remain working and unaffected. - No need to set `PROJECT_ROOT` anymore. - We don't rely on the location of `node_modules`, which is cleaner and future proof. #### Standard: > tl;dr no changes ``` - ios/ - MyApp.xcodeproj - index.js - package.json ``` **Before this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $REACT_NATIVE_DIR/../../ node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - Everything works fine. Path from `react-native` inside `node_modules` is correct - the project root is set right to `/` **After this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $PWD node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - The root will be set to where Xcode project is located, which is `/ios`. This is the PWD for all Xcode scripts. CLI will look for the `package.json` going upwards from `ios` folder. Will stop at `/`, find out it has `react-native` dependency, load it and its commands and proceed further. ## Changelog [iOS] [Feature] - Better monorepo support when building release apk Pull Request resolved: https://github.com/facebook/react-native/pull/28354 Test Plan: - All projects (standard/monorepo) run without issues. - PROJECT_ROOT is not needed. CC: Titozzz (who wrote monorepo guide), alloy, bartolkaruza Reviewed By: cpojer Differential Revision: D20558005 Pulled By: hramos fbshipit-source-id: 2551120beadcfd4c2f1393ce8a2c2fa6b93c9290 * Fix `test_android`: Remove references to fbsource cell (#28363) Summary: Fixes https://github.com/facebook/react-native/issues/28361. ## Changelog [Internal] [CI] - Fix test_android Pull Request resolved: https://github.com/facebook/react-native/pull/28363 Test Plan: Prior to fix: ``` react-native $ ./scripts/circleci/buck_fetch.sh Guessing 168a69309928ba16065cdb33b1775a4af9f924a6 as the last one used version. Using additional configuration options from /Users/hramos/.buckconfig.d/experiments, /etc/buckconfig.d/fb_chef.ini, /etc/buckconfig.d/fb_chef_override.ini Invalidating internal cached state: Watchman failed to start. This may cause slower builds. Parsing buck files: finished in 1.5 sec Buck wasn't able to parse /Users/hramos/git/react-native/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK: IOError: [Errno 2] No such file or directory: '/Users/hramos/git/react-native/tools/build_defs/platform_defs.bzl' Call stack: File "/Users/hramos/git/react-native/.buckd/resources/168a69309928ba16065cdb33b1775a4af9f924a6/buck_server/buck_parser/profiler.py", line 507, in wrapped return func(*args, **kwargs) File "/Users/hramos/git/react-native/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK", line 1 load("//tools/build_defs:platform_defs.bzl", "ANDROID") File "/Users/hramos/git/react-native/.buckd/resources/168a69309928ba16065cdb33b1775a4af9f924a6/buck_server/buck_parser/profiler.py", line 507, in wrapped return func(*args, **kwargs) This error happened while trying to get dependency '//ReactAndroid/src/main/java/com/facebook/fbreact/specs:FBReactNativeSpec' of target '//ReactAndroid/src/main/java/com/facebook/react/devsupport:devsupport' ``` After fix: ``` react-native $ ./scripts/circleci/buck_fetch.sh + buck fetch ReactAndroid/src/test/java/com/facebook/react/modules Guessing 168a69309928ba16065cdb33b1775a4af9f924a6 as the last one used version. Using additional configuration options from /Users/hramos/.buckconfig.d/experiments, /etc/buckconfig.d/fb_chef.ini, /etc/buckconfig.d/fb_chef_override.ini Invalidating internal cached state: Watchman failed to start. This may cause slower builds. Parsing buck files: finished in 1.1 sec Configuration 'ANDROID_SDK' points to an invalid directory '/opt/android_sdk'. When creating rule //ReactAndroid/src/main/java/com/facebook/hermes/instrumentation:instrumentation. ``` > Note: I don't have the Android SDK configured in this machine. Verified on Circle CI. `test_android` is now green: https://circleci.com/gh/facebook/react-native/140682?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link Reviewed By: cpojer Differential Revision: D20564934 Pulled By: hramos fbshipit-source-id: 5d843b8f113c4db5391ee39addc3ff259d962290 * Fix TextInput left/right padding Summary: This fixes two things: 1) Currently it only respects Start and End padding, and if there's a Theme default, it will override Left/Right padding. Whoops. 2) Currently it doesn't respect when a TextInput starts with padding, but then is removed. This resolves both. It still does not account for RTL support. Changelog: [Internal] Fix AndroidTextInput padding Reviewed By: mdvacca Differential Revision: D20573151 fbshipit-source-id: e89791641b6699e728cde9dbd661a8c21485fbc8 * Validate selection range passed to setTextAndSelection Summary: Changelog: [Internal] # Fabric 1. If `start` and `end` parameters in `setTextAndSelection` are -1, we don't move the cursor. Previously the cursor would be moved to beginning of text input. 2. In view commands, do not validate `eventCount`. It is passed in as undefined from JS because Fabric's text input doesn't use `eventCount`. # Paper 1. If `start` and `end` parameters in `setTextAndSelection` are -1, we don't move the cursor. Previously the cursor would be moved to beginning of text input. Reviewed By: shergin Differential Revision: D20538290 fbshipit-source-id: c7aeddc25f58697254474058ce901df958321f7c * Remove ReactTypes from fbsource and React sync Summary: See https://github.com/facebook/react/pull/18366 This contains a fork of the upstream Flow types. We shouldn't be syncing this since these leads to conflicting types. As a result, these uses have already been codemodded away. Only the imports remained. Changelog: [React Core] - Remove ReactTypes from sync. Reviewed By: gaearon Differential Revision: D20583740 fbshipit-source-id: fc86a934cbdca8ff90fe90282b86ecc945a85e5f * Fix controlled TextInput with child nodes Summary: Changelog: [Internal] # There are three changes in this diff ## _stateRevision is replaced with a BOOL `_stateRevision` was protecting against setting attributed string that is already visible to the user. Previously this was ok because the change was only coming from native, any changes from JS were ignored. Imagine following scenario: 1. User taps key. 2. Update state is called on component initiated by native. 3. New state is created with incremented revision by one. 4. `_stateRevision` gets set to new state's revision + 1. 5. Now JS wants to change something because it just learnt that user tapped the key. 6. New state is created again with incremented revision by one. 7. Update state is called on the component, but the change isn't applied to the text view because `_state->getRevision()` will equal `_stateRevision`. By having a BOOL instead of number, we very explicitly mark the region in which we don't want state changes to be applied to text view. ## Calling [_backedTextInputView setAttributedText] move cursor to the end of text input This is prevented by storing what the current selection is and applying it after `[_backedTextInputView setAttributedText]` is called. This was previously invisible because JS wasn't changing contents of `_backedTextInputView`. ## Storing of previously applied JS attributed string in state This is the mechanism used to detect when value of text input changes come from JavaScript. JavaScript sends text input value changes through props and as children of TextInput. We compare what previously was set from JavaScript to what is currently being send from JavaScript and if they differ, this change is communicated to the component. Previously only first attributed string send from JavaScript was send to the component. # Problem If children are used to set text input's value, then there is a case in which we can't tell what source of truth should be. Let's take following example We have a text field that allows only 4 characters, again this is only a problem if those 4 characters come as children, not as value. This is a controller text input. 1. User types 1234. 2. User types 5th character. 3. JavaScript updates TextInput, saying that the content should stay 1234. 4. In `TextInputShadowNode` `hasJSUpdatedAttributedString` will be set to false, because previous JS value is the same as current JS value. Reviewed By: shergin Differential Revision: D20587681 fbshipit-source-id: 1b8a2efabbfa0fc87cba210570142d162efe61e6 * Daily `arc lint --take BUCKFORMAT` Reviewed By: zertosh Differential Revision: D20593906 fbshipit-source-id: b056947c698508119dc9d4d1bba202295b8f0fda * RN picker - implement background color Summary: add support to the android implementation of the Picker component for setting the background color. Changelog: [Android] [Added] - Support item background color in Dialog Picker Differential Revision: D20566131 fbshipit-source-id: d693b40803fa1051ec955c5728994c820fecd9e9 * Fabric: Modernizing Yoga Dirty flag test. Summary: Now we using TEST_F thing that allows consilidating initialization. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D20578788 fbshipit-source-id: 103bcb8fdeb3dbf297385cfe56415bd646e16791 * Fabric: Changing signature of `ComponentDescriptor::createState` Summary: This is pure syntactic change. Often we don't have a shared pointer to ShadowNodeFamily and only have just a reference. At the same time, `ComponentDescriptor::createState` does not have to accept a shared pointer. So, it's better to accept just a reference. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20578787 fbshipit-source-id: 905277001e096d41e75007575b59ea2ea15fbf4b * Fabric: View Test: Changing state should not dirty Yoga tree (in some most cases) Summary: Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D20578789 fbshipit-source-id: 4336165217bd39fc8065cfaeb96ef7753433d48a * Get ReactiveNative compiled with Clang 10 (#28362) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/28362 Fixed a few compilation errors emitted by Clang 10. Changelog: [iOS] [Fixed] - Get ready for Clang 10 Differential Revision: D20549970 fbshipit-source-id: dc36a85d90d3e43a05f045feb57c6ab6ded67da7 * Guard against null values in object parameters for bridged methods Summary: Handles the case when a value in an object parameter of a turbo module spec is null (even if the type is nullable). For example, given: ``` export interface Spec extends TurboModule { +myFunc: ({| foo: ?string, |}) => void; } ``` and calling `NativeModule.myFunc({foo: null})`, we see an error like: ``` JSON value '<null>' of type NSNull cannot be converted to NSString ``` Guarding against this by converting NSNull's to nils ## Changelog: [iOS] [Fixed] - Fix crash when passing null value in object parameter of bridged method Reviewed By: fkgozali Differential Revision: D20591590 fbshipit-source-id: fdb90f34131427a235f2e3c99147bf1e6a9c6732 * Modify pending deletion tags to be cross manageChildren Summary: Changelog: [Internal] Removing historic layout animations index adjustment (D20323928) broke the Dating Secret Crush screen. Since flushing animations (D20319824) had to be reverted due to issues with Saved + Privacy Shortcuts (https://fburl.com/tasks/eijtmifu) we need to track pending deletions across `manageChildren` operations. Reviewed By: JoshuaGross Differential Revision: D20601079 fbshipit-source-id: c6f116683750e97abe7f988cf361d2a6449e90e6 * Enable label-actions on the react-native repository (#28374) Summary: Enhance our issue management workflow by having the bot respond automatically whenever a label is applied to the issue. ## Changelog [Internal] - CI Pull Request resolved: https://github.com/facebook/react-native/pull/28374 Test Plan: Not tested. If needed, could be applied to a different, test repository. Reviewed By: cpojer Differential Revision: D20606887 Pulled By: hramos fbshipit-source-id: 874d1464527ea76bf51394a7d3e98e4fd8f69345 * Fix Animated Value initialized with undefined in ScrollView (#28349) Summary: When passing an object to contentOffset that doesn't have `y` prop set it causes the following error: ``` Error: AnimatedValue: Attempting to set value to undefined This error is located at: in ScrollView (at src/index.js:638) ... ``` This happens since a runtime check was added to the `AnimatedValue` constructor. (a3aaa471eca58b31597b9a0669f7ade385ccb175) According to flow types the object passed to contentOffset should always contain both x and y props but since it worked before when y is undefined I think its fine to patch the runtime behaviour defensively, especially since the code change is simple. ## Changelog [General] [Fixed] - Fix Animated Value initialized with undefined in ScrollView Pull Request resolved: https://github.com/facebook/react-native/pull/28349 Test Plan: Tested that the crash no longer reproduces when passing an empty object to contentOffset. Reviewed By: cpojer Differential Revision: D20601664 Pulled By: hramos fbshipit-source-id: b098a2dd1e702f995a9a92fa6e4e9a204187dac4 * xplat/js/react-native-github/ReactCommon/fabric/components/textinput/ Summary: Changelog: [Internal] Reviewed By: scottrice Differential Revision: D20619227 fbshipit-source-id: 674337e6ce585a4e96d020f9624b874ba86e2d80 * Seed ssh known hosts with github's public key (#28370) Summary: The [previous attempt](https://github.com/facebook/react-native/pull/28304) to fix the publish step failed, so now reverting to manually configuring things. This PR adds an entry to SSH’s `known_hosts` file using github.com’s public key that I have verified as per [these instructions](https://serverfault.com/a/807363): ``` ~/C/R/react-native [master] » nmap github.com --script ssh-hostkey Nmap scan report for github.com (140.82.118.4) rDNS record for 140.82.118.4: lb-140-82-118-4-ams.github.com PORT STATE SERVICE 22/tcp open ssh | ssh-hostkey: | 1024 ad:1c:08:a4:40:e3:6f:9c:f5:66:26:5d:4b:33:5d:8c (DSA) |_ 2048 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48 (RSA) ``` These fingerprints line up with [the ones posted by GitHub](https://help.github.com/en/github/authenticating-to-github/githubs-ssh-key-fingerprints), so my setup should be good and can be trusted to grab the public key from the right host: ``` ~/C/R/react-native [master] » ssh-keyscan -t rsa -H github.com # github.com:22 SSH-2.0-babeld-d48c3acd |1|If6MU203eXTaaWL678YEfWkVMrw=|kqLeIAyTy8pzpj8x8Ae4Fr8Mtlc= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== ``` ## Changelog [Internal] [Fixed] - Make automated publishing of packages from CI work again Pull Request resolved: https://github.com/facebook/react-native/pull/28370 Test Plan: I used the command being added in this PR in [a failed CI job](https://app.circleci.com/pipelines/github/facebook/react-native/4104/workflows/916127cb-177f-4583-9f90-cae5318041d8/jobs/140810). When I invoked the publish script manually I was not greeted by the blocking prompt and the package was successfully published: https://www.npmjs.com/package/react-native/v/0.0.0-56cf99a96 Reviewed By: cpojer Differential Revision: D20601527 Pulled By: hramos fbshipit-source-id: b1a4405228408cfc4a1b3b44ab88c79522af3a66 * Fix app bundle size diff not always being compared against latest commit (#28368) Summary: - Timestamp of entries in our Firebase instance sometimes get stored as number. This means that we may not always be diffing against the latest master commit. - Size report of Android and iOS gets overwritten depending on which build finishes first. ## Changelog [Internal] [Fixed] - App bundle size diff not always being compared against latest commit [Internal] [Fixed] - Android and iOS app bundle size diff overwrite each other Pull Request resolved: https://github.com/facebook/react-native/pull/28368 Test Plan: - We are now using Firebase's own [firebase.firestore.Timestamp.now](https://firebase.google.com/docs/reference/js/firebase.firestore.Timestamp#now) to ensure that we always get a timestamp in the preferred format. This has been tested locally but can only be verified when merged to master and we start getting new data. In the meantime, I'll manually fix up all the entries in the store. - There should be one app bundle size comment for Android and one for iOS in this PR. Reviewed By: cpojer Differential Revision: D20601620 Pulled By: hramos fbshipit-source-id: 0c3e4b78a74cbd659f1957a6aa74322b016e0646 * Hopefully fix so loading crashes Summary: Changelog: [Android][Internal] Fix potential initializer interruption threading crashes. Reviewed By: mdvacca Differential Revision: D20615755 fbshipit-source-id: 58b706deeb6df1998caff5bf2ae9ec60114313fe * Fix label-actions configuration Summary: Adds back a missing label key, fixes open source issue: https://github.com/facebook/react-native/issues/28378 Changelog: [Internal] [CI] - Fix label-actions config Reviewed By: cpojer Differential Revision: D20625887 fbshipit-source-id: 63c90db249aa9c15369a4b5bcab71cbe75c6d4b8 * Changing Order Of mOverrideColorScheme In Constructor Summary: Changelog: [Android] [Updated] mOverrideColorScheme should be assigned before the first colorSchemeForCurrentConfiguration call, so the initial setting of mColorScheme will reflect the override Reviewed By: zackargyle Differential Revision: D20630173 fbshipit-source-id: a2a2d174d3fc40c14f27dce6a7fa8e67203480c9 * hermes | inspector | Don't include posix headers on non-posix systems Summary: Changelog: [Internal] Hermes inspector includes pthreads, arpa and sys headers on all OSes that would break vanilla Windows builds. This diff adds a check for posix-compliance before inclusion (Note: this ignores all push blocking failures!) Reviewed By: dulinriley Differential Revision: D20564449 fbshipit-source-id: 8e264bc3104065dc4315bb291e8560609fe65184 * Upgrade Prettier from 1.17 to 2.0.2. Summary: This gets us on the latest Prettier 2.x: https://prettier.io/blog/2020/03/21/2.0.0.html Notably, this adds support for TypeScript 3.8, which introduces new syntax, such as `import type`. Reviewed By: zertosh Differential Revision: D20636268 fbshipit-source-id: fca5833d003804333a05ba16325bbbe0e06d6c8a * Back out "Upgrade Prettier from 1.17 to 2.0.2." Differential Revision: D20639755 fbshipit-source-id: 5028563f9cf0527a30b4259daac50cdc03934bfd * Fabric: Additional temporary checks in prop parsing infra Summary: While ViewConfig infra isn't perfect we need to check some value for correctness during prop-parsing. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D20639055 fbshipit-source-id: 193dcd0769bc7777bc8d60c964ede72ebdaa83e4 * Update React package Summary: This just updates the `react` package to the latest stable version. We updated it to experimental internally earlier so this brings the open source version to the latest before the branch cut. This doesn't include any breaking changes. Changelog: [General][Changed] - Update to React 16.13.1 Reviewed By: cpojer Differential Revision: D20642909 fbshipit-source-id: 68a4c74bfe72f1abdb33b0b9071a4f4e8e568318 * Fix sketchy null checks induced by new formatting in Prettier 2.0 Summary: Update code to prepare for Prettier 2.0, which will reformat `a || (b || c)` to `a || b || c`. Changelog: [Internal] prepare for Prettier 2.0 Reviewed By: kassens Differential Revision: D20639483 fbshipit-source-id: c2932b1495884684172ba9291d56c546f51711b8 * RN picker - fix types in AndroidDialogPickerManagerInterface Summary: according to [this crash report](https://our.intern.facebook.com/intern/logview/details/facebook_android_crashes/7ba7056481015482c6166d65cb97e49d/?trace_key=1506fe36a70dd5e50cdc8968f6317f27), `value` was throwing an NPE despite being null-checked. this is because it was an `int` rather than an `Integer`, so the null check wasn't working Changelog: Fix types in AndroidDialogPickerManagerInterface Reviewed By: mdvacca Differential Revision: D20646343 fbshipit-source-id: a27587e0a48f5782bcf5ffddb604018218e65206 * Remove RCTExportModule log spam Summary: The bridge complains if modules aren't exported, which isn't really helpful with lazily loaded modules and turbo modules. I considered only turning this off when TurboModules is enabled, but figured we'd be killing this soon anyways... If anyone feels strongly I can go that approach. Changelog: [iOS][Internal] Remove RCTExportModule log spam Reviewed By: shergin Differential Revision: D20629575 fbshipit-source-id: d32d9fe244c4d06acfee982fca7c7f63da294dc5 * De-jank DevLoadingView Summary: ## Problems Repro steps: 1. Disable Fabric (because CMD + R doesn't work with Fabric right now). 2. Open up Marketplace and hit `CMD + OPT + R` 3. **Observe:** The progress bar doesn't show up right away. It also doesn't actually show progress. https://pxl.cl/140g1 RN Support post: https://fb.workplace.com/groups/rn.support/permalink/3437652016283389/ ## Fixes The first problem is that progress bar doesn't actually show progress. **Fix:** Bundle load progress is updated in `RCTCxxBridge`, where we first require `RCTDevLoadingView`, and then call its `updateProgress` method. Previously, we wouldn't lazily load `RCTDevLoadingView`, it already didn't exist. Lazily loading `RCTDevLoadingView` causes the progress view to show up. Here: https://pxl.cl/140gt If you look at the above video, you'll notice there are two stages to the progress bar: stage 1 displays the actual progress. Stage 2 prompts that we're downloading the JS bundle. As you can see, stage 1 and stage 2 have different background colors, even though both of them are green. **Fix:** I adjusted the JS to match the Native color. Here: https://pxl.cl/140gT We're almost there, but the progress bar is dismissed twice? **Fix:** I dug into the code, and the reason why was because when we hit `CMD + R`, we invalidate the bridge, and immediately re-initialize it. This means that we asynchronously invalidate the old TurboModuleManager, and immediately create a brand new one. Therefore, two `RCTDevLoadingView` modules can (and do) exist at once. So, I moved `RCTDevLoadingView` to be an instance member of `FBReactModule`, to ensure that it doesn't get cleaned up and re-created when TurboModuleManager is deleted and re-created. This finally fixed the progress bar jank: https://pxl.cl/140hn Changelog: [iOS][Fixed] - Remove RCTDevLoadingView jank Reviewed By: rickhanlonii Differential Revision: D20607815 fbshipit-source-id: 05825c67adaf3cfda70be0fa2dc92d413dc8921b * Fix retaining self in block in LogBox impl Summary: Logbox has a retain cycle (see linked task for my deeper investigation). This diff doesn't fix the retain cycle, but it's just good practice to not retain self strongly in blocks. Changelog: [iOS][Internal] Fix retaining self in block in LogBox implementation Reviewed By: shergin Differential Revision: D20630693 fbshipit-source-id: cf399495e9bcd1917932fcc0e9c9d2d2a32bf6f0 * Flow type infoLog Summary: Changelog: [General][Internal] flow type infoLog Reviewed By: zackargyle Differential Revision: D20577939 fbshipit-source-id: eed4401b2ae0a6bf845fdcb54c6abe1fe98fe7c1 * Replace fbsource// with // in xplat/js/ files [1] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: scottrice Differential Revision: D20495655 fbshipit-source-id: a57b72f694c533e2e16dffe74eccb8fdec1f55f5 * Deploy Flow 0.121 to Xplat (#901) Summary: Deploy Flow 0.121 to Xplat bypass-lint allow-large-files Closes https://github.com/facebook/flipper/pull/901 Changelog: [Internal] Reviewed By: panagosg7 Differential Revision: D20570316 fbshipit-source-id: a76983d6f46c8b995ce2dd5cd1e014534790698a * Replace fbsource// with // in xplat/js/ files [3] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D20656211 fbshipit-source-id: deb91b917d349bc500acbb03d734ff621f6e1fc7 * Replace fbsource// with // in xplat/js/ files [4] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: JoshuaGross, shergin Differential Revision: D20656696 fbshipit-source-id: 10f02decb1dc969fd3491ac90d97f09e2bda59e7 * Add Needs: Repro bot action (#28397) Summary: Add automated response for Needs: Repro ## Changelog [Internal] [Added] - Add automated response for Needs: Repro Pull Request resolved: https://github.com/facebook/react-native/pull/28397 Test Plan: Bot should add a comment with the Needs: Repro label. Reviewed By: cpojer Differential Revision: D20665378 Pulled By: hramos fbshipit-source-id: 1c7d878faacf935a640849f74c81f119e5c7e92d * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D20666684 fbshipit-source-id: 32255ac7509e0257693969a7b4b044569af30df7 * ✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392) Summary: Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`. Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job. What was done in this PR: * The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use. * The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument. * The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument * The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument ## Changelog [Internal] [CI] - ✅ Green CI, disabled test infrastructure work Pull Request resolved: https://github.com/facebook/react-native/pull/28392 Test Plan: Verified on Circle CI Reviewed By: cpojer Differential Revision: D20665512 Pulled By: hramos fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726 * Upgrade internal packages to support ESLint >= 6 (#28393) Summary: Fixes https://github.com/facebook/react-native/issues/28293 I've tested it with https://github.com/react-native-community/react-native-template-typescript and it seems to be working as expected - no warnings, supports typescript 3.8. (note: I didn't upgrade the package version as I don't know how the releases work for this package) ## Changelog [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/28393 Reviewed By: hramos Differential Revision: D20647112 Pulled By: cpojer fbshipit-source-id: ca6b67971f625dc8125a58f9220dfcd86250ba94 * Fabric: Fixing a deadlock in RCTSurfacePresenter Summary: This is another attempt to fix an issue very similar to T59424871. The previous attempt was in D19249490. I don't know why we don't see production crashes (stalls) but it happened to me (and not to me) in the debugger. The previous attempt didn't work because we still could have a deadlock because we tried to acquired shared mutex already owned exclusively by the `suspend` method. Here is another approach: Instead of using one shared mutex, now we use two. One is similar to what we had and another that protects `suspend` and `resume`. Besides that, now we pass a Scheduler to functions that use that explicitly. This way we can be more explicit about acquiring mutexes and the overall flow of execution. The idea is: Now an arbitrary code that can be reentrant does not cover with mutexes, so the deadlock is not possible. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20639228 fbshipit-source-id: 98515742f00f2ae94b50b585c9f1f0611e169ebe * Update React Hooks Plugin Summary: Updates `eslint-plugin-react-hooks` to 3.0.0. This introduces a new lint error when you use a Hook inside a class. Changelog: [General][Changed] - Updated the React Hooks ESLint Plugin Reviewed By: cpojer Differential Revision: D20675528 fbshipit-source-id: d0cbe9748fd15df7a4c6de00bd1462610e0a43d6 * Upgrade React DevTools 4.0.6 -> 4.6.0 Summary: Upgrading the embedded version of React DevTools, primarily to pull in [this PR](https://github.com/facebook/react/pull/18397) which will reduce the impact of this package on `node_modules` size. # Update process Following a similar process as D15973709, I began by searching for [all of the references](https://our.intern.facebook.com/intern/biggrep/?corpus=xplat&filename=.json&case=false&view=default&extre=&s=%22react-devtools&engine=apr_strmatch&context=false&filter[uninteresting]=false&filter[intern]=false&filter[test]=false&grep_regex=) to the `react-devtools-core` package and updated all v4 usage to to point to the new 4.6.0 release: 1: Manually update "react-devtools-core" versions: ``` js/package.json js/react-native-github/package.json nuclide/package.json sonar/desktop/app/package.json sonar/desktop/plugins/reactdevtools/package.json vscode/modules/vscode-webview/package.json ``` 2: Setup Yarn proxy: ``` yarn config set proxy http://fwdproxy:8080/ yarn config set https-proxy http://fwdproxy:8080 ``` 3: Run "yarn" in each of the above directories. 4: Run the lockfile shell script: ``` ~/xplat/js/scripts/update-oss-yarn-lockfile.sh ``` 5: Update the generated `MOBILE_JS_NODE_MODULE_DEPS.bzl` by running ``` js1 build buckfiles ``` ## Changelog: [General] [Changed] - Upgrade embedded React DevTools backend from v4.0.6 to v4.6.0. Reviewed By: cpojer, gaearon Differential Revision: D20676091 fbshipit-source-id: 99865bdba9bce45e2a7d582d5fb550cfdbeeca3a * Make ScrollView use ForwardRef Summary: Have ScrollView use forwardRef so that the host component methods like `measure` and `measureLayout` are available without having to call `getNativeScrollRef`. Instead, you can use `<ScrollView ref={myRef} />` and directly call all methods of ScrollView and host components on `myRef`. Previous usage: ``` const myRef = React.createRef<React.ElementRef<typeof ScrollView>>(); <ScrollView ref={myRef} /> const innerViewRef = myRef.current.getNativeScrollRef(); innerViewRef.measure(); ``` New usage: ``` const myRef = React.createRef<React.ElementRef<typeof View>>(); <ScrollView ref={myRef} /> // now, myRef.current can be used directly as the ref myRef.current.measure(); myRef.current.measureLayout(); // Additionally, myRef still has access to ScrollView methods myRef.current.scrollTo(...); ``` Changes: * Added deprecation warnings to ScrollView methods `getNativeScrollRef`, `getScrollableNode`, and `getScrollResponder` * Added the forwardRef call to create `ForwardedScrollView` - this takes in `ref` and passes it into the class ScrollView as `scrollViewRef`. * Forwarded the ref to the native scroll view using `setAndForwardRef`. * Added statics onto `ForwardedScrollView` so that `ScrollView.Context` can still be accessed. * Added type `ScrollViewImperativeMethods`, which lists the public methods of ScrollView. * Converted all public methods of ScrollView to arrow functions. This is because they need to be bound to the forwarded ref. * Bound all public methods of ScrollView to the forwarded ref in the `setAndForwardRef` call. * Flow typed the final output (ForwardedScrollView) as an abstract component that takes in the props of the `ScrollView` class, and has all methods of both the inner host component (`measure`, `measureLayout`, etc) and the public methods (`scrollTo`, etc). Changes to mockScrollView: * Changed mockScrollView to be able to mock the function component instead of a class component * Updated necessary tests Changelog: [General] [Changed] - Make ScrollView use forwardRef Reviewed By: TheSavior Differential Revision: D19304480 fbshipit-source-id: 6c359897526d9d5ac6bc6ab6d5f9d82bfc0d8af4 * Fix issue with onEndReached Summary: onEndReached can be triggered twice when more items are added to the end of the list. This change makes it so that a second call to onEndReached won't happen until the user scrolls down to the new end of the list. Changelog: [General] [Fixed] - Fix double call to onEndReached in VirtualizedList Reviewed By: sahrens Differential Revision: D20066740 fbshipit-source-id: 129d7ae6bfd241eeea18fe0bb12b82be67735874 * Remove console warnings from ScrollView methods Summary: The newly added console warnings in D19304480 are adding a lot of warning noise due to missed infra callsites. Those callsites need to be updated before these warnings can be added. Changelog: [Removed] Remove console warnings from ScrollView methods Reviewed By: rickhanlonii Differential Revision: D20700917 fbshipit-source-id: cb618ee3a291d26e1942e4f91bbc02dee41fb78b * Upgrade react-docgen, jscodeshift and flow-parser Summary: In preparation for upgrading babel, I'm updating some of our source transform tools to the latest versions. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D20675201 fbshipit-source-id: fa4fee2652529c6677087e42cdd1325a8080e46f * Ship State Reconciliation 100% on all platforms Summary: State Reconciliation has been running 50/50 for a while and all metrics look stable. This is necessary for providing a good experience so we should ship to everyone unconditionally. Changelog: [Internal] Fabric diffing reconciliation process improvement Reviewed By: mdvacca Differential Revision: D20715694 fbshipit-source-id: 25b2635ecc29b67e2911679c9db66bc84d37dec1 * Core telemetry tests: update so they pass on my machine Summary: `std::this_thread::sleep_for` is not really precise and will attempt to sleep for "at least" that much time, but may sleep much longer depending on what CPUs are doing and scheduling policies. To get this to pass on my machine, I had to substantially increase the thresholds. Changelog: [Internal] Reviewed By: shergin Differential Revision: D20689571 fbshipit-source-id: f159420d24a95da2b5d95d49ed7882e783291e98 * Optimize diff algorithm to produce fewer remove+insert ("move") paired instructions Summary: An evolution of D20633188 but more performant. There are three optimized paths before the slow path. The first optimized path tries to pair identical nodes from old/new tree, and generate Update mutations, until we hit nodes that are different (indicating either a remove or an insert). This already existed. The next two optimizations, introduced by Tim in his JS pseudocode, were inspired by ReactJS's diffing algorithm. They work in cases where the rest of the nodes are (1) all removals/deletes or (2) all creates+inserts. Finally, if those final two optimized paths can't run, it's because there is a mix of delete+remove, create+insert, and "move" operations, mixed at the beginning, middle, and/or end of the list. This has slightly better average/best-case complexity as the previous implementation. In particularly pathological cases where all nodes are arbitrarily reordered, or reversed, for instance (ABCDE->EDCBA) the algorithm has the same complexity as the previous algorithm (quadratic). For now iOS is pinned to the older differ Changelog: [Internal] Experiment to optimize diffing algorithm in Fabric Reviewed By: shergin Differential Revision: D20684094 fbshipit-source-id: d29fba95a0328156c023e1c87804f23770ee1d91 * Unit test for V2 "minimal instruction" diffing algorithm Summary: This unit test is to verify that the new diffing algorithm generates a "minimal" instruction set, with regards to removes and inserts ("moves"). These unit tests are here to verify the expected behavior in this new algorithm, but these tests may be modified or deleted in the future if we decide we want to change this behavior. Changelog: [Internal] fabric unit test Reviewed By: mdvacca Differential Revision: D20706592 fbshipit-source-id: 5f9991498e0d788ecbf88d938bfe6d3f0f27af40 * Add ES Lint rules for `DynamicColorIOS()`and `ColorAndroid()` (#28398) Summary: The [PlatformColor PR](https://github.com/facebook/react-native/pull/27908) added support for iOS and Android to express platform specific color values. The primary method for an app to specify such colors is via the `PlatformColor()` method that takes string arguments. The `PlatformColor` method returns an opaque Flow type enforcing that apps use the PlatformColor method instead of creating Objects from scratch -- doing so would make it harder to write static analysis tools around Color values in the future. But in addition to `PlatformColor()`, iOS has a `DynamicColorIOS()` method that takes an Object. The Flow type for this Object cannot be opaque, but we still want to enforce that app code doesn't pass variables instead of Object literals or that values in the Objects are variables. To ensure `DynamicColorIOS()` can be statically analyzed this change adds an ESLint rule to enforce that `DynamicColorIOS()` takes an Object literal of a specific shape. A `ColorAndroid()` was also introduced not for practical use but just to test having platform specific methods for more than one platform in the same app. A second ESLint rule is created for `ColorAndroid` as well. ## Changelog [General] [Changed] - Add ES Lint rules for `DynamicColorIOS()`and `ColorAndroid()` Pull Request resolved: https://github.com/facebook/react-native/pull/28398 Test Plan: `yarn lint` passes. Reviewed By: cpojer Differential Revision: D20685383 Pulled By: TheSavior fbshipit-source-id: 9bb37ccc059e74282b119577df0ced63cb9b1f53 * fix: Android gradle config when bundling for release (#28415) Summary: This fix aims to address the issue when bundling an Android app for release and getting the error exhibited in https://github.com/facebook/react-native/issues/28002 which I also encountered myself. The config was changed sometime in November 2019 (as part of https://github.com/facebook/react-native/issues/26940, commit https://github.com/facebook/react-native/commit/a3b08048674e324dbe1f0ca816f35607e9e06a2f) to be very opinionated when it comes to the use of `npx` which Gradle itself cannot find anyway (I have `npx` installed globally and it didn't pick it up). Another issue that the use of `npx` creates is that Gradle should only ever use the currently installed react-native cli rather than a (possibly) higher version which may not always have backward compatibility. The proposed change simply throws a more descriptive error rather than defaulting to a tool which may or may not exist on the machine, be it CI or a development environment. I've also modified the RNTester app to reflect the correct config implementation relative to the RNTester app itself. In real projects, the config inside `android/app/build.gradle` should look similar to the following snippet: ``` project.ext.react = [ cliPath: "$rootDir/../node_modules/react-native/cli.js", entryFile: "index.js" ]; ``` ## Changelog [Android] [Fixed] - Gradle release config Pull Request resolved: https://github.com/facebook/react-native/pull/28415 Test Plan: - [x] Successfully bundled an Android release build with correct config - [x] Works with RNTester app Reviewed By: mdvacca Differential Revision: D20714372 Pulled By: hramos fbshipit-source-id: 4d66139249c6f840582a71a48c64e6a6595f7af0 * Reimplement D19965405: Small improvements in Differentiator/TinyMap Summary: Two things: 1) I reimplement Valentin's idea in D19965405, so that TinyMaps can be iterated over, with a couple of bugfixes (calling front() or back() on an empty vector will crash). 2) I now use TinyMap instead of better::map in the "optimized" diffing algorithm. 3) `erase` now actually removes elements from the vector, but only when more than half of elements have been erased. 4) If you repeatedly erase elements at the beginning of the vector, they will no longer be iterated over. This is a specific optimization for our heaviest TinyMap use-cases. These amount to some small but hopefully somewhat meaningful perf improvements. Changelog: [Internal] Fabric perf Reviewed By: shergin Differential Revision: D20718719 fbshipit-source-id: 91f4b2e2e0f6387ae484e43d5b0095103087baa6 * Remove LayoutInspectingPolicy.includeScrollViewContentOffset Summary: `LayoutInspectingPolicy` has two flags, `includeTransform` and `includeScrollViewContentOffset`. `includeScrollViewContentOffset` seems to be redundant for two reasons. # 1st From looking at callers, they have always the same value. I looked at all call sites, and they are either always both set to true or both set to false. # 2nd The way we include scroll view content offset, is through transformation, so setting `includeTransform` to true and `includeScrollViewContentOffset` to false will include content offset anyway. In order to make both flags work, we would need to introduce further changes to `getRelativeLayoutMetrics`. But since the flag isn't used anyway, I think it is better to get rid of it for now. If we need it in the future, we could re-introduce it. Reviewed By: shergin Differential Revision: D20622256 fbshipit-source-id: fb6156c66b752319ea928239fa723ff90688b0a0 * Add support for translation and rotation to operator * between Rect and Transform Summary: Changelog: [Internal] Until now `Rect operator*(Rect const &rect, Transform const &transform)` supported only scaling. Now it supports translation and rotation as well. Reviewed By: shergin Differential Revision: D20622876 fbshipit-source-id: 1b65393bd3fd6fd9a8941903e0f2681a10097e4a * Include transform property when calling getRelativeLayoutMetrics Summary: Changelog: [Internal] Current implementation of `measure` doesn't take transform into account.. So if you had a view which has width and height 100 and had `Scale(0.5, 0.5, 1)` (this will shrink view by half). Calling `getRelativeLayoutMetrics` would report its size being `{100, 100}`. This applies if view's parent has transformation as well, because transformation is applied to all subviews of the view as well. Reviewed By: mdvacca Differential Revision: D20621590 fbshipit-source-id: 2cf902a0494291c821ecada56f810c5e6620db5a * feat: migrate appveyor to circleci (#28245) Summary: This issue closes https://github.com/facebook/react-native/issues/28241 Migrated Windows test from AppVeyor to CircleCI ## Changelog [Internal] [Changed] - Migrated Windows test from AppVeyor to CircleCI Pull Request resolved: https://github.com/facebook/react-native/pull/28245 Test Plan: For CircleCI to Pass Reviewed By: cpojer Differential Revision: D20689163 Pulled By: hramos fbshipit-source-id: 285c762457ef00f7884ee9157b3f336044c0452f * Remove "Debug with Nuclide" option Summary: This is no longer needed. Reviewed By: cpojer Differential Revision: D20722274 fbshipit-source-id: 5bc3104e90811d724f42aadbf137ab8eff718ca0 * experiment to preload RN bridge after fb4a bookmarks render Summary: Changelog: [Android][Internal] add internal supermodule label Reviewed By: mdvacca Differential Revision: D20434200 fbshipit-source-id: fae50309cdd0df4a4523c2f88d1c8e01a7163575 * Fix CursorDrawable Color Tint for Android 10+ Summary: Accessing this field via reflection is explicitly blacklisted by Google in Android 10 and higher. They have provided a new API to change the color, which I have implemented here. [The old setColorFilter is deprecated](https://developer.android.com/reference/android/graphics/drawable/Drawable#setColorFilter(int,%20android.graphics.PorterDuff.Mode)) so I also updated that method call as well. Changelog: [General] [Fixed] Use new setTextCursorDrawable API for Android 10 Reviewed By: JoshuaGross Differential Revision: D20656068 fbshipit-source-id: 58a92b57c0a892c7c87fc5d735e4ceaa4e987ec7 * Early return on tinting CursorDrawable if no color supplied Summary: There's (potentially) a lot of expensive reflection calls here that, as best I can tell, end up being ignored if the supplied color is null. Better to early return. Changelog: [General] [Internal] Preclude reflection when setting cursor color if color is null Reviewed By: JoshuaGross Differential Revision: D20670594 fbshipit-source-id: 480a988355bbd79008002c4326d4b35035ec2a95 * Partial React Sync for Inspector Summary: Partial sync for React that includes: - https://github.com/facebook/react/pull/18388 - https://github.com/facebook/react/commit/dd7e5e4f5ac2ffac3171ef61daee2cb1edc69635 Created from this branch: https://github.com/facebook/react/compare/master...rickhanlonii:rh-partial-3-24?expand=1 Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20651395 fbshipit-source-id: 67baf7c407f75d9fd01c17f2203a77a38567100e * Enable inspector for Fabric Summary: ## Overview This diff refactors the Inspector, moving logic to look up view data for a touched view inside the renderer as `getInspectorDataForViewAtPoint`. We then implement that same function for Fabric in order to support the inspector in that renderer. Requires https://github.com/facebook/react/pull/18388 ## Motivation Reason one for this refactor is that, previously, the inspector held all of the logic to look up view data for a given x,y touch coordinate. To do this, it would take the React tag and coordinates, look up the native view tag, measure it, and then ask React internals for the Fiber information of that tag. All of this is deeply coupled to React internals, yet the logic is outside of React core in the Inspector. Reason two is that, for Fabric, the logic for getting the view data is different than Paper. In Fabric, we pass the x,y coordinates to native directly, which returns an instance handle. That handle can be used to measure the ShadowNode, or retrieve the Fiber information. By moving the logic into the renderer in React core, we decouple the implementation details of looking up view data for a tapped point and allow ourselves the ability to add and change renderer-specific code for the actual lookup without impacting outsiders like the Inspector. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D20291710 fbshipit-source-id: a125223f2e44a6483120c41dc6146ad75a0e3e68 * chore: update url of warning message from deprecated imports (#28452) Summary: Some of the repository name of Lean Core(https://github.com/facebook/react-native/issues/23313) libraries has been renamed. This PR updates the warning message to display the updated url. ## Changelog [General] [Changed] - Update warning message of deprecated imports Pull Request resolved: https://github.com/facebook/react-native/pull/28452 Test Plan: updated URL can be accessed. Reviewed By: cpojer Differential Revision: D20745184 Pulled By: TheSavior fbshipit-source-id: 2c3ed6a000b45022ca6c4862305aa567c4d18b2e * Add `upgrade-support` link on issue creation (#28411) Summary: This PR adds a https://github.com/react-native-community/upgrade-support link for the user when creating an issue. Changelog: [Internal] Pull Request resolved: https://github.com/facebook/react-native/pull/28411 Reviewed By: cpojer Differential Revision: D20714274 Pulled By: hramos fbshipit-source-id: 4ca42224a50e386b95f21f0fb236a917e1b6b982 * Update PixelRatio 'getFontScale' method description (#28407) Summary: Refs facebook/react-native-website#1776. Despite in-code description `PixelRatio.getFontScale()` is working properly on the iOS (it also reflects the user settings). This PR updates the in-code description to match current behaviour. I have decided to skip in the code information about additional setting in `Accessibility` menu and in `Control Centre`, but if you think it is important just let me know, I can update this PR. ## Changelog [Internal] [Fixed] - Fix PixelRatio getFontScale method description Pull Request resolved: https://github.com/facebook/react-native/pull/28407 Test Plan: N/A Differential Revision: D20750260 Pulled By: shergin fbshipit-source-id: c40ec2fd49cd60e2975351c3a1c453aab0045da4 * Remove allowDisablingImmediateExecutionOfScheduleMountItems feature flag Summary: No longer needed. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20747684 fbshipit-source-id: a8077519b7670d72e23267b1c1423556ec97be3f * RuntimeExecutor helpers that modify the way of the callback is being executed. Summary: Here we implement a bunch of helper methods that allow customizing the behavior of a RuntimeExecutor "on-demand" on the caller side. We will use it in the next diff(s). Changelog: [Internal] Fabric-specific internal change. Reviewed By: PeteTheHeat Differential Revision: D20551411 fbshipit-source-id: 51d3cd02b69753110c0e1155347c6e52eb882c7d * Fabric: Using `executeSynchronouslyOnSameThread_CAN_DEADLOCK` in MainRunLoopEventBeat Summary: We are replacing inline-ed implementation with practically the same one implemented as the helper method. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20551409 fbshipit-source-id: fcc6f497cd240af65fba534051c217fe5746ce82 * Set RootNodeKind trait in ModalHostViewShadowNode Summary: Changelog: [internal] `ModalHostViewShadowNode` didn't have `RootNodeKit` trait, therefore `getRelativeLayoutMetrics` was including nodes in ancestors that it shouldn't have. Reviewed By: shergin Differential Revision: D20735801 fbshipit-source-id: 6b81e3b174c2f82e530abc2bca2da8bebc2270b0 * mention RNTester app in contributor guide (#28042) Summary: motivation is following - the RNTester app is imho the best place to try out any changes that a contributor would make, yet it is not directly mentioned in the contributor guide. This fixes it. ## Changelog [Internal] - Docs Pull Request resolved: https://github.com/facebook/react-native/pull/28042 Test Plan: not necessary Reviewed By: TheSavior Differential Revision: D20401260 Pulled By: hramos fbshipit-source-id: 01c1b7dff56b59909c94b2feb609650f0baba1a9 * Buck: Use Android SDK 29 during build (#28455) Summary: Fixes `test_android` and `test_docker` build failures. Thanks to dulmandakh for identifying the fix. Changelog: [Internal] [Android] [Changed] - Use Android SDK 29 to build during CI tests Pull Request resolved: https://github.com/facebook/react-native/pull/28455 Test Plan: Circle CI shows `test_android` and `test_docker` passing: https://app.circleci.com/jobs/github/facebook/react-native/142273 Reviewed By: sturmen Differential Revision: D20766589 Pulled By: hramos fbshipit-source-id: 8ef8a8ce3a6e7353ae47425accb3bd26cf1608c4 * Assign orderIndex_ in ConcreteViewShadowNode constructor instead of ViewShadowNode's constructor Summary: Changelog: [Internal] `orderIndex_` was only being assigned for `ViewShadowNode`, not for other `ShadowNodes` that are later represented on the screen. Reviewed By: shergin Differential Revision: D20746477 fbshipit-source-id: c04c2cfea14b9141d22bc3d9e9bb4c0c59925754 * Implement nativePerformanceNow to improve Profiler API results (#27885) Summary: When experimenting with React Profiler API (https://reactjs.org/docs/profiler.html), I noticed that durations are integers without a debugger, but they are doubles with higher precision when debugger is attached. After digging into React Profiler code, I found out that it's using `performance.now()` to accumulate execution times of individual units of work. Since this method does not exist in React Native, it falls back to Javascript `Date`, leading to imprecise results. This PR introduces `global.nativePerformanceNow` function which returns precise native time, and a very basic `performance` polyfill with `now` function. This will greatly improve React Profiler API results, which is essential for profiling and benchmark tools. Solves https://github.com/facebook/react-native/issues/27274 ## Changelog [General] [Added] - Implement `nativePerformanceNow` and `performance.now()` Pull Request resolved: https://github.com/facebook/react-native/pull/27885 Test Plan: ``` const initialTime = global.performance.now(); setTimeout(() => { const newTime = global.performance.now(); console.warn('duration', newTime - initialTime); }, 1000); ``` ### Android + Hermes ![Screenshot_1580198068](https://user-images.githubusercontent.com/13116854/73245757-af0d6c80-41b5-11ea-8130-dde14ebd41a3.png) ### Android + JSC ![Screenshot_1580199089](https://user-images.githubusercontent.com/13116854/73246157-92256900-41b6-11ea-87a6-ac222383200c.png) ### iOS ![Simulator Screen Shot - iPhone 8 - 2020-01-28 at 10 06 49](https://user-images.githubusercontent.com/13116854/73245871-f136ae00-41b5-11ea-9e31-b1eff5717e62.png) Reviewed By: ejanzer Differential Revision: D19888289 Pulled By: rickhanlonii fbshipit-source-id: ab8152382da9aee9b4b3c76f096e45d40f55da6c * Save/restore IP when leaving the interpreter Summary: This diff implements the instruction pointer save/restore trick Tzvetan came up with; allowing us to observe and modify the IP from outside the interpreter loop with negligible overhead. From Tzvetan's internal post on the subject: > [Today] the interpreter IP is just a local variable in the interpreter function, so there is no way to get to its value from outside the function. It lives in a register and we don't want to make it a Runtime field since the overhead [of accessing it via memory in the interpeter loop] would kill us. > However, if you really think about it, it only lives in a register while the interpreter function is running. For the rest of the time, it is spilled by the C++ compiler onto the stack. So, precisely when we need it, it is actually stored in memory. The only problem is, we don't know where! Admittedly, that is an annoying problem, but it feels like it should be solvable. > What if, instead of relying on the compiler to spill the IP register, we manually spill it ourselves, to a known location? It works. Example: https://godbolt.org/z/ftSDnp This diff implements this approach across the whole interpreter loop: whenever we call out of the loop we capture/publish the IP and restore it again immediately after the external call returns. This means we can now see the IP outside the interpret loop and even change it. This is effectively "for free" as the compiler now skips spilling/restoring the IP behind the scenes. The immediate benefit of this is knowing the current IP allows us to have more accurate stack-traces during execution. In future this may enabled tricks like changing the IP before returning to the interpreter loop, allowing things outside the interpreter to affect program flow without adding logic to the interpreter loop. Reviewed By: tmikov Differential Revision: D20151091 fbshipit-source-id: 3814382639800208d8985a32ede31ba8f7ff7c80 * Plumb through memory allocation profiler feature to Chrome Inspector Summary: Changelog: Make allocation profiler feature of Chome Inspector work Reviewed By: dulinriley Differential Revision: D20383003 fbshipit-source-id: 8a10c310d5a639a6644763adb53f2f0017057587 * chore: update lint config in template (#28443) Summary: Updating the eslint config and metro-preset used in project template. ## Changelog [General] [Changed] - Upgrade eslint-config and metro-preset in project template Pull Request resolved: https://github.com/facebook/react-native/pull/28443 Test Plan: - Start new project with `npx react-native init TestLint` - upgrade lint and metro-config - run lint and start up emulator on iOS and android Reviewed By: cpojer Differential Revision: D20771048 Pulled By: hramos fbshipit-source-id: a6d387b8687cee348681bcb10d22c7e3de291ed7 * Apply buckformat in preparation for updating buildifier Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D20773287 fbshipit-source-id: 144bb13191312eef246646b99e1dc06304c6d210 * Circle CI Housekeeping: Windows, e2e (#28471) Summary: Circle CI Housekeeping: * Integrate Windows job into `tests` workflow * Add parametrized e2e tests command * Move js e2e tests out of the disabled test quarantine area * Parametrize and split `test_ios` job to reduce total execution time by ~13 minutes **Before:** Longest running iOS job at 39 minutes. | Setup Job Runtime | Job | Job Runtime | Total Runtime | | - | - | - | - | | 01:24 | test_ios | 38:04 | **39:28** | | 01:24 | test_ios_frameworks | 38:02 | 39:26 | ![Screen Shot 2020-03-31 at 12 40 29 PM](https://user-images.githubusercontent.com/165856/78068308-044c3280-734d-11ea-96bf-2e50691a0ef7.png) **After:** Longest running iOS job down to 26 minutes. | Setup Job Runtime | Job | Job Runtime | Total Runtime | | - | - | - | - | | 01:26 | test_ios_unit | 20:48 | 22:14 | | 01:26 | test_ios_unit_frameworks | 22:52 | 24:18 | | 01:26 | test_ios_detox | 24:35 | 39:28 | | 01:26 | test_ios_detox_frameworks | 24:54 | **26:20** | ![Screen Shot 2020-03-31 at 12 39 22 PM](https://user-images.githubusercontent.com/165856/78068294-fe565180-734c-11ea-96da-8836231d7747.png) ## Changelog [Internal] [CI] - CI Housekeeping Pull Request resolved: https://github.com/facebook/react-native/pull/28471 Test Plan: Circle CI Reviewed By: cpojer Differential Revision: D20774521 Pulled By: hramos fbshipit-source-id: 4a2f5a4083cd76dcb51d5ccaf726cd204fca222e * Fix bug in optimized differ Summary: The differ was still producing correct, but not minimal, instruction sets in some cases due to an optimization that was buggy. This affected cases where 2+ nodes were inserted at the beginning of a list. It would trigger the old behavior where all nodes after the first would be removed, deleted, then reinserted. See the test case (which was failing and now passed) and P128190998 (the 3->4 transition) for samples. Changelog: [Internal] Fabric differ Reviewed By: mdvacca Differential Revision: D20785729 fbshipit-source-id: 2fea6a816753066abb358ed7bb51003140cd5fc4 * Use `buildCodeFrameError` in babel-plugin-inline-view-configs Summary: The next version of Babel changes how it prints file names in errors. This diff fixes the test by using `/` as the `cwd` and switches the plagin to use `path.buildCodeFrameError` so errors will be more helpful for users. I renamed the `nodePath` variable to `path` because that's what babel plugins usually do. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D20781805 fbshipit-source-id: cc149dce6389aa9402ce70ea30035c74a6150ea3 * Swap left and right yoga position with start and end in RTL context Summary: Changelog: [Internal] Paper swaps right and left in RTL setting, this logic is in [RCTShadowView.m](https://our.intern.facebook.com/intern/diffusion/FBS/browse/master/xplat/js/react-native-github/React/Views/RCTShadowView.m?commit=cdd504cfbee66ae0659495604c4ff7b5764a1d9e&lines=529-549). For Fabric instead of doing it during yoga props assignment, I swap the left/right with start/end just before we pass yoga nodes to layout calculation. Reviewed By: shergin Differential Revision: D20420040 fbshipit-source-id: b777f2658f56c173743b2034b8b5059e3e0c9840 * Fix inline-view-configs test on Windows. Summary: *facepalm* The file path is platform specific. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D20793023 fbshipit-source-id: 4fbcbf982911ee449a4fa5067cc0c5d81088ce04 * Pass isRTL flag from FabricUIManager Fabric core Summary: Changelog: [Internal] Send `isRTL` flag and `doLeftAndRightSwapInRTL` flags from Java to Fabric Core. Reviewed By: JoshuaGross, mdvacca Differential Revision: D20776005 fbshipit-source-id: 946c239d9a11ebea958b0a6d04f2316b7cd77311 * Promote shadowColor to formsStackingContext property Summary: Changelog: [Internal] View with `ShadowColor` was getting flattened and therefore views didn't have shadow property set. This is fixed by promoting ShadowColor so in case it is set, it forms stacking context. Reviewed By: shergin Differential Revision: D20792201 fbshipit-source-id: 1033ac00e32047ffbb14e61b7c26348c578d132d * Get CallInvokers from the bridge Summary: ## Context For now, assume TurboModules doesn't exist. **What happens when we call an async NativeModule method?** Everytime JS calls an async NativeModule method, we don't immediately execute it. The legacy infra pushes the call into some queue managed by `MessageQueue.js`. This queue is "flushed" or "emptied" by the following events: - **Flushed:** A C++ -> JS call. NativeModule async methods can called with an `onSuccess` and/or `onFail` callback(s). Calling `NativeToJsBridge::invokeCallback` to invoke one of these callbacks is one way for ObjC++/C++/Java to call into JS. Another way is via JSModule method calls, which are initiated by `NativeToJsBridge::callFunction`. - **Flushed:** When `JSIExecutor::flush` is called. Since TurboModules don't exist, this only happens when we call `JSIExecutor::loadApplicationScript`. - **Emptied:** When more than 5 ms have passed, and the queue hasn't been flushed/emptied, on the next async NativeModule method call, we add to the queue. Afterwards, we empty it, and invoke all the NativeModule method calls. **So, what's the difference between flushed and emptied?** > Note: These are two terms I just made up, but the distinction is important. If the queue was "flushed", and it contained at least one NativeModule method call, `JsToNativeBridge` dispatches the `onBatchComplete` event. On Android, the UIManager module is the only module that listens to this event. This `onBatchComplete` event doesn't fire if the queue was "emptied". **Why does any of this matter?** 1. TurboModules exist. 2. We need the TurboModules infra to have `JsToNativeBridge` dispatch `onBatchComplete`, which depends on: - **Problem 1:** The queue being flushed on calls into JS from Java/C++/ObjC++. - **Problem 2:** There being queued up NativeModule async method calls when the queue is flushed. In D14656466, fkgozali fixed Problem 1 by making every C++/Java/Obj -> JS call from TurboModules also execute `JSIExecutor::flush()`. This means that, with TurboModules, we flush the NativeModule async method call queue as often as we do without TurboModules. So far, so good. However, we still have one big problem: As we convert more NativeModules to TurboModules, the average size of the queue of NativeModule method calls will become smaller and smaller, because more NativeModule method calls will be TurboModule method calls. This queue will more often be empty than not. Therefore, we'll end up dispatching the `onBatchComplete` event less often with TurboModules enabled. So, somehow, when we're about to flush the NativeModule method call queue, we need `JsToNativeBridge` to understand that we've executed TurboModule method calls in the batch. These calls would have normally been queued, which would have led the queue size to be non-zero. So if, during a batch, some TurboModule async method calls were executed, `JsToNativeBridge` should dispatch `onBatchComplete`. **So, what does this diff do?** 1. Make `Instance` responsible for creating the JS `CallInvoker`. 2. Make `NativeToJsBridge` responsible for creating the native `CallInvoker`. `Instance` calls into `NativeToJsBridge` to get the native `CallInvoker`. 3. Hook up `CatalystInstanceImpl`, the Android bridge, with the new JS `CallInvoker`, and the new native `CallInvoker`. This fixes `onBatchComplete` on Android. iOS work is pending. Changelog: [Android][Fixed] - Ensure `onBatchComplete` is dispatched correctly with TurboModules Reviewed By: mdvacca Differential Revision: D20717931 fbshipit-source-id: bc3ccbd6c135b7f084edbc6ddb4d1e3c0c7e0875 * Make HermesRuntime::description() always include "HermesRuntime" Summary: If name is passed in as part of RuntimeConfig, that is included in the description, too. Changelog: [Internal] Reviewed By: dulinriley Differential Revision: D20716320 fbshipit-source-id: f2fba6df32f496090dee787d8b7f55a6a4dd8ed8 * Fix Yoga flexshrink with min-width sizing issue Summary: While resolving the flexible items we calculate totalFlexShrinkScaledFactors which uses the flexBasis or initial width of node (Not min-width). At a later stage during distribution of space we are subtracting value from this which also takes care of min-width. For example If node has flexShrink 1 and width 100 and min-width 301 then totalFlexShrinkScaledFactors will become -1*100 = -100 but later we are subtracting -1 * 301 (min-width) = -301 which is ambiguous and causing layout inconsistencies with how web behaves. Fixed this by only using the flexBasis or width for these calculations. Changelog: [Internal][Yoga] Fix layout issue when flexShrink and min-width are used together Reviewed By: pasqualeanatriello Differential Revision: D20219419 fbshipit-source-id: 948fbc06ca541d4ad307c88c8a2df65d157778b1 * More consistent snapshots on windows (#28482) Summary: Get jest tests to be runnable on windows, and match current snapshots ## Changelog [Internal] [Fixed] - More consistent snapshots on windows Pull Request resolved: https://github.com/facebook/react-native/pull/28482 Test Plan: run `yarn test` on a windows machine, and hit the test_windows circleci tests Reviewed By: hramos Differential Revision: D20799002 Pulled By: cpojer fbshipit-source-id: da3db0171c34a43199c7d3dc17b622b37bc91701 * Improve component stack parsing Summary: Update the error log message parsing to fix missing component stacks in console.errors. Changelog: [Internal] Reviewed By: cpojer Differential Revision: D20801985 fbshipit-source-id: ae544200315a8c3c0310e8370bc38b0546734f38 * Implement RCTWarn equivalent on Android Summary: ## Overview This diff is an RFC to port a logging feature from iOS to Android. Changelog: [Internal] ## Motivation On iOS we have the following log functions and behaviors available for logging native warnings and errors: - **Warnings** (`RCTLogWarn`) - Log level 'warn' to console - Display warning in LogBox - **Errors** (`RCTLogError`) - Log level 'error' to console - Display a native RedBox (needs converted to show a LogBox if available) - **Logs** - We also have `RCTLog`, `RCTTrace`, `RCTAdvice`, `RCTInfo`, which just log to the console. In Java, we have: - **Warnings** - **None**, added in this diff - **Errors** (`DevSupportManager.showNewJavaError`) - Log level 'error' to console with `FLog.e` - Display a native RedBox (needs converted to show a LogBox if available - **Logs** - `ReactSoftException` (crashes the app??) - `ReactNoCrashSoftException` (only logs??) - Others? ## Details This diff adds a method to pair with `RCTLogWarn`, `DevSupportManager.showNewJavaWarning`, which will log to the console and show a LogBox warning if LogBox is available. ## Concerns I have a few concerns/questions about the state of logging on Android: - Should/can we move all of the logging to it's own class, like how RCTLog works? - Why does some logging happen on DevSupportManager and some in other classes? - If we moved it all to it's own class, how could we access the reactContext to call the RCTLog JS module Reviewed By: JoshuaGross Differential Revision: D20056394 fbshipit-source-id: 32d57e300685e46da8039fc77cb22b4084acf81a * Remove unused feature flag: useMapNativeAccessor Summary: useMapNativeAccessor isn't being used anywhere. Changelog: [Internal] Removing unused internal feature flags: mUseMapNativeAccessor and mUseArrayNativeAccessor Reviewed By: mdvacca Differential Revision: D20788147 fbshipit-source-id: bf670508326813602cb544f86d3d2164651d3394 * Remove unused Feature Flag: lazilyLoadViewManagers Summary: Remove unused feature flag. This is not used within Facebook and I'm not aware of usage outside of FB. Changelog: [Removed] Removing Android feature flag: lazilyLoadViewManagers Reviewed By: mdvacca Differential Revision: D20788210 fbshipit-source-id: 435316e3de7830d7cb7f14537351883e4fc6eeaa * Remove unused feature flag: enableExtraWebViewLogs Summary: Hard-coded to false everywhere, and write-only. We never read from this. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20788252 fbshipit-source-id: ae117ebc51db7045947b9713602527ff4220833e * Remove unused feature flag: logDroppedViews Summary: Remove unused internal feature flag, logDroppedViews. Changelog: [Internal] Reviewed By: lunaleaps Differential Revision: D20797353 fbshipit-source-id: 1bfea7fcce9e80cdb92cda59a89c7dd817d4a581 * Split loadApplicationScript into initializeRuntime and loadBundle (#27844) Summary: This is the first of three PRs related to enabling multi-bundle support in React Native. More details, motivation and reasoning behind it can be found in RFC [here](https://github.com/react-native-community/discussions-and-proposals/issues/152). Logic responsible for installing globals was pulled out from `loadApplicationScript` to `initializeRuntime` since it should be ran only once, what was left was renamed to `loadBundle`. It's based on dratwas work from [here](https://github.com/callstack/react-native/tree/feat/multibundle/split-load-application), but applied to current `master` to avoid rebasing 3-months old branch and issues that come with that. ## Changelog [Internal] [Changed] - split `loadApplicationScript` into `initializeRuntime` and `loadBundle` to enable multi-bundle support in the future Pull Request resolved: https://github.com/facebook/react-native/pull/27844 Test Plan: Initialized new RN app with CLI, set RN to build from source and verified the still app builds and runs OK using code from this branch. Reviewed By: rickhanlonii Differential Revision: D19888605 Pulled By: ejanzer fbshipit-source-id: 24ace48ffe8978796591fe7c6cf53a61b127cce6 * Back out "Fix controlled TextInput with child nodes" Summary: Changelog: [Internal] Original commit changeset: 1b8a2efabbfa Original diff D20587681 breaks non-controlled text input. Reviewed By: motiz88 Differential Revision: D20815935 fbshipit-source-id: 70577ed1e5701850ff0e30a6592945a31c2a8bec * Fixed crash in JSIExecutor::NativeModuleProxy Summary: JSIExecutor::NativeModuleProxy is an object created by JSIExecutor and essentially representing that in JavaScript world. Before this change, JSIExecutor::NativeModuleProxy had a raw reference to JSIExecutor which (I believe) caused a crash because JSIExecutor can be deallocated before JSIExecutor::NativeModuleProxy. Now, instead of storing a pointer to JSIExecutor, we store a weak pointer to JSINativeModules which we can safely validate before calling on it. Changelog: [Internal] Fixed crash in JSIExecutor Now the configuration looks like this: ``` + - - - - - - - - - - - - - - - - - - - - - Something else | | shared_ptr<jsi::Runtime> runtime --+ | | + - - - - - - - - - - - - - - - - - - - - - | | | +------------------------------------------+ | | | | | JSExecutorFactory | | +--------------------------------+-------------------------------+ | | +-----------------------+ | | | +------------------------------------------+ | | v | | | +------------------------------------------+ | +--------------------------+ | | | | | | | | ModuleRegistry | | v | | | | | +------------------------------------------+ | | +------------------------------------------+ | | HermesRuntimeImpl | | | | | | (jsi::Runtime) |--+ | | +->+------------------------------------------+ | | | | | | | |std::unordered_map<std::string, size_t> | | +------------------------------------------+ | | | | |modulesByName_ | | | | | | | | | | | | | +------------------------------------------+ | | | | +->+------------------------------------------+ | +-----------------------+ | | |std::vector<std::unique_ptr<NativeModule>>| | | | | |modules_ | | | | | | | | v | | +------------------------------------------+ | +------------------------------------------+ | | | | | | | | | JSIExecutor::NativeModuleProxy | | | | | | | | | +------------------------------------------+ | | | +------------------------------------------+ | | | | | | +->+------------------------------------------+ | | | | NativeToJsBridge | |shared_ptr<JSINativeModules> | | | | | | |nativeModules_ | | | | +------------------------------------------+ +------------------------------------------+--+-----+------------------------------------+ | | | | | | +->+------------------------------------------+ | | | | | |unique_ptr<JSExecutor> | | | | | | |m_executor | | | | | | |(`::destroy()` resets it.) | | | | | | +------------------------------------------+--------------------------------+ | | | | +->+------------------------------------------+ | | | | | | |shared_ptr<JsToNativeBridge> | | | | | | | |m_delegate | | | | | | | +------------------------------------------+--+ v | | | | +->+------------------------------------------+ | +------------------------------------------+ | | | | |shared_ptr<MessageQueueThread> | | | | | | | | |m_executorMessageQueueThread | | | HermesExecutor: JSIExecutor: JSExecutor | | | | | +------------------------------------------+ | | | | | | | | +------------------------------------------+ | | | | | | | | | | | +->+------------------------------------------+ | | | | | | |shared_ptr<jsi::Runtime> | | | | | | | |runtime_ | | | | | | | +------------------------------------------+--+ | | | | +->+------------------------------------------+ | | | | | |shared_ptr<JSINativeModules> | | | | | | |nativeModules_ | | | | | | +------------------------------------------+--------+------------------------------------+ | +--------------------------+ +->+------------------------------------------+ | | | | |std::shared_ptr<ExecutorDelegate> | | v | | |delegate_ | | +------------------------------------------+ | | +------------------------------------------+--+ | | | | | | | | JSINativeModules | | | | | | | | | | | +------------------------------------------+ | | | | | | | | | +-->+------------------------------------------+ | +-----------------------------------------------------------------------------------+ | |m_moduleRegistry | | | | |(shared_ptr) | | | | +------------------------------------------+--+ | | | | v | +------------------------------------------+ | | | | | JsToNativeBridge: ExecutorDelegate | | | | | +------------------------------------------+ | | | +->+------------------------------------------+ | |shared_ptr<ModuleRegistry> | | |m_registry | | +------------------------------------------+-----------------------------------------------------------------+ ``` Reviewed By: RSNara Differential Revision: D20817257 fbshipit-source-id: 9ae378dbe880aaabfef7ae783dae2f94ee4b0af5 * Fix crash caused by <Modal> trying to present view controller twice Summary: Changelog: [Internal] `_viewController` was being presented twice causing following exception ``` 'Application tried to present modally an active controller <FBReactRootViewController: 0x7fe741818b80; ``` Reviewed By: shergin Differential Revision: D20820395 fbshipit-source-id: 5c9489011e5f99d8bd37befbd544d2d55a650589 * Loosen up restrictions for internal changelogs (#28486) Summary: Do not nag on PRs that contain internal changelogs (meaning, the change doesn't need to be called out in release notes). ## Changelog [Internal] - This should be acceptable. Pull Request resolved: https://github.com/facebook/react-native/pull/28486 Test Plan: See PR. Reviewed By: cpojer Differential Revision: D20817454 Pulled By: hramos fbshipit-source-id: a7082c4db05ec53ad27349db7e5bce2cfffd6930 * Fix TextInlineViews when UIImplementation processes two roots at the same time Summary: This diff cleans the variable NativeViewHierarchyOptimizer.mTagsWithLayoutVisited right after all the view updates for a rootShadowNode have been processed by the UIImplementation class. This intends to fix the bug reported in the task: T61185028, which root cause seems related to the fact that the variable NativeViewHierarchyOptimizer.mTagsWithLayoutVisited is not cleaned up when updating multiple rootShadowNodes as part of the same batch changelog: [Android][internal] internal bug fix Reviewed By: JoshuaGross Differential Revision: D20812921 fbshipit-source-id: 28067ee29a931d7a9e9c33c90aceb4e3512dac1a * Add a React Feature Flag to control TextInlineView fix Summary: This diff adds a temporary Feature Flag to control a fix in TextInlineView (see previous diffs of the stack) changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D20812920 fbshipit-source-id: 90fece9b29ba173546d96e4d9baf1ccabb3031b2 * Pass native CallInvoker to ObjCTurboModule constructor Summary: This is necessary to integrate TurboModule async method dispatch with the bridge's `onBatchComplete` event. See D20717931 for more details. This diff is similar to D20480971. **Note:** This stack doesn't really make any functional changes, since the native CallInvoker is `nullptr` right now. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809199 fbshipit-source-id: bf465a3a51bdddb8b56d1e696ca510fdf071f9ec * Manual changes required to make ObjCTurboModule accept native CallInvoker Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809200 fbshipit-source-id: d540eec9a3360a031f75d76a6ab9fb15303f8af5 * Codemod all getTurboModuleWithJsInvoker methods to accept a native CallInvoker Summary: To make iOS TurboModules integrate with the bridge's onBatchComplete event, they need to use a native CallInvoker. This call invoker is created by the `NativeToJsBridge`, and ObjCTurboModule will use this native CallInvoker to dispatch TurboModule method calls. This diff makes sure that ObjCTurboModules are created with that native CallInvoker. ## Script ``` var withSpaces = (...args) => args.join('\s*') var regexString = withSpaces( '-', '\(', 'std::shared_ptr', '<', '(?<turboModuleClass>(facebook::react::|react::|::|)TurboModule)', '>', '\)', 'getTurboModuleWithJsInvoker', ':', '\(', 'std::shared_ptr', '<', '(?<callInvokerClass>(facebook::react::|react::|::|)CallInvoker)', '>', '\)', '(?<jsInvokerInstance>[A-Za-z0-9]+)', 'perfLogger', ':', '\(', 'id', '<', 'RCTTurboModulePerformanceLogger', '>', '\)', '(?<perfLoggerInstance>[A-Za-z0-9]+)', '{', 'return', 'std::make_shared', '<', '(?<specName>(facebook::react::|react::|::|)Native[%A-Za-z0-9]+SpecJSI)', '>', '\(', 'self', ',', '\k<jsInvokerInstance>', ',', '\k<perfLoggerInstance>', '\)', ';', '}', ) var replaceString = `- (std::shared_ptr<$<turboModuleClass>>) getTurboModuleWithJsInvoker:(std::shared_ptr<$<callInvokerClass>>)$<jsInvokerInstance> nativeInvoker:(std::shared_ptr<$<callInvokerClass>>)nativeInvoker perfLogger:(id<RCTTurboModulePerformanceLogger>)$<perfLoggerInstance> { return std::make_shared<$<specName>>(self, $<jsInvokerInstance>, nativeInvoker, $<perfLoggerInstance>); }` const exec = require('../lib/exec'); const abspath = require('../lib/abspath'); const relpath = require('../lib/relpath'); const readFile = (filename) => require('fs').readFileSync(filename, 'utf8'); const writeFile = (filename, content) => require('fs').writeFileSync(filename, content); function main() { const tmFiles = exec('cd ~/fbsource && xbgs -n 10000 -l getTurboModuleWithJsInvoker:').split('\n').filter(Boolean); tmFiles .filter((filename) => !filename.includes('microsoft-fork-of-react-native')) .map(abspath) .forEach((filename) => { const source = readFile(filename); const newSource = source.replace(new RegExp(regexString, 'g'), replaceString); if (source == newSource) { console.log(relpath(filename)); } writeFile(filename, newSource); }); } if (!module.parent) { main(); } ``` Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809202 fbshipit-source-id: 5d39b3cacdaa5681b70ce1803351d0432dd74550 * Make RCTTurboModuleManagerDelegate getTurboModule accept native CallInvoker and PerfLogger Summary: Might be worthwhile to just kill this method instead, since we're having all NativeModules provide their TurboModule jsi::HostObjects. But I'll leave that decision to a later time. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809201 fbshipit-source-id: ee73d4b5454a76460832a54f9b864841e5b2b9c0 * eslint-config: add version badge and add homepage for eslint-config (#28506) Summary: Add version badge to README of eslint-config, and add specific url for the homepage so people looking at the npm package can find out where the package is from. ## Changelog [Internal] [Changed] - Add version badge to README of eslint-config Pull Request resolved: https://github.com/facebook/react-native/pull/28506 Test Plan: Not required as the only changes are made in README and homepage prop of package.json Differential Revision: D20837085 Pulled By: cpojer fbshipit-source-id: 820d3b44b069780ec8764c6152d2e7fd5220933c * Rename Instance::getNativeCallinvoker to Instance::getDecoratedNativeCallInvoker Summary: Now, instead of accepting a `std::function` that schedules work, and returning a `CallInvoker`, `Instance::getDecoratedNativeCallInvoker` will accept a `CallInvoker` that schedules work, and return a decorated `CallInvoker`. I think this change will help with readability. It also clarifies that the bridge is adding additional behaviour to the native `CallInvoker`. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20826885 fbshipit-source-id: a2c5681d10a4544ee3d2a0d1f1cbd386ef06d0e6 * Add CallInvoker::invokeSync Summary: We'll be using a native CallInvoker to dispatch sync and async method calls to ObjC NativeModules. This native CallInvoker will hold a reference to the ObjC NativeModule's method queue. **Why is the native CallInvoker required for ObjC NativeModules?** In the case where the ObjC NativeModule neither provides nor requests a method queue, we must create a method queue for it. When we go to invoke a method from JS, for these NativeModules specifically, there is no way to access this method queue. A native CallInvoker is a convenient abstraction that holds on to that method queue. For async calls, we'll just call `CallInvoker::invokeAsync`, and for sync calls, we'll just call `CallInvoker::invokeSync`. **Why do we need sync call support for native `CallInvoker`?** In ObjC, sync NativeModule method calls block the JS thread, then execute synchronously on the NativeModule's method queue, and then unblock the JS thread. This is what'll be implemented by `CallInvoker::invokeSync`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20829955 fbshipit-source-id: efb9d5408a1ade81069a943c865f232d4d10acfe * Export Instance::getDecoratedNativeCallInvoker from RCTCxxBridge Summary: `RCTTurboModuleManager` will create a native `CallInvoker` for each ObjC NativeModule. This `CallInvoker` will be used to dispatch calls from JS to native. Before passing the native `CallInvoker` to the `ObjCTurboModule`, it'll first use `RCTCxxBridge decorateNativeCallInvoker` to get a bridge-aware decorated native `CallInvoker`. That way, the bridge remains informed about async TurboModule method calls that took place since the last time it was flushed. This ensures that we don't end up dispatching `onBatchComplete` any less with TurboModules on than we do with TurboModules off. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20831546 fbshipit-source-id: b2eb4e0097e0dabf8c4bd8fdc4c850a0858af699 * Add Author Feedback label automatically (#28484) Summary: Improve issue triage by automatically adding the "Needs: Author Feedback" label. NOTE: The old label-actions app should be disabled when this PR is merged: https://github.com/apps/label-actions/installations/7445225 ## Changelog [Internal] - Issue Triage Pull Request resolved: https://github.com/facebook/react-native/pull/28484 Test Plan: Verified the same `label-actions.yml` and workflow config on a private repo. Reviewed By: cpojer Differential Revision: D20817443 Pulled By: hramos fbshipit-source-id: 39732dd67509c9fb9cf6ff7306913f5ec088266d * docs: add README and specify file in package.json (#28507) Summary: Adding a README for `react-native-codegen` since the package was published. Also added a `files` prop in package.json so unused file won't be included in the package. ## Changelog [Internal] [Changed] - Add README for react-native-codegen. Pull Request resolved: https://github.com/facebook/react-native/pull/28507 Test Plan: verify js files to function correctly without including files other than `src` Reviewed By: rickhanlonii Differential Revision: D20836113 Pulled By: cpojer fbshipit-source-id: e860f14760e9c1dbe121f5fb95ccf72d4ddb2af1 * Make the link easier to copy. (#28516) Summary: Making a PR from GitHub, I need to copy-paste the link, and it would be easier to just triple-click a line with the URL rather than carefully selecting the URL from the text. <img width="723" alt="Screen Shot 2020-04-03 at 17 33 47" src="https://user-images.githubusercontent.com/100233/78378550-6c12af80-75d1-11ea-93a4-2eae568ce602.png"> ## Changelog [General] [Changed] - Make PR template easier to use with changelog URL. Pull Request resolved: https://github.com/facebook/react-native/pull/28516 Reviewed By: fkgozali Differential Revision: D20842238 Pulled By: hramos fbshipit-source-id: 3fef7a994f36a996bbbc52556600d468a56210a9 * Upgrade tests to Xcode 11.3.1 (#28498) Summary: Upgrade Sandcastle and Circle CI tests to use Xcode 11.3.1 across the board. Pull Request resolved: https://github.com/facebook/react-native/pull/28498 Pull Request resolved: https://github.com/facebook/react-native/pull/28501 Changelog: [Internal] - Use Xcode 11.3.1 in iOS tests Reviewed By: fkgozali Differential Revision: D20821844 fbshipit-source-id: b250ca82bdf2c9fb7faa765d3e2433eb46efd692 * Fixes iOS reload through metro "r" command key (#28477) Summary: This allows the iOS device to be reloaded through the metro command line, besides the fact that whenever packagerServerHost is called, it will only get the IP address once when debugging. ## Changelog [iOS] [Fixed] - Fixed connection of metro reload command to iOS device Pull Request resolved: https://github.com/facebook/react-native/pull/28477 Test Plan: - Build any react-native project in debug mode to an iOS device connected through USB - Press the “r” key on the terminal that is running metro - The device should now reload the project Reviewed By: cpojer Differential Revision: D20818462 Pulled By: TheSavior fbshipit-source-id: 6d9792447d205223dad8fbd955518885427cbba8 * Create method queues for NativeModules that neither provide nor request one Summary: ## Problem: Let `A` be the set of all ObjC NativeModules that neither provide nor reqeust a method queue. The TurboModule system dispatches all method calls to NativeModules in `A` synchronously to the JS thread. Here is the relevant logic: **RCTTurboModule.mm:** Link: https://fburl.com/diffusion/nz9gqje8 ``` jsi::Value performMethodInvocation( // ... ) { // ... dispatch_queue_t methodQueue = NULL; if ([instance_ conformsToProtocol:protocol(RCTBridgeModule)] && [instance_ respondsToSelector:selector(methodQueue)]) { methodQueue = [instance_ performSelector:selector(methodQueue)]; } if (methodQueue == NULL || methodQueue == RCTJSThread) { // This is the default mode of execution: on JS thread. block(); } else if (methodQueue == dispatch_get_main_queue()) { ``` **Why does this end up happening?** 1. NativeModules that request a method queue have `synthesize methodQueue = _methodQueue` in their `implementation` section. This generates a `methodQueue` getter for the NativeModule, and also creates an ivar to back that getter. The TurboModule system generates a `dispatch_queue_t` and uses ObjC's KVC API to write to the ivar. So in the above logic, for NativeModules that provide a method queue, methodQueue will neither be `NULL` nor `RCTJSThread`, so we don't dispatch synchronously to the JS thread. 2. NativeModules that provide a method queue will return something that is not `NULL` or something that is `RCTJSThread`. If they return `NULL`, the infra will throw an error early. If they return `RCTJSThread`, we'll dispatch synchronously to the JS thread, as we should (...wait. For async NativeModule methods that dispatch to `RCTJSThread`, should we dispatch asynchronously to the JS thread, via jsInvoker? **Edit:** Nope: https://fburl.com/diffusion/ivt9b40s.). In all other cases, we dispatch to appropriately to the respective method queue. 3. For NativeModules that neither provide nor request a method queue (i.e: NativeModules in `A`), they don't implement the `methodQueue` selector. Therefore, we dispatch synchronously to the JS thread. ## The fix (Part 1): The first step towards fixing this problem is to generate `dispatch_queue_t`s for NativeModules in `A`. That's what this diff accomplishes. Changelog: [iOS][Fixed] - Create method queue for NativeModules that don't provide nor request one. Reviewed By: fkgozali Differential Revision: D20821054 fbshipit-source-id: 17a73550ad96766c5c7e719e28e1cc879e36465c * Rename duplicate name `<ScrollView>` example on RNTester (#28515) Summary: Tiny change. When searching for `scro` in the RNTester, two `<ScrollView>`s come up, from different example files. One is the "simple" one and the other is the "regular" one. Before: <img width="370" alt="Screen Shot 2020-04-03 at 17 14 01" src="https://user-images.githubusercontent.com/100233/78377338-c6ab0c00-75cf-11ea-9c45-2dcdd6460f6d.png"> After: <img width="369" alt="Screen Shot 2020-04-03 at 17 13 38" src="https://user-images.githubusercontent.com/100233/78377371-cf034700-75cf-11ea-89ea-aa3ff2f3988c.png"> ## Changelog [Internal] [Changed] - Rename the "simple" ScrollView example in RNTester to "ScrollSimpleView". Pull Request resolved: https://github.com/facebook/react-native/pull/28515 Test Plan: - Try to search for `scro` in RNTester. Reviewed By: fkgozali Differential Revision: D20842264 Pulled By: hramos fbshipit-source-id: 3db54a826ae774108e62690e7f154e85b541520f * Fix Fabric SSTs, so they actually run in Fabric instead of Paper, convert ServerSnapshotTestsAppImpl to functional component Summary: Update instrumentation test infra for Fabric tests. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D19961919 fbshipit-source-id: 17264b6308712dddece730effd57832817e148cf * Fixed scrollview inset when RN view is embedded in another view (#27607) Summary: I'm using RNN, which embeds RN view inside native view controllers. On iOS 13, a modal view controller is "floating" and is offset from the top of the screen. This causes the calculation of inset in `KeyboardAvoidingView` incorrect as it mixes local view controller coordinate space, with keyboard's screen coordinate space. ## Changelog [iOS] [Fixed] - Fixed `KeyboardAvoidingView` inset in embedded views (i.e modal view controllers on iOS 13) Pull Request resolved: https://github.com/facebook/react-native/pull/27607 Test Plan: 1. Tested before and after in a simple view controller (should stay the same) 2. Tested before and after in a modal view controller (should be offset before, and fixed after) 3. Repeated no. 2 with each device rotation (upsideDown, landscapeLeft, landscapeRight) Reviewed By: cpojer Differential Revision: D20812231 Pulled By: TheSavior fbshipit-source-id: fbd72739fb7152655028730e284ad26ff4a5da73 * Bump react-native-codegen to 0.0.2 Summary: Changelog: [Internal] Reviewed By: cpojer Differential Revision: D20843514 fbshipit-source-id: c611bf91d311c6ce8a7e469d267a0417b2ee58e5 * Rename ScrollViewSimpleExample Summary: Changelog: [Internal] - Rename ScrollViewSimpleExample in RNTester Reviewed By: fkgozali Differential Revision: D20846977 fbshipit-source-id: 397589cb0a17beaf37a25b91ad8efa4a2bc62358 * Remove console warnings for innerViewNode/Ref Summary: Remove these warnings until the methods in ScrollResponder have been moved into ScrollView, so that unactionable warnings aren't firing. Changelog: [General][Removed] Remove console warnings for innerViewNode/Ref in ScrollView Reviewed By: TheSavior Differential Revision: D20850624 fbshipit-source-id: ce90988e204c3cc3b93536842ec3caa12cf6994e * Make TurboModules dispatch method calls via native CallInvoker Summary: This diff: 1. Has ObjC NativeModules use the native `CallInvoker` to invoke JS -> native sync/async calls. 2. Integrates the native `CallInvoker` for each ObjC NativeModule with the bridge. This way, the bridge is informed of all JS -> native TurboModule method calls, and dispatches `onBatchComplete` appropriately. Changelog: [iOS][Fixed] Integrate ObjC TurboModules async method calls with the bridge Reviewed By: fkgozali Differential Revision: D20831545 fbshipit-source-id: da1cbb4ecef4cae85841ca7ef625ab8e380760cd * add ripple config object to Pressable (#28156) Summary: Motivation is to support ripple radius just like in TouchableNativeFeedback, plus borderless attribute. See https://github.com/facebook/react-native/pull/28009#issuecomment-589489520 In the current form this means user needs to pass an `android_ripple` prop which is an object of this shape: ``` export type RippleConfig = {| color?: ?ColorValue, borderless?: ?boolean, radius?: ?number, |}; ``` Do we want to add methods that would create such config objects - https://facebook.github.io/react-native/docs/touchablenativefeedback#methods ? ## Changelog [Android] [Added] - support borderless and custom ripple radius on Pressable Pull Request resolved: https://github.com/facebook/react-native/pull/28156 Test Plan: Tested locally in RNTester. I noticed that when some content is rendered after the touchables, the ripple effect is "cut off" by the boundaries of the next view. This is not specific to Pressable, it happens to TouchableNativeFeedback too but I just didn't notice it before in https://github.com/facebook/react-native/pull/28009. As it is an issue of its own, I didn't investigate that. ![pressable](https://user-images.githubusercontent.com/1566403/75098762-785f2200-55ba-11ea-8842-e648317610e3.gif) I changed the Touchable example slightly too (I just moved the "custom ripple radius" up to show the "cutting off" issue), so just for completeness: ![touchable](https://user-images.githubusercontent.com/1566403/75098763-81e88a00-55ba-11ea-9528-e0343d1e054b.gif) Reviewed By: yungsters Differential Revision: D20071021 Pulled By: TheSavior fbshipit-source-id: cb553030934205a52dd50a2a8c8a20da6100e23f * Make TurboModule creation thread-safe Summary: NativeModules can be created from any number of threads. In the legacy system, `ModuleHolder`, the class responsible for creating NativeModules, has built-in concurrency control to ensure that NativeModule creation is thread-safe. This diff introduces that thread-safety to the TurboModule infra. Basically, after this diff, if `n` threads race to create a TurboModule x, only the first thread will create x. All other threads will wait until x is created. Changelog: [Android][Fixed] - Make TurboModule creation thread-safe Reviewed By: mdvacca Differential Revision: D20659799 fbshipit-source-id: 2b720fe1ea49e40ae0d6dae50d422f23a6f45520 * Remove unused fields from error dialog Summary: Removed in https://github.com/facebook/react/pull/18487 Changelog: [React Core] Logging changes Reviewed By: gaearon Differential Revision: D20853086 fbshipit-source-id: 4b0002f21269f415769a2ac8305ba5750245f7d1 * Fix crash when enabling Performance Monitor on iOS 13.4 (#28512) Summary: This PR fixes a crash when opening the Performance Monitor on iOS 13.4. Detailed info: https://github.com/facebook/react-native/issues/28414 ## Changelog `[iOS] [Fixed] - Fix crash when enabling Performance Monitor on iOS 13.4` ## How This PR prevents the JavaScriptCore option from being set altogether. This ensures that the performance monitor keeps working, but on iOS 13.4 and higher, it will no longer crash trying to show the GC usage. Pull Request resolved: https://github.com/facebook/react-native/pull/28512 Test Plan: Tested on iOS 13.4 (simulator): ![image](https://user-images.githubusercontent.com/6184593/77903803-c6370c00-7283-11ea-8b71-b6b6546c82f6.png) Tested on iOS 13.1 (simulator) ![image](https://user-images.githubusercontent.com/6184593/77903499-41e48900-7283-11ea-9d14-83f67a3b7b77.png) - Verified that the `setOption` was called, but the Performance Monitor didn't show any GC usage regardless. - Identical PR https://github.com/expo/react-native/pull/21 has been shipped and tested in Expo Client 37 Fixes https://github.com/facebook/react-native/issues/28414 Reviewed By: PeteTheHeat Differential Revision: D20851131 Pulled By: TheSavior fbshipit-source-id: ff96301036e8487db59f95947bbe6841fe230e1e * Modify warning message (#28514) Summary: Modify deprecation warning message for `AccessibilityInfo.fetch` - https://reactnative.dev/docs/accessibilityinfo#isscreenreaderenabled - https://github.com/facebook/react-native/commit/523ab8333800afbfb169c6fd70ab6611fe07cc2a ## Changelog [Internal] [Changed] - Modify deprecation warning message for `AccessibilityInfo.fetch` Pull Request resolved: https://github.com/facebook/react-native/pull/28514 Test Plan: Try using `AccessibilityInfo.fetch` and check log Reviewed By: cpojer Differential Revision: D20850223 Pulled By: TheSavior fbshipit-source-id: e21bb20b7a02d9f2ed6e27e2bfecbac0aebf9e09 * Set _borderLayer.frame when border changes Summary: Changelog: [Internal] Setting `_borderLayer.frame` inside `-[RCTViewComponentView layoutSubviews]` causes unwanted animation because it is not wrapped in `CATransaction`. Moving it to `-[RCTViewComponentView updateLayoutMetrics]` which is called inside `CATransaction`. Reviewed By: shergin Differential Revision: D20836890 fbshipit-source-id: 2048a25fd2edb8109f6275c1186c0adae4b9f504 * Add API for getting sourceURL directly from ReactContext Summary: In bridgeless mode, the CatalystInstance doesn't exist, but we still need to be able to access the sourceURL in SourceCodeModule (which is needed to render the images in LogBox warnings and errors). This diff adds a new API for getting the sourceURL directly from ReactContext, instead of having to call context.getCatalystInstance().getSourceURL(), and updates SourceCodeModule to use it. Changelog: [Internal] Reviewed By: RSNara Differential Revision: D20848700 fbshipit-source-id: 3ecda81a17121178b76bbb3e9b0f27f103c1961a * imp: Remove unused `npx` reference (#28544) Summary: Recently we removed `npx` usage from `react-native-cli` flow. After checking usages in this repo I found unused reference. ## 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] [Removed] - Remove unused `npx` reference Pull Request resolved: https://github.com/facebook/react-native/pull/28544 Test Plan: Tests pass Reviewed By: cpojer Differential Revision: D20873090 Pulled By: hramos fbshipit-source-id: 12e05e9635a83f19439024766817e4599320af98 * Add debug logs to track down T62192299 exception source Summary: Add debug logs to track down T62192299 exception source Changelog: [Internal] Reviewed By: RSNara Differential Revision: D20878063 fbshipit-source-id: 94acd56c45d4b529a695d1b4d2bfd10d8f725e63 * Back out "Fixed scrollview inset when RN view is embedded in another view" Summary: Original commit changeset: fbd72739fb71 Changelog: Back out "[react-native][PR] Fixed scrollview inset when RN view is embedded in another view" Reviewed By: TheSavior Differential Revision: D20878607 fbshipit-source-id: 0d77b9fb08c637f7894c399a219a242e472b0700 * Fail silently in AppStateModule.sendEvent if CatalystInstance is not available Summary: According to our logs, 80% of these warnings are coming from AppStateModule. It's not particularly interesting or surprising that the CatalystInstance would be torn down when there's some app event, so let's stop taking up DB space with a useless message. Reviewed By: ejanzer, mdvacca Differential Revision: D20879426 fbshipit-source-id: b1182461aed4a66d82cb34bbd4b12782af6ed7b3 * Move DebugEnvironment helper to open source Summary: This is an internal only module that we use to detect whether we are in async debugging mode. Changelog: [Internal] Reviewed By: yungsters Differential Revision: D20879780 fbshipit-source-id: 5915f4e1c54a3fda0cf607c77f463120264fdbc4 * Fix Appearance module when using Chrome Debugger Summary: The appearance module uses sync native module methods which doesn't work with the chrome debugger. This broke in 0.62: https://github.com/facebook/react-native/issues/26705 This fix makes the appearance module return 'light' when using the chrome debugger. Changelog: [Fixed] Appearance `getColorScheme` no longer breaks the debugger Reviewed By: yungsters Differential Revision: D20879779 fbshipit-source-id: ad49c66226096433bc9f270e004ad4a6f54fa8c2 * Extend Android ImageViewManager to support analyticsTag prop Summary: This diff extends the Android Image View manager to support the new analyticsTag prop. this prop is going to be used to track performance for images in android changelog: [Android][Added] Add analyticsTag prop into ImageView component Reviewed By: JoshuaGross Differential Revision: D20880602 fbshipit-source-id: e302e8fa83706e6517b228d44a3094a1686830f7 * Extend Image.android to support analyticsTag prop Summary: Quick diff to extend Image.android component to support analytics tag prop changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D20880601 fbshipit-source-id: 99bc11f36ce46953c00480f7c8d628cf6c0a9263 * Create ImageContext object to allow udpating the analyticsTag prop for RN sections Summary: As part of this diff I create the new ImageContext object that will be used to allow the update of the analyticsTag prop for components that contain multiple images in their view hierarchy changelog: [JS][Added] Add ImageContext object, this object can be used to update the Imageview's analyticsTag prop on RN components that contain multiple images in their view hierarchy Reviewed By: JoshuaGross Differential Revision: D20880603 fbshipit-source-id: f2094bfd3ab1c867cf7c107e678a098aab7e94a8 * Ez cleanup in ImageProps Summary: Ez cleanup in ImageProps, this import is not being used anymore changelog: [internal] internal change Reviewed By: JoshuaGross Differential Revision: D20880600 fbshipit-source-id: 7d903b5a6e16c37e61dec661b6bd1f9a6b442cc3 * Exclude all FlipperKit transitive dependencies from iOS Release builds (#28504) Summary: The `:configuration` option from `pod` only affects the specified pod and not its dependencies [1]. Therefore in order to avoid all transitive dependencies being linked in the resulting Release IPA we need to list them in the `Podfile`. Note that this will still build Flipper's pods when doing a Release, but it won't link it in the resulting IPA. [1] https://guides.cocoapods.org/syntax/podfile.html#pod Fixes https://github.com/react-native-community/upgrade-support/issues/28 Related https://github.com/CocoaPods/CocoaPods/issues/9658 ## Changelog * [iOS] [Fixed] - Exclude Flipper from iOS Release builds Pull Request resolved: https://github.com/facebook/react-native/pull/28504 Test Plan: Create a new React Native 0.62 project, run `pod install`, then diff: ``` ProjectName/ios/Pods/Target Support Files/Pods-ProjectName/Pods-ProjectName.debug.xcconfig` ``` and ``` ProjectName/ios/Pods/Target Support Files/Pods-ProjectName/Pods-ProjectName.relaese.xcconfig ``` ![image](https://user-images.githubusercontent.com/855995/78337679-a3fa0280-7591-11ea-8142-6f82cbc6be58.png) Reviewed By: passy Differential Revision: D20894406 Pulled By: priteshrnandgaonkar fbshipit-source-id: 680780f0f5a85fd8423b85a271a499bd12f06d00 * Fix crash in FabricUIManager.onMeasure Summary: Changelog: [Internal] The cause of crash was `NullPointerException`, which happened because of `mReactContextForRootTag.get(rootTag)` returning `null`. This is solved by checking whether it returns `null` before passing it to `I18nUtil`. Reviewed By: mdvacca Differential Revision: D20890623 fbshipit-source-id: c884c6838b83b944a5438375a4c060c1f5b1dc6e * Fix flow types of ImageContext Summary: ez diff to Fix flow types of ImageContext changelog: [internal] internal change to update flow types of ImageContext Reviewed By: TheSavior Differential Revision: D20883647 fbshipit-source-id: 6dba83ab431e56a71f96c39005ebcccf39a7da9a * Avoid passing analyticsTag prop to native if this is set to null Summary: This diff avoids passing the analyticsTag prop to native if this is set to null changelog: [internal] internal optimization Reviewed By: TheSavior Differential Revision: D20904498 fbshipit-source-id: f1ea1e5aa3199ef073668df86ca7cf6e20f70c5b * Rename analyticsTag -> internal_analyticsTag in ImageView component Summary: This diff renames the analyticsTag prop for the intenral_analyticsTag in ImageView component changelog: [internal] Creation of internal_analyticTag prop in ImageView, for now this prop is meant to be used internally. Reviewed By: TheSavior Differential Revision: D20904497 fbshipit-source-id: 2a28f746772ee0f9d657ec71549020c1f3e9d674 * Make Vibration.vibrate compatible with TurboModules (#27951) Summary: This PR fixes a compatibility issue with the Vibration module and TurboModules. The TurboModules spec doesn't allow nullable arguments of type Number, causing the following problem: ![IMG_3758](https://user-images.githubusercontent.com/1247834/73803879-10be6f80-4790-11ea-92d4-a008f0007681.PNG) ## Changelog [iOS] [Fixed] - Make Vibration library compatible with TurboModules. Pull Request resolved: https://github.com/facebook/react-native/pull/27951 Test Plan: Just submitted a PR to my own app to fix the issue [here](https://github.com/rainbow-me/rainbow/pull/340) The problem should be reproducible on RNTester due to this line: https://github.com/facebook/react-native/blob/91f139b94118fe8db29728ea8ad855fc4a13f743/RNTester/js/examples/Vibration/VibrationExample.js#L66 and should be working on this branch. Reviewed By: TheSavior Differential Revision: D19761064 Pulled By: hramos fbshipit-source-id: 84f6b62a2734cc09d450e906b5866d4e9ce61124 * Fix Cocoapods builds Summary: ## Problem For some reason, D20831545 broke the `use_frameworks!` build of RNTester. ## Building RNTester ``` pushd ~/fbsource/xplat/js/react-native-github/RNTester && USE_FRAMEWORKS=1 pod install && open RNTesterPods.xcworkspace && popd; ``` ## Error I built RNTester locally, and the error was this: ``` Undefined symbols for architecture x86_64: "facebook::jsi::HostObject::set(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&, facebook::jsi::Value const&)", referenced from: vtable for facebook::react::ObjCTurboModule in RCTImageEditingManager.o vtable for facebook::react::ObjCTurboModule in RCTImageLoader.o vtable for facebook::react::ObjCTurboModule in RCTImageStoreManager.o "facebook::jsi::HostObject::getPropertyNames(facebook::jsi::Runtime&)", referenced from: vtable for facebook::react::ObjCTurboModule in RCTImageEditingManager.o vtable for facebook::react::ObjCTurboModule in RCTImageLoader.o vtable for facebook::react::ObjCTurboModule in RCTImageStoreManager.o ld: symbol(s) not found for architecture x86_64 ``` ## Fix It looked like libraries that depend on "ReactCommon/turbomodule/core" weren't linking to JSI correctly. So, I modified all such Podspecs to also depend on "React-jsi": ``` arc rfr ' s.dependency "ReactCommon/turbomodule/core", version' ' s.dependency "ReactCommon/turbomodule/core", version\n s.dependency "React-jsi", version' ``` This seemed to do the trick. In buck, we'd fix this problem using exported_dependencies. I skimmed through cocoapods, and couldn't find such a configuration option there. So, I guess this will have to do? Changelog: [iOS][Fixed] - Fix Cocoapods builds of RNTester Reviewed By: fkgozali, hramos Differential Revision: D20905465 fbshipit-source-id: 60218c8274ec165752a428f2a7a9a546607c8fec * Add minimumSize to RCTRootView & RCTRootShadowView Summary: This adds a `minimumSize` property to RCTRootView, and forwards any changes to it's shadow view. This **does not** change any default behaviour, as the default minimum size is `CGSizeZero` before & after this diff. Changelog: [iOS][Internal] Add minimumSize to RCTRootView & RCTRootShadowView Reviewed By: RSNara Differential Revision: D20905456 fbshipit-source-id: a03f880e782891f60ef86b9c898965e05a5e796e * Make RCTNativeAnimatedModule into a TurboModule Summary: D20831545 integrated TurboModules with the bridge's `onBatchComplete` event. This fixed the RCTNativeAnimatedModule jank, so I'm re-converting RCTNativeAnimatedModule into a TurboModule. Changelog: [iOS][Fixed] - Make RCTNativeAnimatedModule TM-compatible Reviewed By: PeteTheHeat Differential Revision: D20850744 fbshipit-source-id: bb85a1bb27963e7d39bf149d0a3d7b71c88175da * upgrade to flow 0.122.0 Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D20919782 fbshipit-source-id: 3d5dc54ea4daafb8a1d96cad6c35a2dab4c24097 * Switch order of onSelectionChange and onChange events send from native Summary: Changelog: [Internal] UIKit uses either `UITextField` or `UITextView` as its UIKit element for `<TextInput>`. `UITextField` is for single line entry, `UITextView` is for multiline entry. There is a problem with order of events when user types a character. In `UITextField` (single line text entry), typing a character first triggers `onChange` event and then `onSelectionChange`. JavaScript depends on this order of events because it uses `mostRecentEventCount` from this even to communicate to native that it is in sync with changes in native. In `UITextView` (multi line text entry), typing a character first triggers `onSelectionChange` and then `onChange`. As JS depends on the correct order of events, this can cause issues. An example would be a TextInput which changes contents based as a result of `onSelectionChange`. Those changes would be ignored as native will throw them away because JavaScript doesn't have the newest version. Reviewed By: JoshuaGross Differential Revision: D20836195 fbshipit-source-id: fbae3b6c0d388fc059ca2541ae980073b8e5f6c7 * Maintain selection and cursor location when setting string on TextInput Summary: Changelog: [Internal] Calling `_backedTextInputView.attributedText = attributedString` causes cursor to be moved to the end of text input. This applies to both, `UITextField` and `UITextView`. This is not desired as when JS sets a new text, we don't want the cursor to be moved to the end of text input. JS has the option to use view commands if it wishes to move cursor somewhere. Reviewed By: JoshuaGross Differential Revision: D20836201 fbshipit-source-id: 9234e54cfbc5fc206f723626988e505275788aae * Implement event count for TextInput Summary: Changelog: [Internal] Implementation of event count for Fabric's Text input. Reviewed By: JoshuaGross Differential Revision: D20800185 fbshipit-source-id: 988692cb2fc786649821cccb06e629b40b9b0479 * Migrate setNativeProps to commands in iOS text input Summary: Changelog: Move from setNativeProps to ViewCommands. Reviewed By: JoshuaGross Differential Revision: D20843018 fbshipit-source-id: 9be9d2bbee01f2e15279e3c3ae785c1a5b163765 * Update default Podfile to not depend on a path (#28572) Summary: Recently, a default Podfile has been modified to not contain all the React Native pods, but use a helper method `use_react_native!`. While this is great, it assumes a hardcoded path of `../node_modules/react-native` to be always the correct location of the React Native. https://github.com/facebook/react-native/blob/d4d8887b5018782eeb3f26efa85125e6bbff73e4/scripts/autolink-ios.rb#L7-L9 Unfortunately, due to the way Ruby works, this completely hides the path away from the users. Before, they could have seen the wrong path explicitly in a Podfile and knew to update it to resolve path-related issues. With the current version in `master`, I can see a lot of issues where developers wonder how to resolve the path issues and how to pass the path itself. https://github.com/facebook/react-native/blob/4118d798265341061105f3a53550db83c66a71cb/template/ios/Podfile#L5-L10 This PR uses React Native CLI configuration (that is already used to link 3rd party dependencies) to explicitly define the correct path to the React Native. As a result, we don't have to change the paths here whether we're running monorepo or not. ## Changelog [IOS] [INTERNAL] - Always provide an explicit path to React Native Pull Request resolved: https://github.com/facebook/react-native/pull/28572 Differential Revision: D20945194 Pulled By: TheSavior fbshipit-source-id: 010f9754f2ed78ef62fd52f4d201f296f5af6d27 * chore: update CLI * fix: do not throw on missing `cliPath`, use the default value (#28625) Summary: The `cliPath` has always been optional value and in fact, even had its default value hardcoded in the React gradle file. In this PR, I am just taking use of it and remove throwing an error, which is going to be a really annoying breaking change. ## Changelog [ANDROID] [INTERNAL] - Don't require `cliPath` Pull Request resolved: https://github.com/facebook/react-native/pull/28625 Test Plan: Run Android project, everything works. Provide custom `cliPath`, it gets respected Reviewed By: cpojer Differential Revision: D21044222 Pulled By: TheSavior fbshipit-source-id: 8029f988d92abb9f64f30e05932c0d407d0c997e * chore: remove Kotlin version from the default template * (eslint-config) update community eslint plugin in eslint config (#28642) Summary: Updating the community eslint-plugin used in the eslint-config to the latest version. expecting new eslint-config version to be released with this change so that it can be included in new project template for 0.63 https://github.com/react-native-community/releases/issues/186 ## 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] - Update community eslint plugin in the eslint config Pull Request resolved: https://github.com/facebook/react-native/pull/28642 Test Plan: yarn lint passes Differential Revision: D21048976 Pulled By: cpojer fbshipit-source-id: 2c3ec0ef450cf357d8c88db7873f4ca1154b2034 * [0.63.0-rc.0] Bump version numbers * Upgrade Hermes dependency to 0.5.0 Summary: Use the latest published release of hermes-engine. Update RN to invoke `hermesc` instead of `hermes`. Changelog: [Android] [Changed] - Upgraded to Hermes 0.5.0 allow-large-files Reviewed By: mhorowitz Differential Revision: D20998564 fbshipit-source-id: 4824e273bcb044029a5a7e9379f168d3da47da50 * Remove the post install step (#28651) Summary: Removes the post install step for Flipper, as the latest version of YogaKit is compatible with swift 5. cc alloy ## 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 --> [Flipper] [Template] - Remove the post install step for Flipper Pull Request resolved: https://github.com/facebook/react-native/pull/28651 Test Plan: Tested a newly created RN app without post install step and it built successfully. Reviewed By: passy Differential Revision: D21064653 Pulled By: priteshrnandgaonkar fbshipit-source-id: da56d0754d918e30a0ebe480c77590f0139d48ac * Allow iOS PlatformColor strings to be ObjC or Swift UIColor selectors (#28703) Summary: Per discussion in https://github.com/react-native-community/releases/issues/186 the iOS `PlatformColor()` function is documented to use the semantic color names provided by the system. The referenced HIG documentation itself links to the `UIColor` documentation for semantic colors names. However, these names differ depending on if you are viewing the new Swift API docs or the Objective C docs. The current Objective C implementation in react-native assumes Objective C UIColor selector names that are suffixed 'Color'. But in Swift, Apple provides a Swift Extension on UIColor that makes aliases without the the 'Color' suffix and then makes the original selectors invalid presumably via `NS_UNAVAILABLE_SWIFT`. Since both selector names are valid depending on if you are using Objective C or Swift, let's make both forms be legal for `PlatformColor()`. In `RCTConvert.m` there is a dictionary of legal selector names. The code already supports the ability to have names be aliases of other selectors via a RCTSelector metadata key. The change adds code to the initialization of the map: it iterates over the keys in the map, which are all ObjC style UIColor selectors, and creates aliases by duplicating the entries, creating key names by stripping off the ObjC "Color" suffix, adds the RCTSelector key referring to the original and then appends these new Swift aliases to the map. ## Changelog [iOS] [Changed] - Allow iOS PlatformColor strings to be ObjC or Swift UIColor selectors Pull Request resolved: https://github.com/facebook/react-native/pull/28703 Test Plan: The PlatformColorExample.js is updated to use the new, shorter Swift selector names. There are still other examples in the same file and in unit tests that exercise the ObjC selector names. <img width="492" alt="PlatformColor" src="https://user-images.githubusercontent.com/30053638/79809089-89ab7d00-8324-11ea-8a9d-120b92edeedf.png"> Reviewed By: shergin Differential Revision: D21147404 Pulled By: TheSavior fbshipit-source-id: 0273ec855e426b3a7ba97a87645859e05bcd4126 * Fix folly::dynamic crash when attaching a debugger to Hermes Summary: folly_futures was compiled with and exported -DFOLLY_MOBILE=1, while folly_json did not. This flag disables fancy F14 data structures for folly::dynamic in favor of a simple std::unordered_map. This caused inlined/templated code from modules depending on folly_futures to disagree with the implementations in folly_json, leading to a crash. The only such libraries were libhermes-inspector and (transitively) libhermes-executor-debug, and these only use folly::dynamic for CDP serialization, which is why the problem was not more apparent. Changelog: [Internal] Fix crash when attaching a Hermes debugger Reviewed By: mhorowitz Differential Revision: D21193307 fbshipit-source-id: 2b795bb6f4f7f991e2adaacec62d62616117322b * Update react.gradle (#28776) Summary: Running `./gradlew assembleRelease` fails as the path to the CLI contains a new line at the end. We don't run this command in `debug` mode, hence it passed the testing. My bad. Fixed, checked in both `debug` with `bundleInDebug: true` and `release`. Fixes https://github.com/facebook/react-native/issues/28700 ## Changelog [INTERNAL] [ANDROID] - Fix `React.gradle` to build Android apps in production Pull Request resolved: https://github.com/facebook/react-native/pull/28776 Test Plan: Running `./gradlew assembleRelease` works Reviewed By: hramos Differential Revision: D21287789 Pulled By: TheSavior fbshipit-source-id: dc3ec8eef7a919b072b562d2bd455e2f704bc083 * Revert D21064653: Remove the post install step Differential Revision: D21064653 Original commit changeset: da56d0754d91 fbshipit-source-id: 1086cfdeca9aa3830370ea115ba7b5f05d3fb124 * Bump @react-native-community/eslint-config in new app template Summary: Changelog: [Changed][General] Update react-native-community/eslint-config to 1.1.0, adding the new color rule Reviewed By: rickhanlonii Differential Revision: D21342153 fbshipit-source-id: ac1367353d4d3e69b6df29dc16f9fcb60cde3519 * [0.63.0-rc.1] Bump version numbers * Upgrade Flipper to 0.37.0 (#28545) Summary: Bump flipper to 0.37 for both iOS and Android [Android] [Changed] - Upgrade Flipper to 0.37.0 [iOS] [Changed] - Upgrade Flipper to 0.37.0 Pull Request resolved: https://github.com/facebook/react-native/pull/28545 Test Plan: RNTester build pass Reviewed By: rickhanlonii Differential Revision: D20930069 Pulled By: hramos fbshipit-source-id: a7cb719da3e51e6a42d27d5e64bc664398d0d3c5 * Enable with CocoaPods `:configuration` (#28796) Summary: ~~⚠️ Depends on https://github.com/facebook/flipper/pull/1086 and a new Flipper release.~~ Fixes https://github.com/facebook/react-native/commit/17f025bc26da13da795845a3f7daee65563420c0#commitcomment-38831234 Currently user’s are being told to add a definition of the `FB_SONARKIT_ENABLED` macro and examples, including those in stock React Native templates, set this for the user by making use of a `post_install` hook in the user’s `Podfile`. This leads to confusion, fragile code [when a user’s project dir structure deviates from vanilla], and is ultimately not necessary as CocoaPods already has dedicated mechanisms to: * specify build settings (through the `xcconfig` property); * and selectively include certain pods only in certain build configurations (e.g. debug). ## 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] [Changed] - Entirely control Flipper being enabled through inclusion in Podfile and optionally limiting to certain build configurations using the `:configuration` directive. Pull Request resolved: https://github.com/facebook/react-native/pull/28796 Test Plan: Tested using the changes of https://github.com/facebook/flipper/pull/1086 in a new app that uses RN `master`. Reviewed By: priteshrnandgaonkar Differential Revision: D21449754 Pulled By: passy fbshipit-source-id: 9ff7c7f4ffc32b364b1edd82b94e0b80c3997625 * Pressable: Rename pressRectOffset to pressRetentionOffset to be consistent with other touchables Summary: Text and the other Touchables have this prop called pressRetentionOffset. Pressable should be consistent with that. Changelog: [Breaking][General]: Pressable: Rename pressRectOffset to pressRetentionOffset to be consistent with other touchables Reviewed By: yungsters Differential Revision: D21552255 fbshipit-source-id: 31e64bad9e48ac98e4934dd2f4c0a7f526de5cb6 * iOS: Fix Animated image crash when CADisplayLink target in RCTWeakProxy is nil Summary: When self is nil, this may crash in RCTUIImageViewAnimated.m. ``` _displayLink = [CADisplayLink displayLinkWithTarget:[RCTWeakProxy weakProxyWithTarget:self] selector:selector(displayDidRefresh:)]; ``` Replace `RCTWeakProxy` with a concrete class `RCTDisplayWeakRefreshable` that has the displayDidRefresh method, that calls the displayDidRefresh method in its weak target. https://github.com/facebook/react-native/pull/28070#issuecomment-619295254 Changelog: [iOS] [Fixed] - Fix Animated image crash when CADisplayLink target in RCTWeakProxy is nil Reviewed By: shergin Differential Revision: D21419385 fbshipit-source-id: da7c3c38f81ea54f633da7f59359e07680ea2faf * Pressable: Add Support for Inspector Overlay Summary: Adds support for the debug overlay (enabled via the Inspector) that the legacy touchable components supported. Changelog: [General][Added] - Added Inspector overlay support for Pressable Reviewed By: TheSavior Differential Revision: D21614412 fbshipit-source-id: b884e04f8dba1bfd35e61de25d33d6d47bc34b03 * Changed iOS LaunchScreen from xib to storyboard (#28239) Summary: > Starting April 30, 2020, all apps submitted to the App Store must use an Xcode storyboard to provide the app’s launch screen and all iPhone apps must support all iPhone screens. Updated iOS Launch screen as per [App Store policy change](https://developer.apple.com/news/?id=03042020b). Community discussion: https://github.com/react-native-community/discussions-and-proposals/issues/209 ## Changelog Changed iOS Launch Screen from a `xib` to `storyboard`. The `LaunchScreen.xib` file has been replaced with `LaunchScreen.storyboard`. Xcode automatically picks up the new Launch Screen no additional change is required. [iOS] [Deleted] - Deleted LaunchScreen.xib [iOS] [Added] - Added LaunchScreen.storyboard Pull Request resolved: https://github.com/facebook/react-native/pull/28239 Test Plan: Build the Xcode project under `template/iOS` and verify that the new launch screen is identical to the previous one. Reviewed By: cpojer Differential Revision: D20408892 Pulled By: hramos fbshipit-source-id: 9c38df58d1304088a23f3d73e0fbd87675804f1a * Fix debugging on android for 0.63 (#29204) Summary: Currently on react native 0.63-rc.0 and 0.63-rc.1 enabling debugging throws an exception. It looks like something may have been missed in unregistering JSDevSupport in this commit c20963e ![crash](https://user-images.githubusercontent.com/14797029/85500252-2acae400-b5b1-11ea-938a-674b55e649b2.gif) This should fix https://github.com/facebook/react-native/issues/28746 and https://github.com/facebook/react-native/issues/29136 ## Changelog [Android] [Fixed] - Fix crash when enabling debug Pull Request resolved: https://github.com/facebook/react-native/pull/29204 Test Plan: To recreate the bug: npx react-native init RN063 --version 0.63.0-rc.1 react-native start react-native run-android Enable debug mode from react native dev menu After this commit, the crash no longer occurs ![non crash](https://user-images.githubusercontent.com/14797029/85500241-269ec680-b5b1-11ea-8cfe-85bfda4dd222.gif) Reviewed By: TheSavior Differential Revision: D22395406 Pulled By: RSNara fbshipit-source-id: 046df77ae1c1de96870fb46f409d59e7d6a68c0d * [0.63.0] Bump version numbers * Add ProGuard rule for hermes (#28571) Summary: This adds a ProGuard for `hermes` rule so it does not have to be added by users manually. https://github.com/facebook/react-native/issues/28270 ## 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 --> [Android] [Added] - ProGuard rule for hermes Pull Request resolved: https://github.com/facebook/react-native/pull/28571 Test Plan: 1. Create a project with/without hermes. 2. Enable proguard. Reviewed By: cpojer Differential Revision: D20947095 Pulled By: hramos fbshipit-source-id: 79b166ad2dd060f20041d9f5cfe2f794c754843d * Fix rounded border drawing when border-radius is smaller than border-width (#28358) Summary: This PR fixes the drawing of the border rounded edges when the border-radius is small than the border-width. The current implementation capped the possible border-radius making it impossible to set smaller border-radii when using thicker borders. After inspection it was found that the rounded-rect calculation is incorrect. ## Changelog `[Android] [Fixed] - Fix rounded border-drawing when border-radius is smaller than border-width` Pull Request resolved: https://github.com/facebook/react-native/pull/28358 Test Plan: **Faulty situation:** As you can see, when the border-radius becomes very low, the border is stuck at a minimum value. Only after setting the border-radius fully to 0 is it again rendered correctly. ![ezgif com-video-to-gif (2)](https://user-images.githubusercontent.com/6184593/77183540-c3435b00-6ace-11ea-950d-29a0ea1757bd.gif) **After the fix:** ![ezgif com-video-to-gif (3)](https://user-images.githubusercontent.com/6184593/77183619-e837ce00-6ace-11ea-93a5-910127d352b7.gif) Differential Revision: D21124739 Pulled By: shergin fbshipit-source-id: cefd1776b77b5b9fb335e95fd7fdd7f345579dc4 * Fix border-stroke drawing after resetting border-radius (#28356) Summary: This PR fixes incorrect drawing of the View borders on Android, after changing the border-radius back to 0 *(and when no background-color is defined)*. This happens because the `drawRoundedBackgroundWithBorders` function in ReactViewBackgroundDrawable changes the style on the Paint object to `STROKE`. This style is however never reverted back to `FILL`. This change ensures that the Paint style is set to `FILL` for the full execution of the `drawRectangularBackgroundWithBorders` function. ## Changelog `[Android] [Fixed] - Fix border-drawing when changing border-radius back to 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28356 Test Plan: **Faulty situation:** ![ezgif com-video-to-gif](https://user-images.githubusercontent.com/6184593/77153163-9759b280-6a99-11ea-82bb-33a1e0a4934c.gif) **After the fix:** ![ezgif com-video-to-gif (1)](https://user-images.githubusercontent.com/6184593/77153825-c91f4900-6a9a-11ea-8e0c-a4280b9e72b8.gif) Differential Revision: D21124741 Pulled By: shergin fbshipit-source-id: 2044f8e8ad59a58df42b64d7ee8c4ad1d3b562f1 * Fixes TextInput shaking when typing Chinese (#28805) Summary: Fixes https://github.com/facebook/react-native/issues/28488. ## Changelog [iOS] [Fixed] - Fixes TextInput shaking when typing Chinese Pull Request resolved: https://github.com/facebook/react-native/pull/28805 Test Plan: Demo see https://github.com/facebook/react-native/issues/28488. Differential Revision: D21376803 Pulled By: shergin fbshipit-source-id: b1fe6cc5f67d42ef98a6c12b8ab9990feac0e2a7 * Set black as default text color for <TextInput/> on iOS (#28708) Summary: This is a follow-up pull request to https://github.com/facebook/react-native/issues/28280 (reviewed by shergin). This pull request tried to solve the problem of the default color in a TextInput in dark mode on iOS being white instead of black. I got suggested to solve the problem not on the level of RCTTextAttributes, but on the level of RCTUITextField. Setting `self.textColor = [UIColor black];` in the constructor did not work, because it gets overwritten by nil in `RCTBaseTextInputView.m`. There I implemented the logic that if NSForegroundColorAttributeName color is nil then the color is being set to black. I think the `defaultTextAttributes` property confuses here, because it ends up being the effective text attributes, e.g. if I unconditionally set the default text color to black, it cannot be changed in React Native anymore. So I put the nil check in. ## Changelog [iOS] [Fixed] - TextInput color has the same default (#000) on iOS whether in light or dark mode Pull Request resolved: https://github.com/facebook/react-native/pull/28708 Test Plan: I have manually tested the following: - The default text color in light mode is black - The default text color in dark mode is black - The color can be changed using the `style.color` attribute - Setting the opacity to 0.5 results in the desired behavior, the whole TextInput becoming half the opacity. – Setting the `style.color` to rgba(0, 0, 0, 0.5) works as intended, creating a half-opaque text color. Differential Revision: D21186579 Pulled By: shergin fbshipit-source-id: ea6405ac6a0243c96677335169b214a2bb9ccc29 * Enable array buffers in JSCRuntime.cpp (#28961) Summary: The JavaScriptCore implementation of JSI [does not currently support array buffers](https://github.com/facebook/react-native/blob/master/ReactCommon/jsi/JSCRuntime.cpp#L925-L943). The comments in the code suggest the JSC version used by React Native does not work with array buffers, but this seems to be out of date since the current version of JSC used by React Native does indeed support array buffers. This change just enables array buffers in JSCRuntime.cpp. NOTE: See https://github.com/react-native-community/discussions-and-proposals/issues/91#issuecomment-632371219 for more background on this change. ## Changelog [General] [Added] - Support for array buffers in the JavaScriptCore implementation of JSI Pull Request resolved: https://github.com/facebook/react-native/pull/28961 Test Plan: To test these changes, I just made some temporary changes to RNTester to use JSI to inject a test function into the JS runtime that reads from and writes to an array buffer, and call that function from the JS of the RNTester app (see https://github.com/ryantrem/react-native/commit/28152ce3f4ae0fa906557415d106399b3f072118). For the JS side of this, specifically look at https://github.com/ryantrem/react-native/blob/28152ce3f4ae0fa906557415d106399b3f072118/RNTester/js/RNTesterApp.android.js#L13-L18 For the native side of this, specifically look at https://github.com/ryantrem/react-native/blob/28152ce3f4ae0fa906557415d106399b3f072118/RNTester/android/app/src/main/cpp/JSITest.cpp#L22-L38 Reviewed By: shergin Differential Revision: D21717995 Pulled By: tmikov fbshipit-source-id: 5788479bb33c24d01aa80fa7f509e0ff9dcefea6 * Fix font variant crash on Android < 4.4 (#29176) Summary: In RN 0.62 support for `fontVariant` was added on Android. Using that prop crashes the app on Android below KitKat (4.3 and below) To reproduce just add any Text with the `fontVariant` styling prop in the app: ```js <Text style={{fontVariant: ['tabular-nums']}}>This will crash</Text> ``` It will crash any device running Android below KitKat with the error: ![image](https://user-images.githubusercontent.com/4534323/85073452-18206b80-b1bb-11ea-8d7e-96f27fa1a320.png) This is caused by `java.utils.Objects` only being available on Android 4.4+ ## Changelog [Android] [Fixed] - Fix font variant crash on Android < 4.4 Pull Request resolved: https://github.com/facebook/react-native/pull/29176 Test Plan: [TextUtils.equals](https://developer.android.com/reference/android/text/TextUtils#equals) was added as soon as API level 1, so no compatibility issue here. Tested on Emulator running Android 4.1, no crash anymore. I've searched for other occurences of `java.utils.Objects` in the project, and this was the only one, so no need to remove other occurences ✅ Reviewed By: JoshuaGross Differential Revision: D22337316 Pulled By: mdvacca fbshipit-source-id: 5507b21b237a725d596d47b5c01e269895b16d4a * Fix LogBox.ignoreAllLogs used with no argument (#29310) Summary: When you call `LogBox.ignoreAllLogs()` it should ignore logs. This fixes a bug that made this equivalent to `LogBox.ignoreAllLogs(false)` ## Changelog [General] [Fixed] - LogBox.ignoreAllLogs() should ignore logs Pull Request resolved: https://github.com/facebook/react-native/pull/29310 Test Plan: Added tests Reviewed By: TheSavior Differential Revision: D22448436 Pulled By: rickhanlonii fbshipit-source-id: 6ba12b9d9c1f29cf3ac503946ac5ca0097425a7a * Pressable: Minimum Press Duration Summary: When a `Pressable` has a configured (or the default) `delayPressIn` and no (or the default) `delayPressOut`, tapping very quickly can lead to intantaneous invocation of `onPressIn` and `onPressOut`. The end result is that users may never experience any intended visual press feedback. This changes `Pressable` to accept (and be preconfigured with a default) **minimum press duration**. The minimum press duration ensures that even if the press is released before `delayPressIn` has elapsed, `onPressOut` will still wait the remaining time up to `minPressDuration` before firing. Note that setting a non-zero `delayPressOut` is insufficient because if a user holds down on a `Pressable` for longer than `delayPressIn`, we still want `onPressOut` to fire immediately when the press is released. Changelog: [General][Changed] - Added `minPressDuration` to `Pressable`. Reviewed By: TheSavior Differential Revision: D21614708 fbshipit-source-id: 502f3d8ad6a40e7762435b6df16809c8798dd92c * chore: bring back script to org shape * [0.63.1] Bump version numbers * Exclude okhttp from flipper dependency (#29260) Summary: This fixes https://github.com/facebook/react-native/issues/28481. As explained in [this comment](https://github.com/facebook/react-native/issues/28481#issuecomment-645546195), the flipper network plugin pulls a more recent version of okhttp (3.14), but only versions of okhttp up to 3.12 works on Android API 21 and less. This prevented being able to run the app in debug mode, it was still working fine in release mode. ## 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 --> [Android] [Fixed] - Fix unable to run in debug mode on Android API < 21 Pull Request resolved: https://github.com/facebook/react-native/pull/29260 Test Plan: Using `yarn react-native run-android` the app would instantly crash with this error in `adb logcat`: ``` E/AndroidRuntime( 5079): java.lang.RuntimeException: Unable to create application com.awesometsproject.MainApplication: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created E/AndroidRuntime( 5079): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4154) E/AndroidRuntime( 5079): at android.app.ActivityThread.access$1300(ActivityThread.java:130) E/AndroidRuntime( 5079): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1255) E/AndroidRuntime( 5079): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 5079): at android.os.Looper.loop(Looper.java:137) E/AndroidRuntime( 5079): at android.app.ActivityThread.main(ActivityThread.java:4745) E/AndroidRuntime( 5079): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 5079): at java.lang.reflect.Method.invoke(Method.java:511) E/AndroidRuntime( 5079): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) E/AndroidRuntime( 5079): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) E/AndroidRuntime( 5079): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 5079): Caused by: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:90) E/AndroidRuntime( 5079): at com.facebook.react.ReactInstanceManager.<init>(ReactInstanceManager.java:238) E/AndroidRuntime( 5079): at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:281) E/AndroidRuntime( 5079): at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:87) E/AndroidRuntime( 5079): at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:39) E/AndroidRuntime( 5079): at com.awesometsproject.MainApplication.onCreate(MainApplication.java:47) E/AndroidRuntime( 5079): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:999) E/AndroidRuntime( 5079): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4151) E/AndroidRuntime( 5079): ... 10 more E/AndroidRuntime( 5079): Caused by: java.lang.reflect.InvocationTargetException E/AndroidRuntime( 5079): at java.lang.reflect.Constructor.constructNative(Native Method) E/AndroidRuntime( 5079): at java.lang.reflect.Constructor.newInstance(Constructor.java:417) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:80) E/AndroidRuntime( 5079): ... 17 more E/AndroidRuntime( 5079): Caused by: java.lang.NoClassDefFoundError: java.util.Objects E/AndroidRuntime( 5079): at okhttp3.CertificatePinner.withCertificateChainCleaner(CertificatePinner.java:231) E/AndroidRuntime( 5079): at okhttp3.OkHttpClient.<init>(OkHttpClient.java:238) E/AndroidRuntime( 5079): at okhttp3.OkHttpClient$Builder.build(OkHttpClient.java:1015) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevServerHelper.<init>(DevServerHelper.java:132) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerImpl.<init>(DevSupportManagerImpl.java:183) E/AndroidRuntime( 5079): ... 20 more W/ActivityManager( 1456): Force finishing activity com.awesometsproject/.MainActivity ``` With this fix, the app launch successfully in debug mode, without having to remove flipper altogether from our config. Reviewed By: passy Differential Revision: D22521109 Pulled By: mdvacca fbshipit-source-id: 3c0263642438bd7c0d09b045e15a933bd8a26734 * Send key when onKeyPress event is fired from TextInput Summary: Changelog: [Internal] In `onKeyPress` event, we were not returning `key` property. This diff adds `key` property to `onKeyPress` event and removes other, redundant properties from `onKeyPress` event. The implementation has been translated from Paper. Reviewed By: shergin Differential Revision: D21250411 fbshipit-source-id: f1e31381667acb9dec02d0b33883df8f8f5b2a4b * Calling Paper TextInput setTextAndSelection view command now dirties layout Summary: Changelog: [Internal] Previously `setTextAndSelection` was not dirtying layout. This would cause an issue where `setTextAndSelection` causes layout change. For example calling setTextAndSelection with empty string on a multiline auto expanding text input. I changed one example in TextInputSharedExamples.js, "Live Re-Write (no spaces allowed) and clear" example is now multiline. This allows to test whether `setTextAndSelection` dirties layout. Enter multiline string to to the example text input and press clear. Observe that the text input shrinks to single line height. Reviewed By: shergin Differential Revision: D21182990 fbshipit-source-id: de8501ea0b97012cf4cdf8d5f658649139f92da6 * Remove setMostRecentEventCount from TextInput view commands Summary: Changelog: [Internal] We don't use view command `setMostRecentEventCount`, let's get rid of it. Reviewed By: JoshuaGross Differential Revision: D21016600 fbshipit-source-id: 6491c063e9d6a89252300cb47c010b248e473f4b * Restore Previous Behavior for StyleSheet Validation of Null/Undefined Styles (#29171) Summary: https://github.com/facebook/react-native/issues/27264 changed stylesheet validation to avoid enumerating properties on the prototype of a style. It introduces a secondary behavior change, where null/undefined styles used to be tolerated but now lead to an exception. This is because `for in undefined` will noop where `for of Object.keys(undefined)` will throw. This scenario of undefined/null styles seems to actually show up in practice and was previously well tolerated. E.g. `Button.js` has code that looks like this: ```jsx const styles = StyleSheet.create({ button: Platform.select({ ios: {}, android: { elevation: 4, // Material design blue from https://material.google.com/style/color.html#color-color-palette backgroundColor: '#2196F3', borderRadius: 2, }, }), ``` For non ios/Android platforms, that creates a style object which looks like: ```js { button: undefined, ... } ``` This previously meant that the component would be unstyled if created, but now means out-of-tree platforms throw if the builtin Button component is required. This change restores the previous `for in` loop but adds a `hasOwnProperty` check to avoid properties on prototypes. ## Changelog [General] [Fixed] - Restore Previous Behavior for StyleSheet Validation of Null/Undefined Styles Pull Request resolved: https://github.com/facebook/react-native/pull/29171 Test Plan: Validated that importing Buttons will no longer cause an exception, and that invalid properties are still caught. Reviewed By: JoshuaGross Differential Revision: D22118379 Pulled By: TheSavior fbshipit-source-id: 650c64b934ccd12a3dc1b75e95debc359925ad73 * Set windowTranslucentNavigation to false (#29399) Summary: This fixes https://github.com/facebook/react-native/issues/29397. Without this, apps that specify `android:windowTranslucentNavigation` draw the `LogBox` buttons underneath the soft navigation bar, making the buttons unpressable. Before | After :-------------------------:|:-------------------------: <img src="http://ashoat.com/AndroidTranslucentNavigationLogBox.png" width="300" /> | <img src="http://ashoat.com/AndroidTranslucentNavigationLogBoxFixed.png" width="300" /> ## Changelog [Android] [Fixed] - Set LogBox windowTranslucentNavigation to false Pull Request resolved: https://github.com/facebook/react-native/pull/29399 Test Plan: I tested this change on the [repo](https://github.com/Ashoat/LogBoxTest) I set up to reproduce the issue. I set it up to [build `ReactAndroid` from source](https://github.com/Ashoat/LogBoxTest/commit/3a2cdab8777ac381cd3be5a84a5bf3250751ac11) and then edited `node_modules/react-native/ReactAndroid/src/main/res/devsupport/values/styles.xml` directly. Reviewed By: rickhanlonii Differential Revision: D22602970 Pulled By: mdvacca fbshipit-source-id: 8c2adc149aa0157825075022f00bb695956d3121 * Fix image cannot show in iOS 14 (#29420) Summary: This PR is to fix https://github.com/facebook/react-native/issues/29279, which image cannot show in iOS 14 As https://github.com/facebook/react-native/issues/29279#issuecomment-658244428 mention, this issue can be fixed by calling ` [super displayLayer:layer];` it it is still image, to let `UIImageView` handle still image rendering ## Changelog [iOS] [Fixed] - Fix image cannot show in iOS 14 Pull Request resolved: https://github.com/facebook/react-native/pull/29420 Test Plan: Image can be shown in iOS 14 build with Xcode 12 beta, using ```js <Image source={require('./images/some_local_image.jpg')}/> ``` It may also need to test gif image is render correctly ```js <Image source={{uri: 'https://some_remote_gif_image.gif'}}/> ``` Reviewed By: p-sun Differential Revision: D22619448 Pulled By: shergin fbshipit-source-id: f4d0ad83af945a6b8099d4eaea5a5f1933c7bfd2 * [0.63.2] Bump version numbers * botched merge changes 1 * more hermes changes needed from upstream, botched merge? * [RCTPicker] Guard UIKit only API on macOS * [RCTSegmentedControl] Make UIKit agnostic * [RCTDisplayWeakRefreshable] Make platform agnostic * [RCTImageLoader] Make platform agnostic * [RCTDevLoadingView] Make platform agnostic * botched merge changes 2 * [RCTPushNotificationManager] Guard for macOS * v0.63 TODO * [RCTBaseTextInputViewManager] Make platform agnostic * [RCTBaseTextInputView] Make platform agnostic * [RNTester-macOS] Fix * [RCT-Folly] Fix build * [PlatformColorValueTypes] Add macOS shim * [package] Update CLI to no longer require config This makes a previous change more explicit: https://github.com/microsoft/react-native-macos/pull/602 * Fix iOS build failures. * Get RNTester to launch * [CODEOWNERS] Add myself * [flow] Remove deprecated rule in newer Flow https://github.com/facebook/flow/commit/759970c1b6dc0a25171d9969e34eaf5dae70f130 * [flow] Get iOS checks green * [PlatformColor] Duplicate iOS code for macOS This is a naive version of this change, there should likely be some code sharing happening between iOS and macOS. * [test] Make green with macOS fork changes * [test] Get macOS test bundle to build * [Color] Rename alternating colors to match to assumptions * [PlatformExample] Fix examples on macOS * [transform] Use iOS implementation for macOS * [circle] Fix config * [ci] Update metro config as per upstream * [ci] Ignore metro config in e2e tests * Revert "[ci] Ignore metro config in e2e tests" This reverts commit 25f7006bc9ba76b1e002b721954a823b3d710c5c. * Revert "[ci] Update metro config as per upstream" This reverts commit b47ca570be00394bbd92b349eab02083787301e7. * [ci] Only disable custom metro config in e2e test * [ci] Ignore metro config in e2e tests * [ci] Switch to experimental CocoaPods CDN * Revert "[ci] Switch to experimental CocoaPods CDN" This reverts commit 44a92f7f08397406429672b14930d44b6aa06b5e. * [ci] Skip Android tests in Apple PR on master * [rnm-init] Fix pod reference * [rnm-init] Update minimum iOS deployment target Co-authored-by: Christoph Nakazawa <cpojer@fb.com> Co-authored-by: Sergio Estevao <sergioestevao@gmail.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: Sam Mathias Weggersen <sawegger@microsoft.com> Co-authored-by: Tommy Nguyen <tonguye@microsoft.com> Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Héctor Ramos <hector@hectorramos.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Sebastian Markbage <sema@fb.com> Co-authored-by: generatedunixname89002005287564 <generatedunixname89002005287564@fb.com> Co-authored-by: Eddie Dugan <ejd@fb.com> Co-authored-by: Valentin Shergin <shergin@fb.com> Co-authored-by: Max Ovtsin <maxovtsin@fb.com> Co-authored-by: Alexander Kawrykow <akawry@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Spencer Ahrens <sahrens@fb.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Jack Wang <shoubowang@fb.com> Co-authored-by: Oleg Bogdanov <boguscoder@fb.com> Co-authored-by: Michael Bolin <mbolin@fb.com> Co-authored-by: Dan Abramov <gaearon@fb.com> Co-authored-by: Peter Argany <petetheheat@fb.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: George Zahariev <gkz@fb.com> Co-authored-by: Jason Safaiyeh <safaiyeh@protonmail.com> Co-authored-by: Pedro Barbiero <pedrobarbiero@gmail.com> Co-authored-by: Brian Vaughn <bvaughn@fb.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Martin Sherburn <mns@fb.com> Co-authored-by: Tom Underhill <tomun@microsoft.com> Co-authored-by: Ventsislav Dimitrov <4097884+vdmtrv@users.noreply.github.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: Lucas Bento <lucas.bsilva@outlook.com> Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com> Co-authored-by: Vojtech Novak <vonovak@gmail.com> Co-authored-by: Emilis Baliukonis <emilisb@wix.com> Co-authored-by: Jacob Bower <jbower@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: Marc Horowitz <mhorowitz@fb.com> Co-authored-by: Sidharth Guglani <sidharthguglani@fb.com> Co-authored-by: Andrew Coates (REDMOND) <acoates@microsoft.com> Co-authored-by: maciej simka <mcj.simka@gmail.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Pavlos Vinieratos <pvinis@gmail.com> Co-authored-by: Cristiano Santos <cristianomnsantos@gmail.com> Co-authored-by: Daniel Cohen Gindi <Danielgindi@gmail.com> Co-authored-by: Eli White <eliwhite@fb.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: jiggag <jiggag90@gmail.com> Co-authored-by: Emily Janzer <janzer@fb.com> Co-authored-by: Kacper Wiszczuk <kacperwiszczuk@gmail.com> Co-authored-by: Xiaoyu Yin <xyin@fb.com> Co-authored-by: Javier Cuevas <javi@diacode.com> Co-authored-by: Bruno Barbieri <brunobar79@gmail.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Will Holen <willholen@fb.com> Co-authored-by: Pritesh Nandgaonkar <prit91@fb.com> Co-authored-by: sunnylqm <sunnylqm@qq.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Tim Yung <yungsters@fb.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: Devon Deonarine <hello@devondeonarine.ca> Co-authored-by: Radek Czemerys <radko93@gmail.com> Co-authored-by: Hein Rutjes <IjzerenHein@users.noreply.github.com> Co-authored-by: zhongwuzw <zhongwuzw@qq.com> Co-authored-by: Jonny Burger <jonathanburger11@gmail.com> Co-authored-by: Ryan Tremblay <ryan.tremblay@microsoft.com> Co-authored-by: almouro <contact@almouro.com> Co-authored-by: Rick Hanlon <rickhanlonii@gmail.com> Co-authored-by: Matthieu Harlé <bonjour@matthieuharle.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Ashoat Tevosyan <ashoat@gmail.com> Co-authored-by: Tom Cheung <cheungch@gmail.com>
2020-09-30 19:38:06 +03:00
import typeof YellowBox from './Libraries/YellowBox/YellowBoxDeprecated';
// Plugins
import typeof {DynamicColorIOS} from './Libraries/StyleSheet/PlatformColorValueTypesIOS';
import typeof {DynamicColorMacOS} from './Libraries/StyleSheet/PlatformColorValueTypesMacOS'; // TODO(macOS GH#774)
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
import typeof {ColorWithSystemEffectMacOS} from './Libraries/StyleSheet/PlatformColorValueTypesMacOS'; // TODO(macOS GH#750)
import typeof NativeModules from './Libraries/BatchedBridge/NativeModules';
import typeof Platform from './Libraries/Utilities/Platform';
v0.63 sync from upstream (#613) * Upgrade to Metro 0.59 Summary: Upgrades RN to Metro 0.59. Changelog: [Internal] Metro Upgrade Reviewed By: motiz88 Differential Revision: D20533864 fbshipit-source-id: 3c5fb8e37d2363edf0b9a1a8cfbdefba00763415 * Fix mock for TextInput (#28332) Summary: This PR adds the `isFocused` method to the mock of the TextInput component. My understanding some of the latest changes on the TextInput to make it use a forwardRef change the way this method is mock giving an error when trying to use in on a mock. The change suggested here fixes the issue. ## Changelog [JavaScript] [Fixed] - Fix the mock for TextInput to support the `isFocused` method Pull Request resolved: https://github.com/facebook/react-native/pull/28332 Reviewed By: cpojer Differential Revision: D20538044 Pulled By: TheSavior fbshipit-source-id: be734af105ab62ffdf9ed4017bd70845e207f8cd * Properly handle LogBox errors during tests Summary: This diff fixes an issue where errors in LogBox during tests would cause the tests to crash. The crash is due to the NativeExceptionsManager module not being mocked (as all native module need to be in tests). The fix is to properly mock the NativeExceptionManger. This fix exposed an infinite loop issue where failures in LogBox will be logged to the ExceptionManager, which logs to the console, which logs to LogBox, creating a loop. This diff also fixes that look by moving the LogBox internal error check to the top of the monkey patched console methods. Changelog: [Internal] Differential Revision: D20428590 fbshipit-source-id: 7289a480c99ba8dee67772178b7629afb40b330a * Back out "Track animations and flush them" Summary: Original commit changeset: b594d0e6e9b6 D20319824 introduced a problem in LayoutAnimations, which makes surfaced as the problem in T63911344. This diff reverts D20319824. Changelog: [Internal] Reviewed By: lunaleaps Differential Revision: D20541918 fbshipit-source-id: ff72b839f57d39051122920a38b2632cbb5ec362 * Consolidate "dispatchMountItems" reentrancy prevention code, and retry code, in one function Summary: Simplifying the dispatchMountItems reentrance and retry logic. Motivation: cleanup so I can work on dispatching ViewCommands before anything else. Importantly, this gives us the properties that: 1) Only one function is responsible for calling dispatchMountItems 2) Only one function is responsible for deciding if we shouldn't call dispatchMountItems due to reentrance 3) Only one function is responsible for all cleanup 4) Only one function maintains all of the relevant flags (except dispatchPreMountItems... two total now, instead of 4 before) Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20437035 fbshipit-source-id: 5370366790eb25f653bee6c1950e747458374a61 * Only retry ViewCommand mount items if exception is marked as "Retryable" Summary: Instead of just blindly retrying all ViewCommands if they fail - which could be dangerous, since it's arbitrary imperative commands we'd be executing twice, potentially with bad app state - we only retry if the ViewCommand throws a "RetryableMountingLayerException". Changelog: [Internal] Optimization to ViewCommands Reviewed By: mdvacca Differential Revision: D20529985 fbshipit-source-id: 0217b43f4bf92442bcc7ca48c8ae2b9a9e543dc9 * Introduce early dispatch of ViewCommands in FabricUIManager Summary: Earlier this week I introduced a change in the old, non-Fabric renderer (D20378633 D20427803) that (gated behind a feature-flag) executes ViewCommands before all other types of commands, as a perf optimization and (I think) a potential fix for a category of race conditions. I've added more details in comments here. The Fabric renderer uses the same feature-flag that I introduced for the non-Fabric renderer. Changelog: [Internal] Fabric Reviewed By: mdvacca Differential Revision: D20449186 fbshipit-source-id: bb3649f565f32c417a6247369902333989a043aa * Change nightly build from hourly to nightly (daily at 00:00) (#28346) Summary: We initially added the nightly build test to run every hour, in order to more quickly validate it. Now that it has been validated we can run it every night as it is intended to do. cc hramos ## Changelog [General] [Changed] - Change nightly build from hourly to nightly Pull Request resolved: https://github.com/facebook/react-native/pull/28346 Reviewed By: cpojer Differential Revision: D20550143 Pulled By: hramos fbshipit-source-id: 9487c6785684ad6ea7e877290d50a33118090a7f * Add diffing to app bundle size reports (#28284) Summary: Add diffing to app bundle size reports. ## Changelog [Internal] [Changed] - Add diffing to app bundle size reports Pull Request resolved: https://github.com/facebook/react-native/pull/28284 Test Plan: - App bundle size reports should now display a diff where available - Right now, the database contains only one entry for the last known good iOS build - Triggering a new build should not create additional comments Reviewed By: cpojer Differential Revision: D20450158 Pulled By: hramos fbshipit-source-id: 720772275f24d3ff0a49705f4dada2efe2e99bd3 * feat: improve monorepo support by removing redundant PROJECT_ROOT (#28354) Summary: Historically, React Native didn't support a lot of custom project structures apart from the standard flat directory with `ios` and `android` folders. The CLI had to be explicitly started from the project root, otherwise Metro didn't work right. In order to resolve the project root in the most accurate way, React Native assumed that project root is always `../../` from its location in `node_modules` - this is not true when the installation gets hoisted (e.g. in a monorepo). To address that, janicduplessis brought support for custom [`PROJECT_ROOT`](https://github.com/facebook/react-native/commit/9ccde378b6e6379df61f9d968be6346ca6be7ead) that allowed overriding the `../../` in case it wasn't true. Today, CLI is able to automatically resolve the project root, no matter where it's started. It will traverse the tree of the directories upwards and stop as soon as it meets `package.json`. As a result, it doesn't really matter from where we start the CLI anymore as a part of `react-native-xcode.sh`. By replacing the default value of `$REACT_NATIVE_DIR/../../` with `$PWD, that is default for all Xcode scripts, we can make the setup for monorepo easier - nobody will need to set `$PROJECT_ROOT` in order to override the incorrect defaults. By default, all scripts defined in Xcode run from `$PWD` directory, which is the location of the iOS project. In the future, we will be able to remove `cd` entirely. To better understand this PR, let's look a few hypothetical structures as an example: #### Monorepo: > tl;dr works out of the box, no need to mess around with paths ``` - package.json - packages/ - my-app/ - index.js - package.json - ios/ - MyApp.xcodeproj ``` **Before this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $REACT_NATIVE_DIR/../../ node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - Because we change the directory to the root of monorepo, CLI throws an error. All in all, there's no `react-native` dependency at the workspace root. - Some users turn `no hoist` in an act of troubleshooting the errors, which resolves the problem - `react-native` is moved under `my-app/node_modules` which makes this mechanism resolve properly. - Some users find out about `PROJECT_ROOT` and set it to overwrite the default value. For example, setting `export PROJECT_ROOT = "$PWD/../` will set the directory to `my-app`, which has a dependency on `react-native` in a `package.json` and makes the CLI happy. **After this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $PWD node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - The `$PWD` is `packages/my-app/ios/` because that's where the Xcode project is located. CLI will automatically set the root to `../` because that's where it finds `package.json` with `react-native` dependency. It will pass that root to Metro, unless users have set a different one themselves. Thanks to that, all paths to JavaScript files remain working and unaffected. - No need to set `PROJECT_ROOT` anymore. - We don't rely on the location of `node_modules`, which is cleaner and future proof. #### Standard: > tl;dr no changes ``` - ios/ - MyApp.xcodeproj - index.js - package.json ``` **Before this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $REACT_NATIVE_DIR/../../ node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - Everything works fine. Path from `react-native` inside `node_modules` is correct - the project root is set right to `/` **After this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $PWD node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - The root will be set to where Xcode project is located, which is `/ios`. This is the PWD for all Xcode scripts. CLI will look for the `package.json` going upwards from `ios` folder. Will stop at `/`, find out it has `react-native` dependency, load it and its commands and proceed further. ## Changelog [iOS] [Feature] - Better monorepo support when building release apk Pull Request resolved: https://github.com/facebook/react-native/pull/28354 Test Plan: - All projects (standard/monorepo) run without issues. - PROJECT_ROOT is not needed. CC: Titozzz (who wrote monorepo guide), alloy, bartolkaruza Reviewed By: cpojer Differential Revision: D20558005 Pulled By: hramos fbshipit-source-id: 2551120beadcfd4c2f1393ce8a2c2fa6b93c9290 * Fix `test_android`: Remove references to fbsource cell (#28363) Summary: Fixes https://github.com/facebook/react-native/issues/28361. ## Changelog [Internal] [CI] - Fix test_android Pull Request resolved: https://github.com/facebook/react-native/pull/28363 Test Plan: Prior to fix: ``` react-native $ ./scripts/circleci/buck_fetch.sh Guessing 168a69309928ba16065cdb33b1775a4af9f924a6 as the last one used version. Using additional configuration options from /Users/hramos/.buckconfig.d/experiments, /etc/buckconfig.d/fb_chef.ini, /etc/buckconfig.d/fb_chef_override.ini Invalidating internal cached state: Watchman failed to start. This may cause slower builds. Parsing buck files: finished in 1.5 sec Buck wasn't able to parse /Users/hramos/git/react-native/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK: IOError: [Errno 2] No such file or directory: '/Users/hramos/git/react-native/tools/build_defs/platform_defs.bzl' Call stack: File "/Users/hramos/git/react-native/.buckd/resources/168a69309928ba16065cdb33b1775a4af9f924a6/buck_server/buck_parser/profiler.py", line 507, in wrapped return func(*args, **kwargs) File "/Users/hramos/git/react-native/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK", line 1 load("//tools/build_defs:platform_defs.bzl", "ANDROID") File "/Users/hramos/git/react-native/.buckd/resources/168a69309928ba16065cdb33b1775a4af9f924a6/buck_server/buck_parser/profiler.py", line 507, in wrapped return func(*args, **kwargs) This error happened while trying to get dependency '//ReactAndroid/src/main/java/com/facebook/fbreact/specs:FBReactNativeSpec' of target '//ReactAndroid/src/main/java/com/facebook/react/devsupport:devsupport' ``` After fix: ``` react-native $ ./scripts/circleci/buck_fetch.sh + buck fetch ReactAndroid/src/test/java/com/facebook/react/modules Guessing 168a69309928ba16065cdb33b1775a4af9f924a6 as the last one used version. Using additional configuration options from /Users/hramos/.buckconfig.d/experiments, /etc/buckconfig.d/fb_chef.ini, /etc/buckconfig.d/fb_chef_override.ini Invalidating internal cached state: Watchman failed to start. This may cause slower builds. Parsing buck files: finished in 1.1 sec Configuration 'ANDROID_SDK' points to an invalid directory '/opt/android_sdk'. When creating rule //ReactAndroid/src/main/java/com/facebook/hermes/instrumentation:instrumentation. ``` > Note: I don't have the Android SDK configured in this machine. Verified on Circle CI. `test_android` is now green: https://circleci.com/gh/facebook/react-native/140682?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link Reviewed By: cpojer Differential Revision: D20564934 Pulled By: hramos fbshipit-source-id: 5d843b8f113c4db5391ee39addc3ff259d962290 * Fix TextInput left/right padding Summary: This fixes two things: 1) Currently it only respects Start and End padding, and if there's a Theme default, it will override Left/Right padding. Whoops. 2) Currently it doesn't respect when a TextInput starts with padding, but then is removed. This resolves both. It still does not account for RTL support. Changelog: [Internal] Fix AndroidTextInput padding Reviewed By: mdvacca Differential Revision: D20573151 fbshipit-source-id: e89791641b6699e728cde9dbd661a8c21485fbc8 * Validate selection range passed to setTextAndSelection Summary: Changelog: [Internal] # Fabric 1. If `start` and `end` parameters in `setTextAndSelection` are -1, we don't move the cursor. Previously the cursor would be moved to beginning of text input. 2. In view commands, do not validate `eventCount`. It is passed in as undefined from JS because Fabric's text input doesn't use `eventCount`. # Paper 1. If `start` and `end` parameters in `setTextAndSelection` are -1, we don't move the cursor. Previously the cursor would be moved to beginning of text input. Reviewed By: shergin Differential Revision: D20538290 fbshipit-source-id: c7aeddc25f58697254474058ce901df958321f7c * Remove ReactTypes from fbsource and React sync Summary: See https://github.com/facebook/react/pull/18366 This contains a fork of the upstream Flow types. We shouldn't be syncing this since these leads to conflicting types. As a result, these uses have already been codemodded away. Only the imports remained. Changelog: [React Core] - Remove ReactTypes from sync. Reviewed By: gaearon Differential Revision: D20583740 fbshipit-source-id: fc86a934cbdca8ff90fe90282b86ecc945a85e5f * Fix controlled TextInput with child nodes Summary: Changelog: [Internal] # There are three changes in this diff ## _stateRevision is replaced with a BOOL `_stateRevision` was protecting against setting attributed string that is already visible to the user. Previously this was ok because the change was only coming from native, any changes from JS were ignored. Imagine following scenario: 1. User taps key. 2. Update state is called on component initiated by native. 3. New state is created with incremented revision by one. 4. `_stateRevision` gets set to new state's revision + 1. 5. Now JS wants to change something because it just learnt that user tapped the key. 6. New state is created again with incremented revision by one. 7. Update state is called on the component, but the change isn't applied to the text view because `_state->getRevision()` will equal `_stateRevision`. By having a BOOL instead of number, we very explicitly mark the region in which we don't want state changes to be applied to text view. ## Calling [_backedTextInputView setAttributedText] move cursor to the end of text input This is prevented by storing what the current selection is and applying it after `[_backedTextInputView setAttributedText]` is called. This was previously invisible because JS wasn't changing contents of `_backedTextInputView`. ## Storing of previously applied JS attributed string in state This is the mechanism used to detect when value of text input changes come from JavaScript. JavaScript sends text input value changes through props and as children of TextInput. We compare what previously was set from JavaScript to what is currently being send from JavaScript and if they differ, this change is communicated to the component. Previously only first attributed string send from JavaScript was send to the component. # Problem If children are used to set text input's value, then there is a case in which we can't tell what source of truth should be. Let's take following example We have a text field that allows only 4 characters, again this is only a problem if those 4 characters come as children, not as value. This is a controller text input. 1. User types 1234. 2. User types 5th character. 3. JavaScript updates TextInput, saying that the content should stay 1234. 4. In `TextInputShadowNode` `hasJSUpdatedAttributedString` will be set to false, because previous JS value is the same as current JS value. Reviewed By: shergin Differential Revision: D20587681 fbshipit-source-id: 1b8a2efabbfa0fc87cba210570142d162efe61e6 * Daily `arc lint --take BUCKFORMAT` Reviewed By: zertosh Differential Revision: D20593906 fbshipit-source-id: b056947c698508119dc9d4d1bba202295b8f0fda * RN picker - implement background color Summary: add support to the android implementation of the Picker component for setting the background color. Changelog: [Android] [Added] - Support item background color in Dialog Picker Differential Revision: D20566131 fbshipit-source-id: d693b40803fa1051ec955c5728994c820fecd9e9 * Fabric: Modernizing Yoga Dirty flag test. Summary: Now we using TEST_F thing that allows consilidating initialization. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D20578788 fbshipit-source-id: 103bcb8fdeb3dbf297385cfe56415bd646e16791 * Fabric: Changing signature of `ComponentDescriptor::createState` Summary: This is pure syntactic change. Often we don't have a shared pointer to ShadowNodeFamily and only have just a reference. At the same time, `ComponentDescriptor::createState` does not have to accept a shared pointer. So, it's better to accept just a reference. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20578787 fbshipit-source-id: 905277001e096d41e75007575b59ea2ea15fbf4b * Fabric: View Test: Changing state should not dirty Yoga tree (in some most cases) Summary: Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D20578789 fbshipit-source-id: 4336165217bd39fc8065cfaeb96ef7753433d48a * Get ReactiveNative compiled with Clang 10 (#28362) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/28362 Fixed a few compilation errors emitted by Clang 10. Changelog: [iOS] [Fixed] - Get ready for Clang 10 Differential Revision: D20549970 fbshipit-source-id: dc36a85d90d3e43a05f045feb57c6ab6ded67da7 * Guard against null values in object parameters for bridged methods Summary: Handles the case when a value in an object parameter of a turbo module spec is null (even if the type is nullable). For example, given: ``` export interface Spec extends TurboModule { +myFunc: ({| foo: ?string, |}) => void; } ``` and calling `NativeModule.myFunc({foo: null})`, we see an error like: ``` JSON value '<null>' of type NSNull cannot be converted to NSString ``` Guarding against this by converting NSNull's to nils ## Changelog: [iOS] [Fixed] - Fix crash when passing null value in object parameter of bridged method Reviewed By: fkgozali Differential Revision: D20591590 fbshipit-source-id: fdb90f34131427a235f2e3c99147bf1e6a9c6732 * Modify pending deletion tags to be cross manageChildren Summary: Changelog: [Internal] Removing historic layout animations index adjustment (D20323928) broke the Dating Secret Crush screen. Since flushing animations (D20319824) had to be reverted due to issues with Saved + Privacy Shortcuts (https://fburl.com/tasks/eijtmifu) we need to track pending deletions across `manageChildren` operations. Reviewed By: JoshuaGross Differential Revision: D20601079 fbshipit-source-id: c6f116683750e97abe7f988cf361d2a6449e90e6 * Enable label-actions on the react-native repository (#28374) Summary: Enhance our issue management workflow by having the bot respond automatically whenever a label is applied to the issue. ## Changelog [Internal] - CI Pull Request resolved: https://github.com/facebook/react-native/pull/28374 Test Plan: Not tested. If needed, could be applied to a different, test repository. Reviewed By: cpojer Differential Revision: D20606887 Pulled By: hramos fbshipit-source-id: 874d1464527ea76bf51394a7d3e98e4fd8f69345 * Fix Animated Value initialized with undefined in ScrollView (#28349) Summary: When passing an object to contentOffset that doesn't have `y` prop set it causes the following error: ``` Error: AnimatedValue: Attempting to set value to undefined This error is located at: in ScrollView (at src/index.js:638) ... ``` This happens since a runtime check was added to the `AnimatedValue` constructor. (a3aaa471eca58b31597b9a0669f7ade385ccb175) According to flow types the object passed to contentOffset should always contain both x and y props but since it worked before when y is undefined I think its fine to patch the runtime behaviour defensively, especially since the code change is simple. ## Changelog [General] [Fixed] - Fix Animated Value initialized with undefined in ScrollView Pull Request resolved: https://github.com/facebook/react-native/pull/28349 Test Plan: Tested that the crash no longer reproduces when passing an empty object to contentOffset. Reviewed By: cpojer Differential Revision: D20601664 Pulled By: hramos fbshipit-source-id: b098a2dd1e702f995a9a92fa6e4e9a204187dac4 * xplat/js/react-native-github/ReactCommon/fabric/components/textinput/ Summary: Changelog: [Internal] Reviewed By: scottrice Differential Revision: D20619227 fbshipit-source-id: 674337e6ce585a4e96d020f9624b874ba86e2d80 * Seed ssh known hosts with github's public key (#28370) Summary: The [previous attempt](https://github.com/facebook/react-native/pull/28304) to fix the publish step failed, so now reverting to manually configuring things. This PR adds an entry to SSH’s `known_hosts` file using github.com’s public key that I have verified as per [these instructions](https://serverfault.com/a/807363): ``` ~/C/R/react-native [master] » nmap github.com --script ssh-hostkey Nmap scan report for github.com (140.82.118.4) rDNS record for 140.82.118.4: lb-140-82-118-4-ams.github.com PORT STATE SERVICE 22/tcp open ssh | ssh-hostkey: | 1024 ad:1c:08:a4:40:e3:6f:9c:f5:66:26:5d:4b:33:5d:8c (DSA) |_ 2048 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48 (RSA) ``` These fingerprints line up with [the ones posted by GitHub](https://help.github.com/en/github/authenticating-to-github/githubs-ssh-key-fingerprints), so my setup should be good and can be trusted to grab the public key from the right host: ``` ~/C/R/react-native [master] » ssh-keyscan -t rsa -H github.com # github.com:22 SSH-2.0-babeld-d48c3acd |1|If6MU203eXTaaWL678YEfWkVMrw=|kqLeIAyTy8pzpj8x8Ae4Fr8Mtlc= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== ``` ## Changelog [Internal] [Fixed] - Make automated publishing of packages from CI work again Pull Request resolved: https://github.com/facebook/react-native/pull/28370 Test Plan: I used the command being added in this PR in [a failed CI job](https://app.circleci.com/pipelines/github/facebook/react-native/4104/workflows/916127cb-177f-4583-9f90-cae5318041d8/jobs/140810). When I invoked the publish script manually I was not greeted by the blocking prompt and the package was successfully published: https://www.npmjs.com/package/react-native/v/0.0.0-56cf99a96 Reviewed By: cpojer Differential Revision: D20601527 Pulled By: hramos fbshipit-source-id: b1a4405228408cfc4a1b3b44ab88c79522af3a66 * Fix app bundle size diff not always being compared against latest commit (#28368) Summary: - Timestamp of entries in our Firebase instance sometimes get stored as number. This means that we may not always be diffing against the latest master commit. - Size report of Android and iOS gets overwritten depending on which build finishes first. ## Changelog [Internal] [Fixed] - App bundle size diff not always being compared against latest commit [Internal] [Fixed] - Android and iOS app bundle size diff overwrite each other Pull Request resolved: https://github.com/facebook/react-native/pull/28368 Test Plan: - We are now using Firebase's own [firebase.firestore.Timestamp.now](https://firebase.google.com/docs/reference/js/firebase.firestore.Timestamp#now) to ensure that we always get a timestamp in the preferred format. This has been tested locally but can only be verified when merged to master and we start getting new data. In the meantime, I'll manually fix up all the entries in the store. - There should be one app bundle size comment for Android and one for iOS in this PR. Reviewed By: cpojer Differential Revision: D20601620 Pulled By: hramos fbshipit-source-id: 0c3e4b78a74cbd659f1957a6aa74322b016e0646 * Hopefully fix so loading crashes Summary: Changelog: [Android][Internal] Fix potential initializer interruption threading crashes. Reviewed By: mdvacca Differential Revision: D20615755 fbshipit-source-id: 58b706deeb6df1998caff5bf2ae9ec60114313fe * Fix label-actions configuration Summary: Adds back a missing label key, fixes open source issue: https://github.com/facebook/react-native/issues/28378 Changelog: [Internal] [CI] - Fix label-actions config Reviewed By: cpojer Differential Revision: D20625887 fbshipit-source-id: 63c90db249aa9c15369a4b5bcab71cbe75c6d4b8 * Changing Order Of mOverrideColorScheme In Constructor Summary: Changelog: [Android] [Updated] mOverrideColorScheme should be assigned before the first colorSchemeForCurrentConfiguration call, so the initial setting of mColorScheme will reflect the override Reviewed By: zackargyle Differential Revision: D20630173 fbshipit-source-id: a2a2d174d3fc40c14f27dce6a7fa8e67203480c9 * hermes | inspector | Don't include posix headers on non-posix systems Summary: Changelog: [Internal] Hermes inspector includes pthreads, arpa and sys headers on all OSes that would break vanilla Windows builds. This diff adds a check for posix-compliance before inclusion (Note: this ignores all push blocking failures!) Reviewed By: dulinriley Differential Revision: D20564449 fbshipit-source-id: 8e264bc3104065dc4315bb291e8560609fe65184 * Upgrade Prettier from 1.17 to 2.0.2. Summary: This gets us on the latest Prettier 2.x: https://prettier.io/blog/2020/03/21/2.0.0.html Notably, this adds support for TypeScript 3.8, which introduces new syntax, such as `import type`. Reviewed By: zertosh Differential Revision: D20636268 fbshipit-source-id: fca5833d003804333a05ba16325bbbe0e06d6c8a * Back out "Upgrade Prettier from 1.17 to 2.0.2." Differential Revision: D20639755 fbshipit-source-id: 5028563f9cf0527a30b4259daac50cdc03934bfd * Fabric: Additional temporary checks in prop parsing infra Summary: While ViewConfig infra isn't perfect we need to check some value for correctness during prop-parsing. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D20639055 fbshipit-source-id: 193dcd0769bc7777bc8d60c964ede72ebdaa83e4 * Update React package Summary: This just updates the `react` package to the latest stable version. We updated it to experimental internally earlier so this brings the open source version to the latest before the branch cut. This doesn't include any breaking changes. Changelog: [General][Changed] - Update to React 16.13.1 Reviewed By: cpojer Differential Revision: D20642909 fbshipit-source-id: 68a4c74bfe72f1abdb33b0b9071a4f4e8e568318 * Fix sketchy null checks induced by new formatting in Prettier 2.0 Summary: Update code to prepare for Prettier 2.0, which will reformat `a || (b || c)` to `a || b || c`. Changelog: [Internal] prepare for Prettier 2.0 Reviewed By: kassens Differential Revision: D20639483 fbshipit-source-id: c2932b1495884684172ba9291d56c546f51711b8 * RN picker - fix types in AndroidDialogPickerManagerInterface Summary: according to [this crash report](https://our.intern.facebook.com/intern/logview/details/facebook_android_crashes/7ba7056481015482c6166d65cb97e49d/?trace_key=1506fe36a70dd5e50cdc8968f6317f27), `value` was throwing an NPE despite being null-checked. this is because it was an `int` rather than an `Integer`, so the null check wasn't working Changelog: Fix types in AndroidDialogPickerManagerInterface Reviewed By: mdvacca Differential Revision: D20646343 fbshipit-source-id: a27587e0a48f5782bcf5ffddb604018218e65206 * Remove RCTExportModule log spam Summary: The bridge complains if modules aren't exported, which isn't really helpful with lazily loaded modules and turbo modules. I considered only turning this off when TurboModules is enabled, but figured we'd be killing this soon anyways... If anyone feels strongly I can go that approach. Changelog: [iOS][Internal] Remove RCTExportModule log spam Reviewed By: shergin Differential Revision: D20629575 fbshipit-source-id: d32d9fe244c4d06acfee982fca7c7f63da294dc5 * De-jank DevLoadingView Summary: ## Problems Repro steps: 1. Disable Fabric (because CMD + R doesn't work with Fabric right now). 2. Open up Marketplace and hit `CMD + OPT + R` 3. **Observe:** The progress bar doesn't show up right away. It also doesn't actually show progress. https://pxl.cl/140g1 RN Support post: https://fb.workplace.com/groups/rn.support/permalink/3437652016283389/ ## Fixes The first problem is that progress bar doesn't actually show progress. **Fix:** Bundle load progress is updated in `RCTCxxBridge`, where we first require `RCTDevLoadingView`, and then call its `updateProgress` method. Previously, we wouldn't lazily load `RCTDevLoadingView`, it already didn't exist. Lazily loading `RCTDevLoadingView` causes the progress view to show up. Here: https://pxl.cl/140gt If you look at the above video, you'll notice there are two stages to the progress bar: stage 1 displays the actual progress. Stage 2 prompts that we're downloading the JS bundle. As you can see, stage 1 and stage 2 have different background colors, even though both of them are green. **Fix:** I adjusted the JS to match the Native color. Here: https://pxl.cl/140gT We're almost there, but the progress bar is dismissed twice? **Fix:** I dug into the code, and the reason why was because when we hit `CMD + R`, we invalidate the bridge, and immediately re-initialize it. This means that we asynchronously invalidate the old TurboModuleManager, and immediately create a brand new one. Therefore, two `RCTDevLoadingView` modules can (and do) exist at once. So, I moved `RCTDevLoadingView` to be an instance member of `FBReactModule`, to ensure that it doesn't get cleaned up and re-created when TurboModuleManager is deleted and re-created. This finally fixed the progress bar jank: https://pxl.cl/140hn Changelog: [iOS][Fixed] - Remove RCTDevLoadingView jank Reviewed By: rickhanlonii Differential Revision: D20607815 fbshipit-source-id: 05825c67adaf3cfda70be0fa2dc92d413dc8921b * Fix retaining self in block in LogBox impl Summary: Logbox has a retain cycle (see linked task for my deeper investigation). This diff doesn't fix the retain cycle, but it's just good practice to not retain self strongly in blocks. Changelog: [iOS][Internal] Fix retaining self in block in LogBox implementation Reviewed By: shergin Differential Revision: D20630693 fbshipit-source-id: cf399495e9bcd1917932fcc0e9c9d2d2a32bf6f0 * Flow type infoLog Summary: Changelog: [General][Internal] flow type infoLog Reviewed By: zackargyle Differential Revision: D20577939 fbshipit-source-id: eed4401b2ae0a6bf845fdcb54c6abe1fe98fe7c1 * Replace fbsource// with // in xplat/js/ files [1] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: scottrice Differential Revision: D20495655 fbshipit-source-id: a57b72f694c533e2e16dffe74eccb8fdec1f55f5 * Deploy Flow 0.121 to Xplat (#901) Summary: Deploy Flow 0.121 to Xplat bypass-lint allow-large-files Closes https://github.com/facebook/flipper/pull/901 Changelog: [Internal] Reviewed By: panagosg7 Differential Revision: D20570316 fbshipit-source-id: a76983d6f46c8b995ce2dd5cd1e014534790698a * Replace fbsource// with // in xplat/js/ files [3] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D20656211 fbshipit-source-id: deb91b917d349bc500acbb03d734ff621f6e1fc7 * Replace fbsource// with // in xplat/js/ files [4] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: JoshuaGross, shergin Differential Revision: D20656696 fbshipit-source-id: 10f02decb1dc969fd3491ac90d97f09e2bda59e7 * Add Needs: Repro bot action (#28397) Summary: Add automated response for Needs: Repro ## Changelog [Internal] [Added] - Add automated response for Needs: Repro Pull Request resolved: https://github.com/facebook/react-native/pull/28397 Test Plan: Bot should add a comment with the Needs: Repro label. Reviewed By: cpojer Differential Revision: D20665378 Pulled By: hramos fbshipit-source-id: 1c7d878faacf935a640849f74c81f119e5c7e92d * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D20666684 fbshipit-source-id: 32255ac7509e0257693969a7b4b044569af30df7 * ✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392) Summary: Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`. Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job. What was done in this PR: * The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use. * The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument. * The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument * The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument ## Changelog [Internal] [CI] - ✅ Green CI, disabled test infrastructure work Pull Request resolved: https://github.com/facebook/react-native/pull/28392 Test Plan: Verified on Circle CI Reviewed By: cpojer Differential Revision: D20665512 Pulled By: hramos fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726 * Upgrade internal packages to support ESLint >= 6 (#28393) Summary: Fixes https://github.com/facebook/react-native/issues/28293 I've tested it with https://github.com/react-native-community/react-native-template-typescript and it seems to be working as expected - no warnings, supports typescript 3.8. (note: I didn't upgrade the package version as I don't know how the releases work for this package) ## Changelog [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/28393 Reviewed By: hramos Differential Revision: D20647112 Pulled By: cpojer fbshipit-source-id: ca6b67971f625dc8125a58f9220dfcd86250ba94 * Fabric: Fixing a deadlock in RCTSurfacePresenter Summary: This is another attempt to fix an issue very similar to T59424871. The previous attempt was in D19249490. I don't know why we don't see production crashes (stalls) but it happened to me (and not to me) in the debugger. The previous attempt didn't work because we still could have a deadlock because we tried to acquired shared mutex already owned exclusively by the `suspend` method. Here is another approach: Instead of using one shared mutex, now we use two. One is similar to what we had and another that protects `suspend` and `resume`. Besides that, now we pass a Scheduler to functions that use that explicitly. This way we can be more explicit about acquiring mutexes and the overall flow of execution. The idea is: Now an arbitrary code that can be reentrant does not cover with mutexes, so the deadlock is not possible. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20639228 fbshipit-source-id: 98515742f00f2ae94b50b585c9f1f0611e169ebe * Update React Hooks Plugin Summary: Updates `eslint-plugin-react-hooks` to 3.0.0. This introduces a new lint error when you use a Hook inside a class. Changelog: [General][Changed] - Updated the React Hooks ESLint Plugin Reviewed By: cpojer Differential Revision: D20675528 fbshipit-source-id: d0cbe9748fd15df7a4c6de00bd1462610e0a43d6 * Upgrade React DevTools 4.0.6 -> 4.6.0 Summary: Upgrading the embedded version of React DevTools, primarily to pull in [this PR](https://github.com/facebook/react/pull/18397) which will reduce the impact of this package on `node_modules` size. # Update process Following a similar process as D15973709, I began by searching for [all of the references](https://our.intern.facebook.com/intern/biggrep/?corpus=xplat&filename=.json&case=false&view=default&extre=&s=%22react-devtools&engine=apr_strmatch&context=false&filter[uninteresting]=false&filter[intern]=false&filter[test]=false&grep_regex=) to the `react-devtools-core` package and updated all v4 usage to to point to the new 4.6.0 release: 1: Manually update "react-devtools-core" versions: ``` js/package.json js/react-native-github/package.json nuclide/package.json sonar/desktop/app/package.json sonar/desktop/plugins/reactdevtools/package.json vscode/modules/vscode-webview/package.json ``` 2: Setup Yarn proxy: ``` yarn config set proxy http://fwdproxy:8080/ yarn config set https-proxy http://fwdproxy:8080 ``` 3: Run "yarn" in each of the above directories. 4: Run the lockfile shell script: ``` ~/xplat/js/scripts/update-oss-yarn-lockfile.sh ``` 5: Update the generated `MOBILE_JS_NODE_MODULE_DEPS.bzl` by running ``` js1 build buckfiles ``` ## Changelog: [General] [Changed] - Upgrade embedded React DevTools backend from v4.0.6 to v4.6.0. Reviewed By: cpojer, gaearon Differential Revision: D20676091 fbshipit-source-id: 99865bdba9bce45e2a7d582d5fb550cfdbeeca3a * Make ScrollView use ForwardRef Summary: Have ScrollView use forwardRef so that the host component methods like `measure` and `measureLayout` are available without having to call `getNativeScrollRef`. Instead, you can use `<ScrollView ref={myRef} />` and directly call all methods of ScrollView and host components on `myRef`. Previous usage: ``` const myRef = React.createRef<React.ElementRef<typeof ScrollView>>(); <ScrollView ref={myRef} /> const innerViewRef = myRef.current.getNativeScrollRef(); innerViewRef.measure(); ``` New usage: ``` const myRef = React.createRef<React.ElementRef<typeof View>>(); <ScrollView ref={myRef} /> // now, myRef.current can be used directly as the ref myRef.current.measure(); myRef.current.measureLayout(); // Additionally, myRef still has access to ScrollView methods myRef.current.scrollTo(...); ``` Changes: * Added deprecation warnings to ScrollView methods `getNativeScrollRef`, `getScrollableNode`, and `getScrollResponder` * Added the forwardRef call to create `ForwardedScrollView` - this takes in `ref` and passes it into the class ScrollView as `scrollViewRef`. * Forwarded the ref to the native scroll view using `setAndForwardRef`. * Added statics onto `ForwardedScrollView` so that `ScrollView.Context` can still be accessed. * Added type `ScrollViewImperativeMethods`, which lists the public methods of ScrollView. * Converted all public methods of ScrollView to arrow functions. This is because they need to be bound to the forwarded ref. * Bound all public methods of ScrollView to the forwarded ref in the `setAndForwardRef` call. * Flow typed the final output (ForwardedScrollView) as an abstract component that takes in the props of the `ScrollView` class, and has all methods of both the inner host component (`measure`, `measureLayout`, etc) and the public methods (`scrollTo`, etc). Changes to mockScrollView: * Changed mockScrollView to be able to mock the function component instead of a class component * Updated necessary tests Changelog: [General] [Changed] - Make ScrollView use forwardRef Reviewed By: TheSavior Differential Revision: D19304480 fbshipit-source-id: 6c359897526d9d5ac6bc6ab6d5f9d82bfc0d8af4 * Fix issue with onEndReached Summary: onEndReached can be triggered twice when more items are added to the end of the list. This change makes it so that a second call to onEndReached won't happen until the user scrolls down to the new end of the list. Changelog: [General] [Fixed] - Fix double call to onEndReached in VirtualizedList Reviewed By: sahrens Differential Revision: D20066740 fbshipit-source-id: 129d7ae6bfd241eeea18fe0bb12b82be67735874 * Remove console warnings from ScrollView methods Summary: The newly added console warnings in D19304480 are adding a lot of warning noise due to missed infra callsites. Those callsites need to be updated before these warnings can be added. Changelog: [Removed] Remove console warnings from ScrollView methods Reviewed By: rickhanlonii Differential Revision: D20700917 fbshipit-source-id: cb618ee3a291d26e1942e4f91bbc02dee41fb78b * Upgrade react-docgen, jscodeshift and flow-parser Summary: In preparation for upgrading babel, I'm updating some of our source transform tools to the latest versions. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D20675201 fbshipit-source-id: fa4fee2652529c6677087e42cdd1325a8080e46f * Ship State Reconciliation 100% on all platforms Summary: State Reconciliation has been running 50/50 for a while and all metrics look stable. This is necessary for providing a good experience so we should ship to everyone unconditionally. Changelog: [Internal] Fabric diffing reconciliation process improvement Reviewed By: mdvacca Differential Revision: D20715694 fbshipit-source-id: 25b2635ecc29b67e2911679c9db66bc84d37dec1 * Core telemetry tests: update so they pass on my machine Summary: `std::this_thread::sleep_for` is not really precise and will attempt to sleep for "at least" that much time, but may sleep much longer depending on what CPUs are doing and scheduling policies. To get this to pass on my machine, I had to substantially increase the thresholds. Changelog: [Internal] Reviewed By: shergin Differential Revision: D20689571 fbshipit-source-id: f159420d24a95da2b5d95d49ed7882e783291e98 * Optimize diff algorithm to produce fewer remove+insert ("move") paired instructions Summary: An evolution of D20633188 but more performant. There are three optimized paths before the slow path. The first optimized path tries to pair identical nodes from old/new tree, and generate Update mutations, until we hit nodes that are different (indicating either a remove or an insert). This already existed. The next two optimizations, introduced by Tim in his JS pseudocode, were inspired by ReactJS's diffing algorithm. They work in cases where the rest of the nodes are (1) all removals/deletes or (2) all creates+inserts. Finally, if those final two optimized paths can't run, it's because there is a mix of delete+remove, create+insert, and "move" operations, mixed at the beginning, middle, and/or end of the list. This has slightly better average/best-case complexity as the previous implementation. In particularly pathological cases where all nodes are arbitrarily reordered, or reversed, for instance (ABCDE->EDCBA) the algorithm has the same complexity as the previous algorithm (quadratic). For now iOS is pinned to the older differ Changelog: [Internal] Experiment to optimize diffing algorithm in Fabric Reviewed By: shergin Differential Revision: D20684094 fbshipit-source-id: d29fba95a0328156c023e1c87804f23770ee1d91 * Unit test for V2 "minimal instruction" diffing algorithm Summary: This unit test is to verify that the new diffing algorithm generates a "minimal" instruction set, with regards to removes and inserts ("moves"). These unit tests are here to verify the expected behavior in this new algorithm, but these tests may be modified or deleted in the future if we decide we want to change this behavior. Changelog: [Internal] fabric unit test Reviewed By: mdvacca Differential Revision: D20706592 fbshipit-source-id: 5f9991498e0d788ecbf88d938bfe6d3f0f27af40 * Add ES Lint rules for `DynamicColorIOS()`and `ColorAndroid()` (#28398) Summary: The [PlatformColor PR](https://github.com/facebook/react-native/pull/27908) added support for iOS and Android to express platform specific color values. The primary method for an app to specify such colors is via the `PlatformColor()` method that takes string arguments. The `PlatformColor` method returns an opaque Flow type enforcing that apps use the PlatformColor method instead of creating Objects from scratch -- doing so would make it harder to write static analysis tools around Color values in the future. But in addition to `PlatformColor()`, iOS has a `DynamicColorIOS()` method that takes an Object. The Flow type for this Object cannot be opaque, but we still want to enforce that app code doesn't pass variables instead of Object literals or that values in the Objects are variables. To ensure `DynamicColorIOS()` can be statically analyzed this change adds an ESLint rule to enforce that `DynamicColorIOS()` takes an Object literal of a specific shape. A `ColorAndroid()` was also introduced not for practical use but just to test having platform specific methods for more than one platform in the same app. A second ESLint rule is created for `ColorAndroid` as well. ## Changelog [General] [Changed] - Add ES Lint rules for `DynamicColorIOS()`and `ColorAndroid()` Pull Request resolved: https://github.com/facebook/react-native/pull/28398 Test Plan: `yarn lint` passes. Reviewed By: cpojer Differential Revision: D20685383 Pulled By: TheSavior fbshipit-source-id: 9bb37ccc059e74282b119577df0ced63cb9b1f53 * fix: Android gradle config when bundling for release (#28415) Summary: This fix aims to address the issue when bundling an Android app for release and getting the error exhibited in https://github.com/facebook/react-native/issues/28002 which I also encountered myself. The config was changed sometime in November 2019 (as part of https://github.com/facebook/react-native/issues/26940, commit https://github.com/facebook/react-native/commit/a3b08048674e324dbe1f0ca816f35607e9e06a2f) to be very opinionated when it comes to the use of `npx` which Gradle itself cannot find anyway (I have `npx` installed globally and it didn't pick it up). Another issue that the use of `npx` creates is that Gradle should only ever use the currently installed react-native cli rather than a (possibly) higher version which may not always have backward compatibility. The proposed change simply throws a more descriptive error rather than defaulting to a tool which may or may not exist on the machine, be it CI or a development environment. I've also modified the RNTester app to reflect the correct config implementation relative to the RNTester app itself. In real projects, the config inside `android/app/build.gradle` should look similar to the following snippet: ``` project.ext.react = [ cliPath: "$rootDir/../node_modules/react-native/cli.js", entryFile: "index.js" ]; ``` ## Changelog [Android] [Fixed] - Gradle release config Pull Request resolved: https://github.com/facebook/react-native/pull/28415 Test Plan: - [x] Successfully bundled an Android release build with correct config - [x] Works with RNTester app Reviewed By: mdvacca Differential Revision: D20714372 Pulled By: hramos fbshipit-source-id: 4d66139249c6f840582a71a48c64e6a6595f7af0 * Reimplement D19965405: Small improvements in Differentiator/TinyMap Summary: Two things: 1) I reimplement Valentin's idea in D19965405, so that TinyMaps can be iterated over, with a couple of bugfixes (calling front() or back() on an empty vector will crash). 2) I now use TinyMap instead of better::map in the "optimized" diffing algorithm. 3) `erase` now actually removes elements from the vector, but only when more than half of elements have been erased. 4) If you repeatedly erase elements at the beginning of the vector, they will no longer be iterated over. This is a specific optimization for our heaviest TinyMap use-cases. These amount to some small but hopefully somewhat meaningful perf improvements. Changelog: [Internal] Fabric perf Reviewed By: shergin Differential Revision: D20718719 fbshipit-source-id: 91f4b2e2e0f6387ae484e43d5b0095103087baa6 * Remove LayoutInspectingPolicy.includeScrollViewContentOffset Summary: `LayoutInspectingPolicy` has two flags, `includeTransform` and `includeScrollViewContentOffset`. `includeScrollViewContentOffset` seems to be redundant for two reasons. # 1st From looking at callers, they have always the same value. I looked at all call sites, and they are either always both set to true or both set to false. # 2nd The way we include scroll view content offset, is through transformation, so setting `includeTransform` to true and `includeScrollViewContentOffset` to false will include content offset anyway. In order to make both flags work, we would need to introduce further changes to `getRelativeLayoutMetrics`. But since the flag isn't used anyway, I think it is better to get rid of it for now. If we need it in the future, we could re-introduce it. Reviewed By: shergin Differential Revision: D20622256 fbshipit-source-id: fb6156c66b752319ea928239fa723ff90688b0a0 * Add support for translation and rotation to operator * between Rect and Transform Summary: Changelog: [Internal] Until now `Rect operator*(Rect const &rect, Transform const &transform)` supported only scaling. Now it supports translation and rotation as well. Reviewed By: shergin Differential Revision: D20622876 fbshipit-source-id: 1b65393bd3fd6fd9a8941903e0f2681a10097e4a * Include transform property when calling getRelativeLayoutMetrics Summary: Changelog: [Internal] Current implementation of `measure` doesn't take transform into account.. So if you had a view which has width and height 100 and had `Scale(0.5, 0.5, 1)` (this will shrink view by half). Calling `getRelativeLayoutMetrics` would report its size being `{100, 100}`. This applies if view's parent has transformation as well, because transformation is applied to all subviews of the view as well. Reviewed By: mdvacca Differential Revision: D20621590 fbshipit-source-id: 2cf902a0494291c821ecada56f810c5e6620db5a * feat: migrate appveyor to circleci (#28245) Summary: This issue closes https://github.com/facebook/react-native/issues/28241 Migrated Windows test from AppVeyor to CircleCI ## Changelog [Internal] [Changed] - Migrated Windows test from AppVeyor to CircleCI Pull Request resolved: https://github.com/facebook/react-native/pull/28245 Test Plan: For CircleCI to Pass Reviewed By: cpojer Differential Revision: D20689163 Pulled By: hramos fbshipit-source-id: 285c762457ef00f7884ee9157b3f336044c0452f * Remove "Debug with Nuclide" option Summary: This is no longer needed. Reviewed By: cpojer Differential Revision: D20722274 fbshipit-source-id: 5bc3104e90811d724f42aadbf137ab8eff718ca0 * experiment to preload RN bridge after fb4a bookmarks render Summary: Changelog: [Android][Internal] add internal supermodule label Reviewed By: mdvacca Differential Revision: D20434200 fbshipit-source-id: fae50309cdd0df4a4523c2f88d1c8e01a7163575 * Fix CursorDrawable Color Tint for Android 10+ Summary: Accessing this field via reflection is explicitly blacklisted by Google in Android 10 and higher. They have provided a new API to change the color, which I have implemented here. [The old setColorFilter is deprecated](https://developer.android.com/reference/android/graphics/drawable/Drawable#setColorFilter(int,%20android.graphics.PorterDuff.Mode)) so I also updated that method call as well. Changelog: [General] [Fixed] Use new setTextCursorDrawable API for Android 10 Reviewed By: JoshuaGross Differential Revision: D20656068 fbshipit-source-id: 58a92b57c0a892c7c87fc5d735e4ceaa4e987ec7 * Early return on tinting CursorDrawable if no color supplied Summary: There's (potentially) a lot of expensive reflection calls here that, as best I can tell, end up being ignored if the supplied color is null. Better to early return. Changelog: [General] [Internal] Preclude reflection when setting cursor color if color is null Reviewed By: JoshuaGross Differential Revision: D20670594 fbshipit-source-id: 480a988355bbd79008002c4326d4b35035ec2a95 * Partial React Sync for Inspector Summary: Partial sync for React that includes: - https://github.com/facebook/react/pull/18388 - https://github.com/facebook/react/commit/dd7e5e4f5ac2ffac3171ef61daee2cb1edc69635 Created from this branch: https://github.com/facebook/react/compare/master...rickhanlonii:rh-partial-3-24?expand=1 Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20651395 fbshipit-source-id: 67baf7c407f75d9fd01c17f2203a77a38567100e * Enable inspector for Fabric Summary: ## Overview This diff refactors the Inspector, moving logic to look up view data for a touched view inside the renderer as `getInspectorDataForViewAtPoint`. We then implement that same function for Fabric in order to support the inspector in that renderer. Requires https://github.com/facebook/react/pull/18388 ## Motivation Reason one for this refactor is that, previously, the inspector held all of the logic to look up view data for a given x,y touch coordinate. To do this, it would take the React tag and coordinates, look up the native view tag, measure it, and then ask React internals for the Fiber information of that tag. All of this is deeply coupled to React internals, yet the logic is outside of React core in the Inspector. Reason two is that, for Fabric, the logic for getting the view data is different than Paper. In Fabric, we pass the x,y coordinates to native directly, which returns an instance handle. That handle can be used to measure the ShadowNode, or retrieve the Fiber information. By moving the logic into the renderer in React core, we decouple the implementation details of looking up view data for a tapped point and allow ourselves the ability to add and change renderer-specific code for the actual lookup without impacting outsiders like the Inspector. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D20291710 fbshipit-source-id: a125223f2e44a6483120c41dc6146ad75a0e3e68 * chore: update url of warning message from deprecated imports (#28452) Summary: Some of the repository name of Lean Core(https://github.com/facebook/react-native/issues/23313) libraries has been renamed. This PR updates the warning message to display the updated url. ## Changelog [General] [Changed] - Update warning message of deprecated imports Pull Request resolved: https://github.com/facebook/react-native/pull/28452 Test Plan: updated URL can be accessed. Reviewed By: cpojer Differential Revision: D20745184 Pulled By: TheSavior fbshipit-source-id: 2c3ed6a000b45022ca6c4862305aa567c4d18b2e * Add `upgrade-support` link on issue creation (#28411) Summary: This PR adds a https://github.com/react-native-community/upgrade-support link for the user when creating an issue. Changelog: [Internal] Pull Request resolved: https://github.com/facebook/react-native/pull/28411 Reviewed By: cpojer Differential Revision: D20714274 Pulled By: hramos fbshipit-source-id: 4ca42224a50e386b95f21f0fb236a917e1b6b982 * Update PixelRatio 'getFontScale' method description (#28407) Summary: Refs facebook/react-native-website#1776. Despite in-code description `PixelRatio.getFontScale()` is working properly on the iOS (it also reflects the user settings). This PR updates the in-code description to match current behaviour. I have decided to skip in the code information about additional setting in `Accessibility` menu and in `Control Centre`, but if you think it is important just let me know, I can update this PR. ## Changelog [Internal] [Fixed] - Fix PixelRatio getFontScale method description Pull Request resolved: https://github.com/facebook/react-native/pull/28407 Test Plan: N/A Differential Revision: D20750260 Pulled By: shergin fbshipit-source-id: c40ec2fd49cd60e2975351c3a1c453aab0045da4 * Remove allowDisablingImmediateExecutionOfScheduleMountItems feature flag Summary: No longer needed. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20747684 fbshipit-source-id: a8077519b7670d72e23267b1c1423556ec97be3f * RuntimeExecutor helpers that modify the way of the callback is being executed. Summary: Here we implement a bunch of helper methods that allow customizing the behavior of a RuntimeExecutor "on-demand" on the caller side. We will use it in the next diff(s). Changelog: [Internal] Fabric-specific internal change. Reviewed By: PeteTheHeat Differential Revision: D20551411 fbshipit-source-id: 51d3cd02b69753110c0e1155347c6e52eb882c7d * Fabric: Using `executeSynchronouslyOnSameThread_CAN_DEADLOCK` in MainRunLoopEventBeat Summary: We are replacing inline-ed implementation with practically the same one implemented as the helper method. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20551409 fbshipit-source-id: fcc6f497cd240af65fba534051c217fe5746ce82 * Set RootNodeKind trait in ModalHostViewShadowNode Summary: Changelog: [internal] `ModalHostViewShadowNode` didn't have `RootNodeKit` trait, therefore `getRelativeLayoutMetrics` was including nodes in ancestors that it shouldn't have. Reviewed By: shergin Differential Revision: D20735801 fbshipit-source-id: 6b81e3b174c2f82e530abc2bca2da8bebc2270b0 * mention RNTester app in contributor guide (#28042) Summary: motivation is following - the RNTester app is imho the best place to try out any changes that a contributor would make, yet it is not directly mentioned in the contributor guide. This fixes it. ## Changelog [Internal] - Docs Pull Request resolved: https://github.com/facebook/react-native/pull/28042 Test Plan: not necessary Reviewed By: TheSavior Differential Revision: D20401260 Pulled By: hramos fbshipit-source-id: 01c1b7dff56b59909c94b2feb609650f0baba1a9 * Buck: Use Android SDK 29 during build (#28455) Summary: Fixes `test_android` and `test_docker` build failures. Thanks to dulmandakh for identifying the fix. Changelog: [Internal] [Android] [Changed] - Use Android SDK 29 to build during CI tests Pull Request resolved: https://github.com/facebook/react-native/pull/28455 Test Plan: Circle CI shows `test_android` and `test_docker` passing: https://app.circleci.com/jobs/github/facebook/react-native/142273 Reviewed By: sturmen Differential Revision: D20766589 Pulled By: hramos fbshipit-source-id: 8ef8a8ce3a6e7353ae47425accb3bd26cf1608c4 * Assign orderIndex_ in ConcreteViewShadowNode constructor instead of ViewShadowNode's constructor Summary: Changelog: [Internal] `orderIndex_` was only being assigned for `ViewShadowNode`, not for other `ShadowNodes` that are later represented on the screen. Reviewed By: shergin Differential Revision: D20746477 fbshipit-source-id: c04c2cfea14b9141d22bc3d9e9bb4c0c59925754 * Implement nativePerformanceNow to improve Profiler API results (#27885) Summary: When experimenting with React Profiler API (https://reactjs.org/docs/profiler.html), I noticed that durations are integers without a debugger, but they are doubles with higher precision when debugger is attached. After digging into React Profiler code, I found out that it's using `performance.now()` to accumulate execution times of individual units of work. Since this method does not exist in React Native, it falls back to Javascript `Date`, leading to imprecise results. This PR introduces `global.nativePerformanceNow` function which returns precise native time, and a very basic `performance` polyfill with `now` function. This will greatly improve React Profiler API results, which is essential for profiling and benchmark tools. Solves https://github.com/facebook/react-native/issues/27274 ## Changelog [General] [Added] - Implement `nativePerformanceNow` and `performance.now()` Pull Request resolved: https://github.com/facebook/react-native/pull/27885 Test Plan: ``` const initialTime = global.performance.now(); setTimeout(() => { const newTime = global.performance.now(); console.warn('duration', newTime - initialTime); }, 1000); ``` ### Android + Hermes ![Screenshot_1580198068](https://user-images.githubusercontent.com/13116854/73245757-af0d6c80-41b5-11ea-8130-dde14ebd41a3.png) ### Android + JSC ![Screenshot_1580199089](https://user-images.githubusercontent.com/13116854/73246157-92256900-41b6-11ea-87a6-ac222383200c.png) ### iOS ![Simulator Screen Shot - iPhone 8 - 2020-01-28 at 10 06 49](https://user-images.githubusercontent.com/13116854/73245871-f136ae00-41b5-11ea-9e31-b1eff5717e62.png) Reviewed By: ejanzer Differential Revision: D19888289 Pulled By: rickhanlonii fbshipit-source-id: ab8152382da9aee9b4b3c76f096e45d40f55da6c * Save/restore IP when leaving the interpreter Summary: This diff implements the instruction pointer save/restore trick Tzvetan came up with; allowing us to observe and modify the IP from outside the interpreter loop with negligible overhead. From Tzvetan's internal post on the subject: > [Today] the interpreter IP is just a local variable in the interpreter function, so there is no way to get to its value from outside the function. It lives in a register and we don't want to make it a Runtime field since the overhead [of accessing it via memory in the interpeter loop] would kill us. > However, if you really think about it, it only lives in a register while the interpreter function is running. For the rest of the time, it is spilled by the C++ compiler onto the stack. So, precisely when we need it, it is actually stored in memory. The only problem is, we don't know where! Admittedly, that is an annoying problem, but it feels like it should be solvable. > What if, instead of relying on the compiler to spill the IP register, we manually spill it ourselves, to a known location? It works. Example: https://godbolt.org/z/ftSDnp This diff implements this approach across the whole interpreter loop: whenever we call out of the loop we capture/publish the IP and restore it again immediately after the external call returns. This means we can now see the IP outside the interpret loop and even change it. This is effectively "for free" as the compiler now skips spilling/restoring the IP behind the scenes. The immediate benefit of this is knowing the current IP allows us to have more accurate stack-traces during execution. In future this may enabled tricks like changing the IP before returning to the interpreter loop, allowing things outside the interpreter to affect program flow without adding logic to the interpreter loop. Reviewed By: tmikov Differential Revision: D20151091 fbshipit-source-id: 3814382639800208d8985a32ede31ba8f7ff7c80 * Plumb through memory allocation profiler feature to Chrome Inspector Summary: Changelog: Make allocation profiler feature of Chome Inspector work Reviewed By: dulinriley Differential Revision: D20383003 fbshipit-source-id: 8a10c310d5a639a6644763adb53f2f0017057587 * chore: update lint config in template (#28443) Summary: Updating the eslint config and metro-preset used in project template. ## Changelog [General] [Changed] - Upgrade eslint-config and metro-preset in project template Pull Request resolved: https://github.com/facebook/react-native/pull/28443 Test Plan: - Start new project with `npx react-native init TestLint` - upgrade lint and metro-config - run lint and start up emulator on iOS and android Reviewed By: cpojer Differential Revision: D20771048 Pulled By: hramos fbshipit-source-id: a6d387b8687cee348681bcb10d22c7e3de291ed7 * Apply buckformat in preparation for updating buildifier Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D20773287 fbshipit-source-id: 144bb13191312eef246646b99e1dc06304c6d210 * Circle CI Housekeeping: Windows, e2e (#28471) Summary: Circle CI Housekeeping: * Integrate Windows job into `tests` workflow * Add parametrized e2e tests command * Move js e2e tests out of the disabled test quarantine area * Parametrize and split `test_ios` job to reduce total execution time by ~13 minutes **Before:** Longest running iOS job at 39 minutes. | Setup Job Runtime | Job | Job Runtime | Total Runtime | | - | - | - | - | | 01:24 | test_ios | 38:04 | **39:28** | | 01:24 | test_ios_frameworks | 38:02 | 39:26 | ![Screen Shot 2020-03-31 at 12 40 29 PM](https://user-images.githubusercontent.com/165856/78068308-044c3280-734d-11ea-96bf-2e50691a0ef7.png) **After:** Longest running iOS job down to 26 minutes. | Setup Job Runtime | Job | Job Runtime | Total Runtime | | - | - | - | - | | 01:26 | test_ios_unit | 20:48 | 22:14 | | 01:26 | test_ios_unit_frameworks | 22:52 | 24:18 | | 01:26 | test_ios_detox | 24:35 | 39:28 | | 01:26 | test_ios_detox_frameworks | 24:54 | **26:20** | ![Screen Shot 2020-03-31 at 12 39 22 PM](https://user-images.githubusercontent.com/165856/78068294-fe565180-734c-11ea-96da-8836231d7747.png) ## Changelog [Internal] [CI] - CI Housekeeping Pull Request resolved: https://github.com/facebook/react-native/pull/28471 Test Plan: Circle CI Reviewed By: cpojer Differential Revision: D20774521 Pulled By: hramos fbshipit-source-id: 4a2f5a4083cd76dcb51d5ccaf726cd204fca222e * Fix bug in optimized differ Summary: The differ was still producing correct, but not minimal, instruction sets in some cases due to an optimization that was buggy. This affected cases where 2+ nodes were inserted at the beginning of a list. It would trigger the old behavior where all nodes after the first would be removed, deleted, then reinserted. See the test case (which was failing and now passed) and P128190998 (the 3->4 transition) for samples. Changelog: [Internal] Fabric differ Reviewed By: mdvacca Differential Revision: D20785729 fbshipit-source-id: 2fea6a816753066abb358ed7bb51003140cd5fc4 * Use `buildCodeFrameError` in babel-plugin-inline-view-configs Summary: The next version of Babel changes how it prints file names in errors. This diff fixes the test by using `/` as the `cwd` and switches the plagin to use `path.buildCodeFrameError` so errors will be more helpful for users. I renamed the `nodePath` variable to `path` because that's what babel plugins usually do. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D20781805 fbshipit-source-id: cc149dce6389aa9402ce70ea30035c74a6150ea3 * Swap left and right yoga position with start and end in RTL context Summary: Changelog: [Internal] Paper swaps right and left in RTL setting, this logic is in [RCTShadowView.m](https://our.intern.facebook.com/intern/diffusion/FBS/browse/master/xplat/js/react-native-github/React/Views/RCTShadowView.m?commit=cdd504cfbee66ae0659495604c4ff7b5764a1d9e&lines=529-549). For Fabric instead of doing it during yoga props assignment, I swap the left/right with start/end just before we pass yoga nodes to layout calculation. Reviewed By: shergin Differential Revision: D20420040 fbshipit-source-id: b777f2658f56c173743b2034b8b5059e3e0c9840 * Fix inline-view-configs test on Windows. Summary: *facepalm* The file path is platform specific. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D20793023 fbshipit-source-id: 4fbcbf982911ee449a4fa5067cc0c5d81088ce04 * Pass isRTL flag from FabricUIManager Fabric core Summary: Changelog: [Internal] Send `isRTL` flag and `doLeftAndRightSwapInRTL` flags from Java to Fabric Core. Reviewed By: JoshuaGross, mdvacca Differential Revision: D20776005 fbshipit-source-id: 946c239d9a11ebea958b0a6d04f2316b7cd77311 * Promote shadowColor to formsStackingContext property Summary: Changelog: [Internal] View with `ShadowColor` was getting flattened and therefore views didn't have shadow property set. This is fixed by promoting ShadowColor so in case it is set, it forms stacking context. Reviewed By: shergin Differential Revision: D20792201 fbshipit-source-id: 1033ac00e32047ffbb14e61b7c26348c578d132d * Get CallInvokers from the bridge Summary: ## Context For now, assume TurboModules doesn't exist. **What happens when we call an async NativeModule method?** Everytime JS calls an async NativeModule method, we don't immediately execute it. The legacy infra pushes the call into some queue managed by `MessageQueue.js`. This queue is "flushed" or "emptied" by the following events: - **Flushed:** A C++ -> JS call. NativeModule async methods can called with an `onSuccess` and/or `onFail` callback(s). Calling `NativeToJsBridge::invokeCallback` to invoke one of these callbacks is one way for ObjC++/C++/Java to call into JS. Another way is via JSModule method calls, which are initiated by `NativeToJsBridge::callFunction`. - **Flushed:** When `JSIExecutor::flush` is called. Since TurboModules don't exist, this only happens when we call `JSIExecutor::loadApplicationScript`. - **Emptied:** When more than 5 ms have passed, and the queue hasn't been flushed/emptied, on the next async NativeModule method call, we add to the queue. Afterwards, we empty it, and invoke all the NativeModule method calls. **So, what's the difference between flushed and emptied?** > Note: These are two terms I just made up, but the distinction is important. If the queue was "flushed", and it contained at least one NativeModule method call, `JsToNativeBridge` dispatches the `onBatchComplete` event. On Android, the UIManager module is the only module that listens to this event. This `onBatchComplete` event doesn't fire if the queue was "emptied". **Why does any of this matter?** 1. TurboModules exist. 2. We need the TurboModules infra to have `JsToNativeBridge` dispatch `onBatchComplete`, which depends on: - **Problem 1:** The queue being flushed on calls into JS from Java/C++/ObjC++. - **Problem 2:** There being queued up NativeModule async method calls when the queue is flushed. In D14656466, fkgozali fixed Problem 1 by making every C++/Java/Obj -> JS call from TurboModules also execute `JSIExecutor::flush()`. This means that, with TurboModules, we flush the NativeModule async method call queue as often as we do without TurboModules. So far, so good. However, we still have one big problem: As we convert more NativeModules to TurboModules, the average size of the queue of NativeModule method calls will become smaller and smaller, because more NativeModule method calls will be TurboModule method calls. This queue will more often be empty than not. Therefore, we'll end up dispatching the `onBatchComplete` event less often with TurboModules enabled. So, somehow, when we're about to flush the NativeModule method call queue, we need `JsToNativeBridge` to understand that we've executed TurboModule method calls in the batch. These calls would have normally been queued, which would have led the queue size to be non-zero. So if, during a batch, some TurboModule async method calls were executed, `JsToNativeBridge` should dispatch `onBatchComplete`. **So, what does this diff do?** 1. Make `Instance` responsible for creating the JS `CallInvoker`. 2. Make `NativeToJsBridge` responsible for creating the native `CallInvoker`. `Instance` calls into `NativeToJsBridge` to get the native `CallInvoker`. 3. Hook up `CatalystInstanceImpl`, the Android bridge, with the new JS `CallInvoker`, and the new native `CallInvoker`. This fixes `onBatchComplete` on Android. iOS work is pending. Changelog: [Android][Fixed] - Ensure `onBatchComplete` is dispatched correctly with TurboModules Reviewed By: mdvacca Differential Revision: D20717931 fbshipit-source-id: bc3ccbd6c135b7f084edbc6ddb4d1e3c0c7e0875 * Make HermesRuntime::description() always include "HermesRuntime" Summary: If name is passed in as part of RuntimeConfig, that is included in the description, too. Changelog: [Internal] Reviewed By: dulinriley Differential Revision: D20716320 fbshipit-source-id: f2fba6df32f496090dee787d8b7f55a6a4dd8ed8 * Fix Yoga flexshrink with min-width sizing issue Summary: While resolving the flexible items we calculate totalFlexShrinkScaledFactors which uses the flexBasis or initial width of node (Not min-width). At a later stage during distribution of space we are subtracting value from this which also takes care of min-width. For example If node has flexShrink 1 and width 100 and min-width 301 then totalFlexShrinkScaledFactors will become -1*100 = -100 but later we are subtracting -1 * 301 (min-width) = -301 which is ambiguous and causing layout inconsistencies with how web behaves. Fixed this by only using the flexBasis or width for these calculations. Changelog: [Internal][Yoga] Fix layout issue when flexShrink and min-width are used together Reviewed By: pasqualeanatriello Differential Revision: D20219419 fbshipit-source-id: 948fbc06ca541d4ad307c88c8a2df65d157778b1 * More consistent snapshots on windows (#28482) Summary: Get jest tests to be runnable on windows, and match current snapshots ## Changelog [Internal] [Fixed] - More consistent snapshots on windows Pull Request resolved: https://github.com/facebook/react-native/pull/28482 Test Plan: run `yarn test` on a windows machine, and hit the test_windows circleci tests Reviewed By: hramos Differential Revision: D20799002 Pulled By: cpojer fbshipit-source-id: da3db0171c34a43199c7d3dc17b622b37bc91701 * Improve component stack parsing Summary: Update the error log message parsing to fix missing component stacks in console.errors. Changelog: [Internal] Reviewed By: cpojer Differential Revision: D20801985 fbshipit-source-id: ae544200315a8c3c0310e8370bc38b0546734f38 * Implement RCTWarn equivalent on Android Summary: ## Overview This diff is an RFC to port a logging feature from iOS to Android. Changelog: [Internal] ## Motivation On iOS we have the following log functions and behaviors available for logging native warnings and errors: - **Warnings** (`RCTLogWarn`) - Log level 'warn' to console - Display warning in LogBox - **Errors** (`RCTLogError`) - Log level 'error' to console - Display a native RedBox (needs converted to show a LogBox if available) - **Logs** - We also have `RCTLog`, `RCTTrace`, `RCTAdvice`, `RCTInfo`, which just log to the console. In Java, we have: - **Warnings** - **None**, added in this diff - **Errors** (`DevSupportManager.showNewJavaError`) - Log level 'error' to console with `FLog.e` - Display a native RedBox (needs converted to show a LogBox if available - **Logs** - `ReactSoftException` (crashes the app??) - `ReactNoCrashSoftException` (only logs??) - Others? ## Details This diff adds a method to pair with `RCTLogWarn`, `DevSupportManager.showNewJavaWarning`, which will log to the console and show a LogBox warning if LogBox is available. ## Concerns I have a few concerns/questions about the state of logging on Android: - Should/can we move all of the logging to it's own class, like how RCTLog works? - Why does some logging happen on DevSupportManager and some in other classes? - If we moved it all to it's own class, how could we access the reactContext to call the RCTLog JS module Reviewed By: JoshuaGross Differential Revision: D20056394 fbshipit-source-id: 32d57e300685e46da8039fc77cb22b4084acf81a * Remove unused feature flag: useMapNativeAccessor Summary: useMapNativeAccessor isn't being used anywhere. Changelog: [Internal] Removing unused internal feature flags: mUseMapNativeAccessor and mUseArrayNativeAccessor Reviewed By: mdvacca Differential Revision: D20788147 fbshipit-source-id: bf670508326813602cb544f86d3d2164651d3394 * Remove unused Feature Flag: lazilyLoadViewManagers Summary: Remove unused feature flag. This is not used within Facebook and I'm not aware of usage outside of FB. Changelog: [Removed] Removing Android feature flag: lazilyLoadViewManagers Reviewed By: mdvacca Differential Revision: D20788210 fbshipit-source-id: 435316e3de7830d7cb7f14537351883e4fc6eeaa * Remove unused feature flag: enableExtraWebViewLogs Summary: Hard-coded to false everywhere, and write-only. We never read from this. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20788252 fbshipit-source-id: ae117ebc51db7045947b9713602527ff4220833e * Remove unused feature flag: logDroppedViews Summary: Remove unused internal feature flag, logDroppedViews. Changelog: [Internal] Reviewed By: lunaleaps Differential Revision: D20797353 fbshipit-source-id: 1bfea7fcce9e80cdb92cda59a89c7dd817d4a581 * Split loadApplicationScript into initializeRuntime and loadBundle (#27844) Summary: This is the first of three PRs related to enabling multi-bundle support in React Native. More details, motivation and reasoning behind it can be found in RFC [here](https://github.com/react-native-community/discussions-and-proposals/issues/152). Logic responsible for installing globals was pulled out from `loadApplicationScript` to `initializeRuntime` since it should be ran only once, what was left was renamed to `loadBundle`. It's based on dratwas work from [here](https://github.com/callstack/react-native/tree/feat/multibundle/split-load-application), but applied to current `master` to avoid rebasing 3-months old branch and issues that come with that. ## Changelog [Internal] [Changed] - split `loadApplicationScript` into `initializeRuntime` and `loadBundle` to enable multi-bundle support in the future Pull Request resolved: https://github.com/facebook/react-native/pull/27844 Test Plan: Initialized new RN app with CLI, set RN to build from source and verified the still app builds and runs OK using code from this branch. Reviewed By: rickhanlonii Differential Revision: D19888605 Pulled By: ejanzer fbshipit-source-id: 24ace48ffe8978796591fe7c6cf53a61b127cce6 * Back out "Fix controlled TextInput with child nodes" Summary: Changelog: [Internal] Original commit changeset: 1b8a2efabbfa Original diff D20587681 breaks non-controlled text input. Reviewed By: motiz88 Differential Revision: D20815935 fbshipit-source-id: 70577ed1e5701850ff0e30a6592945a31c2a8bec * Fixed crash in JSIExecutor::NativeModuleProxy Summary: JSIExecutor::NativeModuleProxy is an object created by JSIExecutor and essentially representing that in JavaScript world. Before this change, JSIExecutor::NativeModuleProxy had a raw reference to JSIExecutor which (I believe) caused a crash because JSIExecutor can be deallocated before JSIExecutor::NativeModuleProxy. Now, instead of storing a pointer to JSIExecutor, we store a weak pointer to JSINativeModules which we can safely validate before calling on it. Changelog: [Internal] Fixed crash in JSIExecutor Now the configuration looks like this: ``` + - - - - - - - - - - - - - - - - - - - - - Something else | | shared_ptr<jsi::Runtime> runtime --+ | | + - - - - - - - - - - - - - - - - - - - - - | | | +------------------------------------------+ | | | | | JSExecutorFactory | | +--------------------------------+-------------------------------+ | | +-----------------------+ | | | +------------------------------------------+ | | v | | | +------------------------------------------+ | +--------------------------+ | | | | | | | | ModuleRegistry | | v | | | | | +------------------------------------------+ | | +------------------------------------------+ | | HermesRuntimeImpl | | | | | | (jsi::Runtime) |--+ | | +->+------------------------------------------+ | | | | | | | |std::unordered_map<std::string, size_t> | | +------------------------------------------+ | | | | |modulesByName_ | | | | | | | | | | | | | +------------------------------------------+ | | | | +->+------------------------------------------+ | +-----------------------+ | | |std::vector<std::unique_ptr<NativeModule>>| | | | | |modules_ | | | | | | | | v | | +------------------------------------------+ | +------------------------------------------+ | | | | | | | | | JSIExecutor::NativeModuleProxy | | | | | | | | | +------------------------------------------+ | | | +------------------------------------------+ | | | | | | +->+------------------------------------------+ | | | | NativeToJsBridge | |shared_ptr<JSINativeModules> | | | | | | |nativeModules_ | | | | +------------------------------------------+ +------------------------------------------+--+-----+------------------------------------+ | | | | | | +->+------------------------------------------+ | | | | | |unique_ptr<JSExecutor> | | | | | | |m_executor | | | | | | |(`::destroy()` resets it.) | | | | | | +------------------------------------------+--------------------------------+ | | | | +->+------------------------------------------+ | | | | | | |shared_ptr<JsToNativeBridge> | | | | | | | |m_delegate | | | | | | | +------------------------------------------+--+ v | | | | +->+------------------------------------------+ | +------------------------------------------+ | | | | |shared_ptr<MessageQueueThread> | | | | | | | | |m_executorMessageQueueThread | | | HermesExecutor: JSIExecutor: JSExecutor | | | | | +------------------------------------------+ | | | | | | | | +------------------------------------------+ | | | | | | | | | | | +->+------------------------------------------+ | | | | | | |shared_ptr<jsi::Runtime> | | | | | | | |runtime_ | | | | | | | +------------------------------------------+--+ | | | | +->+------------------------------------------+ | | | | | |shared_ptr<JSINativeModules> | | | | | | |nativeModules_ | | | | | | +------------------------------------------+--------+------------------------------------+ | +--------------------------+ +->+------------------------------------------+ | | | | |std::shared_ptr<ExecutorDelegate> | | v | | |delegate_ | | +------------------------------------------+ | | +------------------------------------------+--+ | | | | | | | | JSINativeModules | | | | | | | | | | | +------------------------------------------+ | | | | | | | | | +-->+------------------------------------------+ | +-----------------------------------------------------------------------------------+ | |m_moduleRegistry | | | | |(shared_ptr) | | | | +------------------------------------------+--+ | | | | v | +------------------------------------------+ | | | | | JsToNativeBridge: ExecutorDelegate | | | | | +------------------------------------------+ | | | +->+------------------------------------------+ | |shared_ptr<ModuleRegistry> | | |m_registry | | +------------------------------------------+-----------------------------------------------------------------+ ``` Reviewed By: RSNara Differential Revision: D20817257 fbshipit-source-id: 9ae378dbe880aaabfef7ae783dae2f94ee4b0af5 * Fix crash caused by <Modal> trying to present view controller twice Summary: Changelog: [Internal] `_viewController` was being presented twice causing following exception ``` 'Application tried to present modally an active controller <FBReactRootViewController: 0x7fe741818b80; ``` Reviewed By: shergin Differential Revision: D20820395 fbshipit-source-id: 5c9489011e5f99d8bd37befbd544d2d55a650589 * Loosen up restrictions for internal changelogs (#28486) Summary: Do not nag on PRs that contain internal changelogs (meaning, the change doesn't need to be called out in release notes). ## Changelog [Internal] - This should be acceptable. Pull Request resolved: https://github.com/facebook/react-native/pull/28486 Test Plan: See PR. Reviewed By: cpojer Differential Revision: D20817454 Pulled By: hramos fbshipit-source-id: a7082c4db05ec53ad27349db7e5bce2cfffd6930 * Fix TextInlineViews when UIImplementation processes two roots at the same time Summary: This diff cleans the variable NativeViewHierarchyOptimizer.mTagsWithLayoutVisited right after all the view updates for a rootShadowNode have been processed by the UIImplementation class. This intends to fix the bug reported in the task: T61185028, which root cause seems related to the fact that the variable NativeViewHierarchyOptimizer.mTagsWithLayoutVisited is not cleaned up when updating multiple rootShadowNodes as part of the same batch changelog: [Android][internal] internal bug fix Reviewed By: JoshuaGross Differential Revision: D20812921 fbshipit-source-id: 28067ee29a931d7a9e9c33c90aceb4e3512dac1a * Add a React Feature Flag to control TextInlineView fix Summary: This diff adds a temporary Feature Flag to control a fix in TextInlineView (see previous diffs of the stack) changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D20812920 fbshipit-source-id: 90fece9b29ba173546d96e4d9baf1ccabb3031b2 * Pass native CallInvoker to ObjCTurboModule constructor Summary: This is necessary to integrate TurboModule async method dispatch with the bridge's `onBatchComplete` event. See D20717931 for more details. This diff is similar to D20480971. **Note:** This stack doesn't really make any functional changes, since the native CallInvoker is `nullptr` right now. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809199 fbshipit-source-id: bf465a3a51bdddb8b56d1e696ca510fdf071f9ec * Manual changes required to make ObjCTurboModule accept native CallInvoker Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809200 fbshipit-source-id: d540eec9a3360a031f75d76a6ab9fb15303f8af5 * Codemod all getTurboModuleWithJsInvoker methods to accept a native CallInvoker Summary: To make iOS TurboModules integrate with the bridge's onBatchComplete event, they need to use a native CallInvoker. This call invoker is created by the `NativeToJsBridge`, and ObjCTurboModule will use this native CallInvoker to dispatch TurboModule method calls. This diff makes sure that ObjCTurboModules are created with that native CallInvoker. ## Script ``` var withSpaces = (...args) => args.join('\s*') var regexString = withSpaces( '-', '\(', 'std::shared_ptr', '<', '(?<turboModuleClass>(facebook::react::|react::|::|)TurboModule)', '>', '\)', 'getTurboModuleWithJsInvoker', ':', '\(', 'std::shared_ptr', '<', '(?<callInvokerClass>(facebook::react::|react::|::|)CallInvoker)', '>', '\)', '(?<jsInvokerInstance>[A-Za-z0-9]+)', 'perfLogger', ':', '\(', 'id', '<', 'RCTTurboModulePerformanceLogger', '>', '\)', '(?<perfLoggerInstance>[A-Za-z0-9]+)', '{', 'return', 'std::make_shared', '<', '(?<specName>(facebook::react::|react::|::|)Native[%A-Za-z0-9]+SpecJSI)', '>', '\(', 'self', ',', '\k<jsInvokerInstance>', ',', '\k<perfLoggerInstance>', '\)', ';', '}', ) var replaceString = `- (std::shared_ptr<$<turboModuleClass>>) getTurboModuleWithJsInvoker:(std::shared_ptr<$<callInvokerClass>>)$<jsInvokerInstance> nativeInvoker:(std::shared_ptr<$<callInvokerClass>>)nativeInvoker perfLogger:(id<RCTTurboModulePerformanceLogger>)$<perfLoggerInstance> { return std::make_shared<$<specName>>(self, $<jsInvokerInstance>, nativeInvoker, $<perfLoggerInstance>); }` const exec = require('../lib/exec'); const abspath = require('../lib/abspath'); const relpath = require('../lib/relpath'); const readFile = (filename) => require('fs').readFileSync(filename, 'utf8'); const writeFile = (filename, content) => require('fs').writeFileSync(filename, content); function main() { const tmFiles = exec('cd ~/fbsource && xbgs -n 10000 -l getTurboModuleWithJsInvoker:').split('\n').filter(Boolean); tmFiles .filter((filename) => !filename.includes('microsoft-fork-of-react-native')) .map(abspath) .forEach((filename) => { const source = readFile(filename); const newSource = source.replace(new RegExp(regexString, 'g'), replaceString); if (source == newSource) { console.log(relpath(filename)); } writeFile(filename, newSource); }); } if (!module.parent) { main(); } ``` Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809202 fbshipit-source-id: 5d39b3cacdaa5681b70ce1803351d0432dd74550 * Make RCTTurboModuleManagerDelegate getTurboModule accept native CallInvoker and PerfLogger Summary: Might be worthwhile to just kill this method instead, since we're having all NativeModules provide their TurboModule jsi::HostObjects. But I'll leave that decision to a later time. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809201 fbshipit-source-id: ee73d4b5454a76460832a54f9b864841e5b2b9c0 * eslint-config: add version badge and add homepage for eslint-config (#28506) Summary: Add version badge to README of eslint-config, and add specific url for the homepage so people looking at the npm package can find out where the package is from. ## Changelog [Internal] [Changed] - Add version badge to README of eslint-config Pull Request resolved: https://github.com/facebook/react-native/pull/28506 Test Plan: Not required as the only changes are made in README and homepage prop of package.json Differential Revision: D20837085 Pulled By: cpojer fbshipit-source-id: 820d3b44b069780ec8764c6152d2e7fd5220933c * Rename Instance::getNativeCallinvoker to Instance::getDecoratedNativeCallInvoker Summary: Now, instead of accepting a `std::function` that schedules work, and returning a `CallInvoker`, `Instance::getDecoratedNativeCallInvoker` will accept a `CallInvoker` that schedules work, and return a decorated `CallInvoker`. I think this change will help with readability. It also clarifies that the bridge is adding additional behaviour to the native `CallInvoker`. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20826885 fbshipit-source-id: a2c5681d10a4544ee3d2a0d1f1cbd386ef06d0e6 * Add CallInvoker::invokeSync Summary: We'll be using a native CallInvoker to dispatch sync and async method calls to ObjC NativeModules. This native CallInvoker will hold a reference to the ObjC NativeModule's method queue. **Why is the native CallInvoker required for ObjC NativeModules?** In the case where the ObjC NativeModule neither provides nor requests a method queue, we must create a method queue for it. When we go to invoke a method from JS, for these NativeModules specifically, there is no way to access this method queue. A native CallInvoker is a convenient abstraction that holds on to that method queue. For async calls, we'll just call `CallInvoker::invokeAsync`, and for sync calls, we'll just call `CallInvoker::invokeSync`. **Why do we need sync call support for native `CallInvoker`?** In ObjC, sync NativeModule method calls block the JS thread, then execute synchronously on the NativeModule's method queue, and then unblock the JS thread. This is what'll be implemented by `CallInvoker::invokeSync`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20829955 fbshipit-source-id: efb9d5408a1ade81069a943c865f232d4d10acfe * Export Instance::getDecoratedNativeCallInvoker from RCTCxxBridge Summary: `RCTTurboModuleManager` will create a native `CallInvoker` for each ObjC NativeModule. This `CallInvoker` will be used to dispatch calls from JS to native. Before passing the native `CallInvoker` to the `ObjCTurboModule`, it'll first use `RCTCxxBridge decorateNativeCallInvoker` to get a bridge-aware decorated native `CallInvoker`. That way, the bridge remains informed about async TurboModule method calls that took place since the last time it was flushed. This ensures that we don't end up dispatching `onBatchComplete` any less with TurboModules on than we do with TurboModules off. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20831546 fbshipit-source-id: b2eb4e0097e0dabf8c4bd8fdc4c850a0858af699 * Add Author Feedback label automatically (#28484) Summary: Improve issue triage by automatically adding the "Needs: Author Feedback" label. NOTE: The old label-actions app should be disabled when this PR is merged: https://github.com/apps/label-actions/installations/7445225 ## Changelog [Internal] - Issue Triage Pull Request resolved: https://github.com/facebook/react-native/pull/28484 Test Plan: Verified the same `label-actions.yml` and workflow config on a private repo. Reviewed By: cpojer Differential Revision: D20817443 Pulled By: hramos fbshipit-source-id: 39732dd67509c9fb9cf6ff7306913f5ec088266d * docs: add README and specify file in package.json (#28507) Summary: Adding a README for `react-native-codegen` since the package was published. Also added a `files` prop in package.json so unused file won't be included in the package. ## Changelog [Internal] [Changed] - Add README for react-native-codegen. Pull Request resolved: https://github.com/facebook/react-native/pull/28507 Test Plan: verify js files to function correctly without including files other than `src` Reviewed By: rickhanlonii Differential Revision: D20836113 Pulled By: cpojer fbshipit-source-id: e860f14760e9c1dbe121f5fb95ccf72d4ddb2af1 * Make the link easier to copy. (#28516) Summary: Making a PR from GitHub, I need to copy-paste the link, and it would be easier to just triple-click a line with the URL rather than carefully selecting the URL from the text. <img width="723" alt="Screen Shot 2020-04-03 at 17 33 47" src="https://user-images.githubusercontent.com/100233/78378550-6c12af80-75d1-11ea-93a4-2eae568ce602.png"> ## Changelog [General] [Changed] - Make PR template easier to use with changelog URL. Pull Request resolved: https://github.com/facebook/react-native/pull/28516 Reviewed By: fkgozali Differential Revision: D20842238 Pulled By: hramos fbshipit-source-id: 3fef7a994f36a996bbbc52556600d468a56210a9 * Upgrade tests to Xcode 11.3.1 (#28498) Summary: Upgrade Sandcastle and Circle CI tests to use Xcode 11.3.1 across the board. Pull Request resolved: https://github.com/facebook/react-native/pull/28498 Pull Request resolved: https://github.com/facebook/react-native/pull/28501 Changelog: [Internal] - Use Xcode 11.3.1 in iOS tests Reviewed By: fkgozali Differential Revision: D20821844 fbshipit-source-id: b250ca82bdf2c9fb7faa765d3e2433eb46efd692 * Fixes iOS reload through metro "r" command key (#28477) Summary: This allows the iOS device to be reloaded through the metro command line, besides the fact that whenever packagerServerHost is called, it will only get the IP address once when debugging. ## Changelog [iOS] [Fixed] - Fixed connection of metro reload command to iOS device Pull Request resolved: https://github.com/facebook/react-native/pull/28477 Test Plan: - Build any react-native project in debug mode to an iOS device connected through USB - Press the “r” key on the terminal that is running metro - The device should now reload the project Reviewed By: cpojer Differential Revision: D20818462 Pulled By: TheSavior fbshipit-source-id: 6d9792447d205223dad8fbd955518885427cbba8 * Create method queues for NativeModules that neither provide nor request one Summary: ## Problem: Let `A` be the set of all ObjC NativeModules that neither provide nor reqeust a method queue. The TurboModule system dispatches all method calls to NativeModules in `A` synchronously to the JS thread. Here is the relevant logic: **RCTTurboModule.mm:** Link: https://fburl.com/diffusion/nz9gqje8 ``` jsi::Value performMethodInvocation( // ... ) { // ... dispatch_queue_t methodQueue = NULL; if ([instance_ conformsToProtocol:protocol(RCTBridgeModule)] && [instance_ respondsToSelector:selector(methodQueue)]) { methodQueue = [instance_ performSelector:selector(methodQueue)]; } if (methodQueue == NULL || methodQueue == RCTJSThread) { // This is the default mode of execution: on JS thread. block(); } else if (methodQueue == dispatch_get_main_queue()) { ``` **Why does this end up happening?** 1. NativeModules that request a method queue have `synthesize methodQueue = _methodQueue` in their `implementation` section. This generates a `methodQueue` getter for the NativeModule, and also creates an ivar to back that getter. The TurboModule system generates a `dispatch_queue_t` and uses ObjC's KVC API to write to the ivar. So in the above logic, for NativeModules that provide a method queue, methodQueue will neither be `NULL` nor `RCTJSThread`, so we don't dispatch synchronously to the JS thread. 2. NativeModules that provide a method queue will return something that is not `NULL` or something that is `RCTJSThread`. If they return `NULL`, the infra will throw an error early. If they return `RCTJSThread`, we'll dispatch synchronously to the JS thread, as we should (...wait. For async NativeModule methods that dispatch to `RCTJSThread`, should we dispatch asynchronously to the JS thread, via jsInvoker? **Edit:** Nope: https://fburl.com/diffusion/ivt9b40s.). In all other cases, we dispatch to appropriately to the respective method queue. 3. For NativeModules that neither provide nor request a method queue (i.e: NativeModules in `A`), they don't implement the `methodQueue` selector. Therefore, we dispatch synchronously to the JS thread. ## The fix (Part 1): The first step towards fixing this problem is to generate `dispatch_queue_t`s for NativeModules in `A`. That's what this diff accomplishes. Changelog: [iOS][Fixed] - Create method queue for NativeModules that don't provide nor request one. Reviewed By: fkgozali Differential Revision: D20821054 fbshipit-source-id: 17a73550ad96766c5c7e719e28e1cc879e36465c * Rename duplicate name `<ScrollView>` example on RNTester (#28515) Summary: Tiny change. When searching for `scro` in the RNTester, two `<ScrollView>`s come up, from different example files. One is the "simple" one and the other is the "regular" one. Before: <img width="370" alt="Screen Shot 2020-04-03 at 17 14 01" src="https://user-images.githubusercontent.com/100233/78377338-c6ab0c00-75cf-11ea-9c45-2dcdd6460f6d.png"> After: <img width="369" alt="Screen Shot 2020-04-03 at 17 13 38" src="https://user-images.githubusercontent.com/100233/78377371-cf034700-75cf-11ea-89ea-aa3ff2f3988c.png"> ## Changelog [Internal] [Changed] - Rename the "simple" ScrollView example in RNTester to "ScrollSimpleView". Pull Request resolved: https://github.com/facebook/react-native/pull/28515 Test Plan: - Try to search for `scro` in RNTester. Reviewed By: fkgozali Differential Revision: D20842264 Pulled By: hramos fbshipit-source-id: 3db54a826ae774108e62690e7f154e85b541520f * Fix Fabric SSTs, so they actually run in Fabric instead of Paper, convert ServerSnapshotTestsAppImpl to functional component Summary: Update instrumentation test infra for Fabric tests. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D19961919 fbshipit-source-id: 17264b6308712dddece730effd57832817e148cf * Fixed scrollview inset when RN view is embedded in another view (#27607) Summary: I'm using RNN, which embeds RN view inside native view controllers. On iOS 13, a modal view controller is "floating" and is offset from the top of the screen. This causes the calculation of inset in `KeyboardAvoidingView` incorrect as it mixes local view controller coordinate space, with keyboard's screen coordinate space. ## Changelog [iOS] [Fixed] - Fixed `KeyboardAvoidingView` inset in embedded views (i.e modal view controllers on iOS 13) Pull Request resolved: https://github.com/facebook/react-native/pull/27607 Test Plan: 1. Tested before and after in a simple view controller (should stay the same) 2. Tested before and after in a modal view controller (should be offset before, and fixed after) 3. Repeated no. 2 with each device rotation (upsideDown, landscapeLeft, landscapeRight) Reviewed By: cpojer Differential Revision: D20812231 Pulled By: TheSavior fbshipit-source-id: fbd72739fb7152655028730e284ad26ff4a5da73 * Bump react-native-codegen to 0.0.2 Summary: Changelog: [Internal] Reviewed By: cpojer Differential Revision: D20843514 fbshipit-source-id: c611bf91d311c6ce8a7e469d267a0417b2ee58e5 * Rename ScrollViewSimpleExample Summary: Changelog: [Internal] - Rename ScrollViewSimpleExample in RNTester Reviewed By: fkgozali Differential Revision: D20846977 fbshipit-source-id: 397589cb0a17beaf37a25b91ad8efa4a2bc62358 * Remove console warnings for innerViewNode/Ref Summary: Remove these warnings until the methods in ScrollResponder have been moved into ScrollView, so that unactionable warnings aren't firing. Changelog: [General][Removed] Remove console warnings for innerViewNode/Ref in ScrollView Reviewed By: TheSavior Differential Revision: D20850624 fbshipit-source-id: ce90988e204c3cc3b93536842ec3caa12cf6994e * Make TurboModules dispatch method calls via native CallInvoker Summary: This diff: 1. Has ObjC NativeModules use the native `CallInvoker` to invoke JS -> native sync/async calls. 2. Integrates the native `CallInvoker` for each ObjC NativeModule with the bridge. This way, the bridge is informed of all JS -> native TurboModule method calls, and dispatches `onBatchComplete` appropriately. Changelog: [iOS][Fixed] Integrate ObjC TurboModules async method calls with the bridge Reviewed By: fkgozali Differential Revision: D20831545 fbshipit-source-id: da1cbb4ecef4cae85841ca7ef625ab8e380760cd * add ripple config object to Pressable (#28156) Summary: Motivation is to support ripple radius just like in TouchableNativeFeedback, plus borderless attribute. See https://github.com/facebook/react-native/pull/28009#issuecomment-589489520 In the current form this means user needs to pass an `android_ripple` prop which is an object of this shape: ``` export type RippleConfig = {| color?: ?ColorValue, borderless?: ?boolean, radius?: ?number, |}; ``` Do we want to add methods that would create such config objects - https://facebook.github.io/react-native/docs/touchablenativefeedback#methods ? ## Changelog [Android] [Added] - support borderless and custom ripple radius on Pressable Pull Request resolved: https://github.com/facebook/react-native/pull/28156 Test Plan: Tested locally in RNTester. I noticed that when some content is rendered after the touchables, the ripple effect is "cut off" by the boundaries of the next view. This is not specific to Pressable, it happens to TouchableNativeFeedback too but I just didn't notice it before in https://github.com/facebook/react-native/pull/28009. As it is an issue of its own, I didn't investigate that. ![pressable](https://user-images.githubusercontent.com/1566403/75098762-785f2200-55ba-11ea-8842-e648317610e3.gif) I changed the Touchable example slightly too (I just moved the "custom ripple radius" up to show the "cutting off" issue), so just for completeness: ![touchable](https://user-images.githubusercontent.com/1566403/75098763-81e88a00-55ba-11ea-9528-e0343d1e054b.gif) Reviewed By: yungsters Differential Revision: D20071021 Pulled By: TheSavior fbshipit-source-id: cb553030934205a52dd50a2a8c8a20da6100e23f * Make TurboModule creation thread-safe Summary: NativeModules can be created from any number of threads. In the legacy system, `ModuleHolder`, the class responsible for creating NativeModules, has built-in concurrency control to ensure that NativeModule creation is thread-safe. This diff introduces that thread-safety to the TurboModule infra. Basically, after this diff, if `n` threads race to create a TurboModule x, only the first thread will create x. All other threads will wait until x is created. Changelog: [Android][Fixed] - Make TurboModule creation thread-safe Reviewed By: mdvacca Differential Revision: D20659799 fbshipit-source-id: 2b720fe1ea49e40ae0d6dae50d422f23a6f45520 * Remove unused fields from error dialog Summary: Removed in https://github.com/facebook/react/pull/18487 Changelog: [React Core] Logging changes Reviewed By: gaearon Differential Revision: D20853086 fbshipit-source-id: 4b0002f21269f415769a2ac8305ba5750245f7d1 * Fix crash when enabling Performance Monitor on iOS 13.4 (#28512) Summary: This PR fixes a crash when opening the Performance Monitor on iOS 13.4. Detailed info: https://github.com/facebook/react-native/issues/28414 ## Changelog `[iOS] [Fixed] - Fix crash when enabling Performance Monitor on iOS 13.4` ## How This PR prevents the JavaScriptCore option from being set altogether. This ensures that the performance monitor keeps working, but on iOS 13.4 and higher, it will no longer crash trying to show the GC usage. Pull Request resolved: https://github.com/facebook/react-native/pull/28512 Test Plan: Tested on iOS 13.4 (simulator): ![image](https://user-images.githubusercontent.com/6184593/77903803-c6370c00-7283-11ea-8b71-b6b6546c82f6.png) Tested on iOS 13.1 (simulator) ![image](https://user-images.githubusercontent.com/6184593/77903499-41e48900-7283-11ea-9d14-83f67a3b7b77.png) - Verified that the `setOption` was called, but the Performance Monitor didn't show any GC usage regardless. - Identical PR https://github.com/expo/react-native/pull/21 has been shipped and tested in Expo Client 37 Fixes https://github.com/facebook/react-native/issues/28414 Reviewed By: PeteTheHeat Differential Revision: D20851131 Pulled By: TheSavior fbshipit-source-id: ff96301036e8487db59f95947bbe6841fe230e1e * Modify warning message (#28514) Summary: Modify deprecation warning message for `AccessibilityInfo.fetch` - https://reactnative.dev/docs/accessibilityinfo#isscreenreaderenabled - https://github.com/facebook/react-native/commit/523ab8333800afbfb169c6fd70ab6611fe07cc2a ## Changelog [Internal] [Changed] - Modify deprecation warning message for `AccessibilityInfo.fetch` Pull Request resolved: https://github.com/facebook/react-native/pull/28514 Test Plan: Try using `AccessibilityInfo.fetch` and check log Reviewed By: cpojer Differential Revision: D20850223 Pulled By: TheSavior fbshipit-source-id: e21bb20b7a02d9f2ed6e27e2bfecbac0aebf9e09 * Set _borderLayer.frame when border changes Summary: Changelog: [Internal] Setting `_borderLayer.frame` inside `-[RCTViewComponentView layoutSubviews]` causes unwanted animation because it is not wrapped in `CATransaction`. Moving it to `-[RCTViewComponentView updateLayoutMetrics]` which is called inside `CATransaction`. Reviewed By: shergin Differential Revision: D20836890 fbshipit-source-id: 2048a25fd2edb8109f6275c1186c0adae4b9f504 * Add API for getting sourceURL directly from ReactContext Summary: In bridgeless mode, the CatalystInstance doesn't exist, but we still need to be able to access the sourceURL in SourceCodeModule (which is needed to render the images in LogBox warnings and errors). This diff adds a new API for getting the sourceURL directly from ReactContext, instead of having to call context.getCatalystInstance().getSourceURL(), and updates SourceCodeModule to use it. Changelog: [Internal] Reviewed By: RSNara Differential Revision: D20848700 fbshipit-source-id: 3ecda81a17121178b76bbb3e9b0f27f103c1961a * imp: Remove unused `npx` reference (#28544) Summary: Recently we removed `npx` usage from `react-native-cli` flow. After checking usages in this repo I found unused reference. ## 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] [Removed] - Remove unused `npx` reference Pull Request resolved: https://github.com/facebook/react-native/pull/28544 Test Plan: Tests pass Reviewed By: cpojer Differential Revision: D20873090 Pulled By: hramos fbshipit-source-id: 12e05e9635a83f19439024766817e4599320af98 * Add debug logs to track down T62192299 exception source Summary: Add debug logs to track down T62192299 exception source Changelog: [Internal] Reviewed By: RSNara Differential Revision: D20878063 fbshipit-source-id: 94acd56c45d4b529a695d1b4d2bfd10d8f725e63 * Back out "Fixed scrollview inset when RN view is embedded in another view" Summary: Original commit changeset: fbd72739fb71 Changelog: Back out "[react-native][PR] Fixed scrollview inset when RN view is embedded in another view" Reviewed By: TheSavior Differential Revision: D20878607 fbshipit-source-id: 0d77b9fb08c637f7894c399a219a242e472b0700 * Fail silently in AppStateModule.sendEvent if CatalystInstance is not available Summary: According to our logs, 80% of these warnings are coming from AppStateModule. It's not particularly interesting or surprising that the CatalystInstance would be torn down when there's some app event, so let's stop taking up DB space with a useless message. Reviewed By: ejanzer, mdvacca Differential Revision: D20879426 fbshipit-source-id: b1182461aed4a66d82cb34bbd4b12782af6ed7b3 * Move DebugEnvironment helper to open source Summary: This is an internal only module that we use to detect whether we are in async debugging mode. Changelog: [Internal] Reviewed By: yungsters Differential Revision: D20879780 fbshipit-source-id: 5915f4e1c54a3fda0cf607c77f463120264fdbc4 * Fix Appearance module when using Chrome Debugger Summary: The appearance module uses sync native module methods which doesn't work with the chrome debugger. This broke in 0.62: https://github.com/facebook/react-native/issues/26705 This fix makes the appearance module return 'light' when using the chrome debugger. Changelog: [Fixed] Appearance `getColorScheme` no longer breaks the debugger Reviewed By: yungsters Differential Revision: D20879779 fbshipit-source-id: ad49c66226096433bc9f270e004ad4a6f54fa8c2 * Extend Android ImageViewManager to support analyticsTag prop Summary: This diff extends the Android Image View manager to support the new analyticsTag prop. this prop is going to be used to track performance for images in android changelog: [Android][Added] Add analyticsTag prop into ImageView component Reviewed By: JoshuaGross Differential Revision: D20880602 fbshipit-source-id: e302e8fa83706e6517b228d44a3094a1686830f7 * Extend Image.android to support analyticsTag prop Summary: Quick diff to extend Image.android component to support analytics tag prop changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D20880601 fbshipit-source-id: 99bc11f36ce46953c00480f7c8d628cf6c0a9263 * Create ImageContext object to allow udpating the analyticsTag prop for RN sections Summary: As part of this diff I create the new ImageContext object that will be used to allow the update of the analyticsTag prop for components that contain multiple images in their view hierarchy changelog: [JS][Added] Add ImageContext object, this object can be used to update the Imageview's analyticsTag prop on RN components that contain multiple images in their view hierarchy Reviewed By: JoshuaGross Differential Revision: D20880603 fbshipit-source-id: f2094bfd3ab1c867cf7c107e678a098aab7e94a8 * Ez cleanup in ImageProps Summary: Ez cleanup in ImageProps, this import is not being used anymore changelog: [internal] internal change Reviewed By: JoshuaGross Differential Revision: D20880600 fbshipit-source-id: 7d903b5a6e16c37e61dec661b6bd1f9a6b442cc3 * Exclude all FlipperKit transitive dependencies from iOS Release builds (#28504) Summary: The `:configuration` option from `pod` only affects the specified pod and not its dependencies [1]. Therefore in order to avoid all transitive dependencies being linked in the resulting Release IPA we need to list them in the `Podfile`. Note that this will still build Flipper's pods when doing a Release, but it won't link it in the resulting IPA. [1] https://guides.cocoapods.org/syntax/podfile.html#pod Fixes https://github.com/react-native-community/upgrade-support/issues/28 Related https://github.com/CocoaPods/CocoaPods/issues/9658 ## Changelog * [iOS] [Fixed] - Exclude Flipper from iOS Release builds Pull Request resolved: https://github.com/facebook/react-native/pull/28504 Test Plan: Create a new React Native 0.62 project, run `pod install`, then diff: ``` ProjectName/ios/Pods/Target Support Files/Pods-ProjectName/Pods-ProjectName.debug.xcconfig` ``` and ``` ProjectName/ios/Pods/Target Support Files/Pods-ProjectName/Pods-ProjectName.relaese.xcconfig ``` ![image](https://user-images.githubusercontent.com/855995/78337679-a3fa0280-7591-11ea-8142-6f82cbc6be58.png) Reviewed By: passy Differential Revision: D20894406 Pulled By: priteshrnandgaonkar fbshipit-source-id: 680780f0f5a85fd8423b85a271a499bd12f06d00 * Fix crash in FabricUIManager.onMeasure Summary: Changelog: [Internal] The cause of crash was `NullPointerException`, which happened because of `mReactContextForRootTag.get(rootTag)` returning `null`. This is solved by checking whether it returns `null` before passing it to `I18nUtil`. Reviewed By: mdvacca Differential Revision: D20890623 fbshipit-source-id: c884c6838b83b944a5438375a4c060c1f5b1dc6e * Fix flow types of ImageContext Summary: ez diff to Fix flow types of ImageContext changelog: [internal] internal change to update flow types of ImageContext Reviewed By: TheSavior Differential Revision: D20883647 fbshipit-source-id: 6dba83ab431e56a71f96c39005ebcccf39a7da9a * Avoid passing analyticsTag prop to native if this is set to null Summary: This diff avoids passing the analyticsTag prop to native if this is set to null changelog: [internal] internal optimization Reviewed By: TheSavior Differential Revision: D20904498 fbshipit-source-id: f1ea1e5aa3199ef073668df86ca7cf6e20f70c5b * Rename analyticsTag -> internal_analyticsTag in ImageView component Summary: This diff renames the analyticsTag prop for the intenral_analyticsTag in ImageView component changelog: [internal] Creation of internal_analyticTag prop in ImageView, for now this prop is meant to be used internally. Reviewed By: TheSavior Differential Revision: D20904497 fbshipit-source-id: 2a28f746772ee0f9d657ec71549020c1f3e9d674 * Make Vibration.vibrate compatible with TurboModules (#27951) Summary: This PR fixes a compatibility issue with the Vibration module and TurboModules. The TurboModules spec doesn't allow nullable arguments of type Number, causing the following problem: ![IMG_3758](https://user-images.githubusercontent.com/1247834/73803879-10be6f80-4790-11ea-92d4-a008f0007681.PNG) ## Changelog [iOS] [Fixed] - Make Vibration library compatible with TurboModules. Pull Request resolved: https://github.com/facebook/react-native/pull/27951 Test Plan: Just submitted a PR to my own app to fix the issue [here](https://github.com/rainbow-me/rainbow/pull/340) The problem should be reproducible on RNTester due to this line: https://github.com/facebook/react-native/blob/91f139b94118fe8db29728ea8ad855fc4a13f743/RNTester/js/examples/Vibration/VibrationExample.js#L66 and should be working on this branch. Reviewed By: TheSavior Differential Revision: D19761064 Pulled By: hramos fbshipit-source-id: 84f6b62a2734cc09d450e906b5866d4e9ce61124 * Fix Cocoapods builds Summary: ## Problem For some reason, D20831545 broke the `use_frameworks!` build of RNTester. ## Building RNTester ``` pushd ~/fbsource/xplat/js/react-native-github/RNTester && USE_FRAMEWORKS=1 pod install && open RNTesterPods.xcworkspace && popd; ``` ## Error I built RNTester locally, and the error was this: ``` Undefined symbols for architecture x86_64: "facebook::jsi::HostObject::set(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&, facebook::jsi::Value const&)", referenced from: vtable for facebook::react::ObjCTurboModule in RCTImageEditingManager.o vtable for facebook::react::ObjCTurboModule in RCTImageLoader.o vtable for facebook::react::ObjCTurboModule in RCTImageStoreManager.o "facebook::jsi::HostObject::getPropertyNames(facebook::jsi::Runtime&)", referenced from: vtable for facebook::react::ObjCTurboModule in RCTImageEditingManager.o vtable for facebook::react::ObjCTurboModule in RCTImageLoader.o vtable for facebook::react::ObjCTurboModule in RCTImageStoreManager.o ld: symbol(s) not found for architecture x86_64 ``` ## Fix It looked like libraries that depend on "ReactCommon/turbomodule/core" weren't linking to JSI correctly. So, I modified all such Podspecs to also depend on "React-jsi": ``` arc rfr ' s.dependency "ReactCommon/turbomodule/core", version' ' s.dependency "ReactCommon/turbomodule/core", version\n s.dependency "React-jsi", version' ``` This seemed to do the trick. In buck, we'd fix this problem using exported_dependencies. I skimmed through cocoapods, and couldn't find such a configuration option there. So, I guess this will have to do? Changelog: [iOS][Fixed] - Fix Cocoapods builds of RNTester Reviewed By: fkgozali, hramos Differential Revision: D20905465 fbshipit-source-id: 60218c8274ec165752a428f2a7a9a546607c8fec * Add minimumSize to RCTRootView & RCTRootShadowView Summary: This adds a `minimumSize` property to RCTRootView, and forwards any changes to it's shadow view. This **does not** change any default behaviour, as the default minimum size is `CGSizeZero` before & after this diff. Changelog: [iOS][Internal] Add minimumSize to RCTRootView & RCTRootShadowView Reviewed By: RSNara Differential Revision: D20905456 fbshipit-source-id: a03f880e782891f60ef86b9c898965e05a5e796e * Make RCTNativeAnimatedModule into a TurboModule Summary: D20831545 integrated TurboModules with the bridge's `onBatchComplete` event. This fixed the RCTNativeAnimatedModule jank, so I'm re-converting RCTNativeAnimatedModule into a TurboModule. Changelog: [iOS][Fixed] - Make RCTNativeAnimatedModule TM-compatible Reviewed By: PeteTheHeat Differential Revision: D20850744 fbshipit-source-id: bb85a1bb27963e7d39bf149d0a3d7b71c88175da * upgrade to flow 0.122.0 Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D20919782 fbshipit-source-id: 3d5dc54ea4daafb8a1d96cad6c35a2dab4c24097 * Switch order of onSelectionChange and onChange events send from native Summary: Changelog: [Internal] UIKit uses either `UITextField` or `UITextView` as its UIKit element for `<TextInput>`. `UITextField` is for single line entry, `UITextView` is for multiline entry. There is a problem with order of events when user types a character. In `UITextField` (single line text entry), typing a character first triggers `onChange` event and then `onSelectionChange`. JavaScript depends on this order of events because it uses `mostRecentEventCount` from this even to communicate to native that it is in sync with changes in native. In `UITextView` (multi line text entry), typing a character first triggers `onSelectionChange` and then `onChange`. As JS depends on the correct order of events, this can cause issues. An example would be a TextInput which changes contents based as a result of `onSelectionChange`. Those changes would be ignored as native will throw them away because JavaScript doesn't have the newest version. Reviewed By: JoshuaGross Differential Revision: D20836195 fbshipit-source-id: fbae3b6c0d388fc059ca2541ae980073b8e5f6c7 * Maintain selection and cursor location when setting string on TextInput Summary: Changelog: [Internal] Calling `_backedTextInputView.attributedText = attributedString` causes cursor to be moved to the end of text input. This applies to both, `UITextField` and `UITextView`. This is not desired as when JS sets a new text, we don't want the cursor to be moved to the end of text input. JS has the option to use view commands if it wishes to move cursor somewhere. Reviewed By: JoshuaGross Differential Revision: D20836201 fbshipit-source-id: 9234e54cfbc5fc206f723626988e505275788aae * Implement event count for TextInput Summary: Changelog: [Internal] Implementation of event count for Fabric's Text input. Reviewed By: JoshuaGross Differential Revision: D20800185 fbshipit-source-id: 988692cb2fc786649821cccb06e629b40b9b0479 * Migrate setNativeProps to commands in iOS text input Summary: Changelog: Move from setNativeProps to ViewCommands. Reviewed By: JoshuaGross Differential Revision: D20843018 fbshipit-source-id: 9be9d2bbee01f2e15279e3c3ae785c1a5b163765 * Update default Podfile to not depend on a path (#28572) Summary: Recently, a default Podfile has been modified to not contain all the React Native pods, but use a helper method `use_react_native!`. While this is great, it assumes a hardcoded path of `../node_modules/react-native` to be always the correct location of the React Native. https://github.com/facebook/react-native/blob/d4d8887b5018782eeb3f26efa85125e6bbff73e4/scripts/autolink-ios.rb#L7-L9 Unfortunately, due to the way Ruby works, this completely hides the path away from the users. Before, they could have seen the wrong path explicitly in a Podfile and knew to update it to resolve path-related issues. With the current version in `master`, I can see a lot of issues where developers wonder how to resolve the path issues and how to pass the path itself. https://github.com/facebook/react-native/blob/4118d798265341061105f3a53550db83c66a71cb/template/ios/Podfile#L5-L10 This PR uses React Native CLI configuration (that is already used to link 3rd party dependencies) to explicitly define the correct path to the React Native. As a result, we don't have to change the paths here whether we're running monorepo or not. ## Changelog [IOS] [INTERNAL] - Always provide an explicit path to React Native Pull Request resolved: https://github.com/facebook/react-native/pull/28572 Differential Revision: D20945194 Pulled By: TheSavior fbshipit-source-id: 010f9754f2ed78ef62fd52f4d201f296f5af6d27 * chore: update CLI * fix: do not throw on missing `cliPath`, use the default value (#28625) Summary: The `cliPath` has always been optional value and in fact, even had its default value hardcoded in the React gradle file. In this PR, I am just taking use of it and remove throwing an error, which is going to be a really annoying breaking change. ## Changelog [ANDROID] [INTERNAL] - Don't require `cliPath` Pull Request resolved: https://github.com/facebook/react-native/pull/28625 Test Plan: Run Android project, everything works. Provide custom `cliPath`, it gets respected Reviewed By: cpojer Differential Revision: D21044222 Pulled By: TheSavior fbshipit-source-id: 8029f988d92abb9f64f30e05932c0d407d0c997e * chore: remove Kotlin version from the default template * (eslint-config) update community eslint plugin in eslint config (#28642) Summary: Updating the community eslint-plugin used in the eslint-config to the latest version. expecting new eslint-config version to be released with this change so that it can be included in new project template for 0.63 https://github.com/react-native-community/releases/issues/186 ## 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] - Update community eslint plugin in the eslint config Pull Request resolved: https://github.com/facebook/react-native/pull/28642 Test Plan: yarn lint passes Differential Revision: D21048976 Pulled By: cpojer fbshipit-source-id: 2c3ec0ef450cf357d8c88db7873f4ca1154b2034 * [0.63.0-rc.0] Bump version numbers * Upgrade Hermes dependency to 0.5.0 Summary: Use the latest published release of hermes-engine. Update RN to invoke `hermesc` instead of `hermes`. Changelog: [Android] [Changed] - Upgraded to Hermes 0.5.0 allow-large-files Reviewed By: mhorowitz Differential Revision: D20998564 fbshipit-source-id: 4824e273bcb044029a5a7e9379f168d3da47da50 * Remove the post install step (#28651) Summary: Removes the post install step for Flipper, as the latest version of YogaKit is compatible with swift 5. cc alloy ## 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 --> [Flipper] [Template] - Remove the post install step for Flipper Pull Request resolved: https://github.com/facebook/react-native/pull/28651 Test Plan: Tested a newly created RN app without post install step and it built successfully. Reviewed By: passy Differential Revision: D21064653 Pulled By: priteshrnandgaonkar fbshipit-source-id: da56d0754d918e30a0ebe480c77590f0139d48ac * Allow iOS PlatformColor strings to be ObjC or Swift UIColor selectors (#28703) Summary: Per discussion in https://github.com/react-native-community/releases/issues/186 the iOS `PlatformColor()` function is documented to use the semantic color names provided by the system. The referenced HIG documentation itself links to the `UIColor` documentation for semantic colors names. However, these names differ depending on if you are viewing the new Swift API docs or the Objective C docs. The current Objective C implementation in react-native assumes Objective C UIColor selector names that are suffixed 'Color'. But in Swift, Apple provides a Swift Extension on UIColor that makes aliases without the the 'Color' suffix and then makes the original selectors invalid presumably via `NS_UNAVAILABLE_SWIFT`. Since both selector names are valid depending on if you are using Objective C or Swift, let's make both forms be legal for `PlatformColor()`. In `RCTConvert.m` there is a dictionary of legal selector names. The code already supports the ability to have names be aliases of other selectors via a RCTSelector metadata key. The change adds code to the initialization of the map: it iterates over the keys in the map, which are all ObjC style UIColor selectors, and creates aliases by duplicating the entries, creating key names by stripping off the ObjC "Color" suffix, adds the RCTSelector key referring to the original and then appends these new Swift aliases to the map. ## Changelog [iOS] [Changed] - Allow iOS PlatformColor strings to be ObjC or Swift UIColor selectors Pull Request resolved: https://github.com/facebook/react-native/pull/28703 Test Plan: The PlatformColorExample.js is updated to use the new, shorter Swift selector names. There are still other examples in the same file and in unit tests that exercise the ObjC selector names. <img width="492" alt="PlatformColor" src="https://user-images.githubusercontent.com/30053638/79809089-89ab7d00-8324-11ea-8a9d-120b92edeedf.png"> Reviewed By: shergin Differential Revision: D21147404 Pulled By: TheSavior fbshipit-source-id: 0273ec855e426b3a7ba97a87645859e05bcd4126 * Fix folly::dynamic crash when attaching a debugger to Hermes Summary: folly_futures was compiled with and exported -DFOLLY_MOBILE=1, while folly_json did not. This flag disables fancy F14 data structures for folly::dynamic in favor of a simple std::unordered_map. This caused inlined/templated code from modules depending on folly_futures to disagree with the implementations in folly_json, leading to a crash. The only such libraries were libhermes-inspector and (transitively) libhermes-executor-debug, and these only use folly::dynamic for CDP serialization, which is why the problem was not more apparent. Changelog: [Internal] Fix crash when attaching a Hermes debugger Reviewed By: mhorowitz Differential Revision: D21193307 fbshipit-source-id: 2b795bb6f4f7f991e2adaacec62d62616117322b * Update react.gradle (#28776) Summary: Running `./gradlew assembleRelease` fails as the path to the CLI contains a new line at the end. We don't run this command in `debug` mode, hence it passed the testing. My bad. Fixed, checked in both `debug` with `bundleInDebug: true` and `release`. Fixes https://github.com/facebook/react-native/issues/28700 ## Changelog [INTERNAL] [ANDROID] - Fix `React.gradle` to build Android apps in production Pull Request resolved: https://github.com/facebook/react-native/pull/28776 Test Plan: Running `./gradlew assembleRelease` works Reviewed By: hramos Differential Revision: D21287789 Pulled By: TheSavior fbshipit-source-id: dc3ec8eef7a919b072b562d2bd455e2f704bc083 * Revert D21064653: Remove the post install step Differential Revision: D21064653 Original commit changeset: da56d0754d91 fbshipit-source-id: 1086cfdeca9aa3830370ea115ba7b5f05d3fb124 * Bump @react-native-community/eslint-config in new app template Summary: Changelog: [Changed][General] Update react-native-community/eslint-config to 1.1.0, adding the new color rule Reviewed By: rickhanlonii Differential Revision: D21342153 fbshipit-source-id: ac1367353d4d3e69b6df29dc16f9fcb60cde3519 * [0.63.0-rc.1] Bump version numbers * Upgrade Flipper to 0.37.0 (#28545) Summary: Bump flipper to 0.37 for both iOS and Android [Android] [Changed] - Upgrade Flipper to 0.37.0 [iOS] [Changed] - Upgrade Flipper to 0.37.0 Pull Request resolved: https://github.com/facebook/react-native/pull/28545 Test Plan: RNTester build pass Reviewed By: rickhanlonii Differential Revision: D20930069 Pulled By: hramos fbshipit-source-id: a7cb719da3e51e6a42d27d5e64bc664398d0d3c5 * Enable with CocoaPods `:configuration` (#28796) Summary: ~~⚠️ Depends on https://github.com/facebook/flipper/pull/1086 and a new Flipper release.~~ Fixes https://github.com/facebook/react-native/commit/17f025bc26da13da795845a3f7daee65563420c0#commitcomment-38831234 Currently user’s are being told to add a definition of the `FB_SONARKIT_ENABLED` macro and examples, including those in stock React Native templates, set this for the user by making use of a `post_install` hook in the user’s `Podfile`. This leads to confusion, fragile code [when a user’s project dir structure deviates from vanilla], and is ultimately not necessary as CocoaPods already has dedicated mechanisms to: * specify build settings (through the `xcconfig` property); * and selectively include certain pods only in certain build configurations (e.g. debug). ## 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] [Changed] - Entirely control Flipper being enabled through inclusion in Podfile and optionally limiting to certain build configurations using the `:configuration` directive. Pull Request resolved: https://github.com/facebook/react-native/pull/28796 Test Plan: Tested using the changes of https://github.com/facebook/flipper/pull/1086 in a new app that uses RN `master`. Reviewed By: priteshrnandgaonkar Differential Revision: D21449754 Pulled By: passy fbshipit-source-id: 9ff7c7f4ffc32b364b1edd82b94e0b80c3997625 * Pressable: Rename pressRectOffset to pressRetentionOffset to be consistent with other touchables Summary: Text and the other Touchables have this prop called pressRetentionOffset. Pressable should be consistent with that. Changelog: [Breaking][General]: Pressable: Rename pressRectOffset to pressRetentionOffset to be consistent with other touchables Reviewed By: yungsters Differential Revision: D21552255 fbshipit-source-id: 31e64bad9e48ac98e4934dd2f4c0a7f526de5cb6 * iOS: Fix Animated image crash when CADisplayLink target in RCTWeakProxy is nil Summary: When self is nil, this may crash in RCTUIImageViewAnimated.m. ``` _displayLink = [CADisplayLink displayLinkWithTarget:[RCTWeakProxy weakProxyWithTarget:self] selector:selector(displayDidRefresh:)]; ``` Replace `RCTWeakProxy` with a concrete class `RCTDisplayWeakRefreshable` that has the displayDidRefresh method, that calls the displayDidRefresh method in its weak target. https://github.com/facebook/react-native/pull/28070#issuecomment-619295254 Changelog: [iOS] [Fixed] - Fix Animated image crash when CADisplayLink target in RCTWeakProxy is nil Reviewed By: shergin Differential Revision: D21419385 fbshipit-source-id: da7c3c38f81ea54f633da7f59359e07680ea2faf * Pressable: Add Support for Inspector Overlay Summary: Adds support for the debug overlay (enabled via the Inspector) that the legacy touchable components supported. Changelog: [General][Added] - Added Inspector overlay support for Pressable Reviewed By: TheSavior Differential Revision: D21614412 fbshipit-source-id: b884e04f8dba1bfd35e61de25d33d6d47bc34b03 * Changed iOS LaunchScreen from xib to storyboard (#28239) Summary: > Starting April 30, 2020, all apps submitted to the App Store must use an Xcode storyboard to provide the app’s launch screen and all iPhone apps must support all iPhone screens. Updated iOS Launch screen as per [App Store policy change](https://developer.apple.com/news/?id=03042020b). Community discussion: https://github.com/react-native-community/discussions-and-proposals/issues/209 ## Changelog Changed iOS Launch Screen from a `xib` to `storyboard`. The `LaunchScreen.xib` file has been replaced with `LaunchScreen.storyboard`. Xcode automatically picks up the new Launch Screen no additional change is required. [iOS] [Deleted] - Deleted LaunchScreen.xib [iOS] [Added] - Added LaunchScreen.storyboard Pull Request resolved: https://github.com/facebook/react-native/pull/28239 Test Plan: Build the Xcode project under `template/iOS` and verify that the new launch screen is identical to the previous one. Reviewed By: cpojer Differential Revision: D20408892 Pulled By: hramos fbshipit-source-id: 9c38df58d1304088a23f3d73e0fbd87675804f1a * Fix debugging on android for 0.63 (#29204) Summary: Currently on react native 0.63-rc.0 and 0.63-rc.1 enabling debugging throws an exception. It looks like something may have been missed in unregistering JSDevSupport in this commit c20963e ![crash](https://user-images.githubusercontent.com/14797029/85500252-2acae400-b5b1-11ea-938a-674b55e649b2.gif) This should fix https://github.com/facebook/react-native/issues/28746 and https://github.com/facebook/react-native/issues/29136 ## Changelog [Android] [Fixed] - Fix crash when enabling debug Pull Request resolved: https://github.com/facebook/react-native/pull/29204 Test Plan: To recreate the bug: npx react-native init RN063 --version 0.63.0-rc.1 react-native start react-native run-android Enable debug mode from react native dev menu After this commit, the crash no longer occurs ![non crash](https://user-images.githubusercontent.com/14797029/85500241-269ec680-b5b1-11ea-8cfe-85bfda4dd222.gif) Reviewed By: TheSavior Differential Revision: D22395406 Pulled By: RSNara fbshipit-source-id: 046df77ae1c1de96870fb46f409d59e7d6a68c0d * [0.63.0] Bump version numbers * Add ProGuard rule for hermes (#28571) Summary: This adds a ProGuard for `hermes` rule so it does not have to be added by users manually. https://github.com/facebook/react-native/issues/28270 ## 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 --> [Android] [Added] - ProGuard rule for hermes Pull Request resolved: https://github.com/facebook/react-native/pull/28571 Test Plan: 1. Create a project with/without hermes. 2. Enable proguard. Reviewed By: cpojer Differential Revision: D20947095 Pulled By: hramos fbshipit-source-id: 79b166ad2dd060f20041d9f5cfe2f794c754843d * Fix rounded border drawing when border-radius is smaller than border-width (#28358) Summary: This PR fixes the drawing of the border rounded edges when the border-radius is small than the border-width. The current implementation capped the possible border-radius making it impossible to set smaller border-radii when using thicker borders. After inspection it was found that the rounded-rect calculation is incorrect. ## Changelog `[Android] [Fixed] - Fix rounded border-drawing when border-radius is smaller than border-width` Pull Request resolved: https://github.com/facebook/react-native/pull/28358 Test Plan: **Faulty situation:** As you can see, when the border-radius becomes very low, the border is stuck at a minimum value. Only after setting the border-radius fully to 0 is it again rendered correctly. ![ezgif com-video-to-gif (2)](https://user-images.githubusercontent.com/6184593/77183540-c3435b00-6ace-11ea-950d-29a0ea1757bd.gif) **After the fix:** ![ezgif com-video-to-gif (3)](https://user-images.githubusercontent.com/6184593/77183619-e837ce00-6ace-11ea-93a5-910127d352b7.gif) Differential Revision: D21124739 Pulled By: shergin fbshipit-source-id: cefd1776b77b5b9fb335e95fd7fdd7f345579dc4 * Fix border-stroke drawing after resetting border-radius (#28356) Summary: This PR fixes incorrect drawing of the View borders on Android, after changing the border-radius back to 0 *(and when no background-color is defined)*. This happens because the `drawRoundedBackgroundWithBorders` function in ReactViewBackgroundDrawable changes the style on the Paint object to `STROKE`. This style is however never reverted back to `FILL`. This change ensures that the Paint style is set to `FILL` for the full execution of the `drawRectangularBackgroundWithBorders` function. ## Changelog `[Android] [Fixed] - Fix border-drawing when changing border-radius back to 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28356 Test Plan: **Faulty situation:** ![ezgif com-video-to-gif](https://user-images.githubusercontent.com/6184593/77153163-9759b280-6a99-11ea-82bb-33a1e0a4934c.gif) **After the fix:** ![ezgif com-video-to-gif (1)](https://user-images.githubusercontent.com/6184593/77153825-c91f4900-6a9a-11ea-8e0c-a4280b9e72b8.gif) Differential Revision: D21124741 Pulled By: shergin fbshipit-source-id: 2044f8e8ad59a58df42b64d7ee8c4ad1d3b562f1 * Fixes TextInput shaking when typing Chinese (#28805) Summary: Fixes https://github.com/facebook/react-native/issues/28488. ## Changelog [iOS] [Fixed] - Fixes TextInput shaking when typing Chinese Pull Request resolved: https://github.com/facebook/react-native/pull/28805 Test Plan: Demo see https://github.com/facebook/react-native/issues/28488. Differential Revision: D21376803 Pulled By: shergin fbshipit-source-id: b1fe6cc5f67d42ef98a6c12b8ab9990feac0e2a7 * Set black as default text color for <TextInput/> on iOS (#28708) Summary: This is a follow-up pull request to https://github.com/facebook/react-native/issues/28280 (reviewed by shergin). This pull request tried to solve the problem of the default color in a TextInput in dark mode on iOS being white instead of black. I got suggested to solve the problem not on the level of RCTTextAttributes, but on the level of RCTUITextField. Setting `self.textColor = [UIColor black];` in the constructor did not work, because it gets overwritten by nil in `RCTBaseTextInputView.m`. There I implemented the logic that if NSForegroundColorAttributeName color is nil then the color is being set to black. I think the `defaultTextAttributes` property confuses here, because it ends up being the effective text attributes, e.g. if I unconditionally set the default text color to black, it cannot be changed in React Native anymore. So I put the nil check in. ## Changelog [iOS] [Fixed] - TextInput color has the same default (#000) on iOS whether in light or dark mode Pull Request resolved: https://github.com/facebook/react-native/pull/28708 Test Plan: I have manually tested the following: - The default text color in light mode is black - The default text color in dark mode is black - The color can be changed using the `style.color` attribute - Setting the opacity to 0.5 results in the desired behavior, the whole TextInput becoming half the opacity. – Setting the `style.color` to rgba(0, 0, 0, 0.5) works as intended, creating a half-opaque text color. Differential Revision: D21186579 Pulled By: shergin fbshipit-source-id: ea6405ac6a0243c96677335169b214a2bb9ccc29 * Enable array buffers in JSCRuntime.cpp (#28961) Summary: The JavaScriptCore implementation of JSI [does not currently support array buffers](https://github.com/facebook/react-native/blob/master/ReactCommon/jsi/JSCRuntime.cpp#L925-L943). The comments in the code suggest the JSC version used by React Native does not work with array buffers, but this seems to be out of date since the current version of JSC used by React Native does indeed support array buffers. This change just enables array buffers in JSCRuntime.cpp. NOTE: See https://github.com/react-native-community/discussions-and-proposals/issues/91#issuecomment-632371219 for more background on this change. ## Changelog [General] [Added] - Support for array buffers in the JavaScriptCore implementation of JSI Pull Request resolved: https://github.com/facebook/react-native/pull/28961 Test Plan: To test these changes, I just made some temporary changes to RNTester to use JSI to inject a test function into the JS runtime that reads from and writes to an array buffer, and call that function from the JS of the RNTester app (see https://github.com/ryantrem/react-native/commit/28152ce3f4ae0fa906557415d106399b3f072118). For the JS side of this, specifically look at https://github.com/ryantrem/react-native/blob/28152ce3f4ae0fa906557415d106399b3f072118/RNTester/js/RNTesterApp.android.js#L13-L18 For the native side of this, specifically look at https://github.com/ryantrem/react-native/blob/28152ce3f4ae0fa906557415d106399b3f072118/RNTester/android/app/src/main/cpp/JSITest.cpp#L22-L38 Reviewed By: shergin Differential Revision: D21717995 Pulled By: tmikov fbshipit-source-id: 5788479bb33c24d01aa80fa7f509e0ff9dcefea6 * Fix font variant crash on Android < 4.4 (#29176) Summary: In RN 0.62 support for `fontVariant` was added on Android. Using that prop crashes the app on Android below KitKat (4.3 and below) To reproduce just add any Text with the `fontVariant` styling prop in the app: ```js <Text style={{fontVariant: ['tabular-nums']}}>This will crash</Text> ``` It will crash any device running Android below KitKat with the error: ![image](https://user-images.githubusercontent.com/4534323/85073452-18206b80-b1bb-11ea-8d7e-96f27fa1a320.png) This is caused by `java.utils.Objects` only being available on Android 4.4+ ## Changelog [Android] [Fixed] - Fix font variant crash on Android < 4.4 Pull Request resolved: https://github.com/facebook/react-native/pull/29176 Test Plan: [TextUtils.equals](https://developer.android.com/reference/android/text/TextUtils#equals) was added as soon as API level 1, so no compatibility issue here. Tested on Emulator running Android 4.1, no crash anymore. I've searched for other occurences of `java.utils.Objects` in the project, and this was the only one, so no need to remove other occurences ✅ Reviewed By: JoshuaGross Differential Revision: D22337316 Pulled By: mdvacca fbshipit-source-id: 5507b21b237a725d596d47b5c01e269895b16d4a * Fix LogBox.ignoreAllLogs used with no argument (#29310) Summary: When you call `LogBox.ignoreAllLogs()` it should ignore logs. This fixes a bug that made this equivalent to `LogBox.ignoreAllLogs(false)` ## Changelog [General] [Fixed] - LogBox.ignoreAllLogs() should ignore logs Pull Request resolved: https://github.com/facebook/react-native/pull/29310 Test Plan: Added tests Reviewed By: TheSavior Differential Revision: D22448436 Pulled By: rickhanlonii fbshipit-source-id: 6ba12b9d9c1f29cf3ac503946ac5ca0097425a7a * Pressable: Minimum Press Duration Summary: When a `Pressable` has a configured (or the default) `delayPressIn` and no (or the default) `delayPressOut`, tapping very quickly can lead to intantaneous invocation of `onPressIn` and `onPressOut`. The end result is that users may never experience any intended visual press feedback. This changes `Pressable` to accept (and be preconfigured with a default) **minimum press duration**. The minimum press duration ensures that even if the press is released before `delayPressIn` has elapsed, `onPressOut` will still wait the remaining time up to `minPressDuration` before firing. Note that setting a non-zero `delayPressOut` is insufficient because if a user holds down on a `Pressable` for longer than `delayPressIn`, we still want `onPressOut` to fire immediately when the press is released. Changelog: [General][Changed] - Added `minPressDuration` to `Pressable`. Reviewed By: TheSavior Differential Revision: D21614708 fbshipit-source-id: 502f3d8ad6a40e7762435b6df16809c8798dd92c * chore: bring back script to org shape * [0.63.1] Bump version numbers * Exclude okhttp from flipper dependency (#29260) Summary: This fixes https://github.com/facebook/react-native/issues/28481. As explained in [this comment](https://github.com/facebook/react-native/issues/28481#issuecomment-645546195), the flipper network plugin pulls a more recent version of okhttp (3.14), but only versions of okhttp up to 3.12 works on Android API 21 and less. This prevented being able to run the app in debug mode, it was still working fine in release mode. ## 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 --> [Android] [Fixed] - Fix unable to run in debug mode on Android API < 21 Pull Request resolved: https://github.com/facebook/react-native/pull/29260 Test Plan: Using `yarn react-native run-android` the app would instantly crash with this error in `adb logcat`: ``` E/AndroidRuntime( 5079): java.lang.RuntimeException: Unable to create application com.awesometsproject.MainApplication: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created E/AndroidRuntime( 5079): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4154) E/AndroidRuntime( 5079): at android.app.ActivityThread.access$1300(ActivityThread.java:130) E/AndroidRuntime( 5079): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1255) E/AndroidRuntime( 5079): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 5079): at android.os.Looper.loop(Looper.java:137) E/AndroidRuntime( 5079): at android.app.ActivityThread.main(ActivityThread.java:4745) E/AndroidRuntime( 5079): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 5079): at java.lang.reflect.Method.invoke(Method.java:511) E/AndroidRuntime( 5079): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) E/AndroidRuntime( 5079): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) E/AndroidRuntime( 5079): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 5079): Caused by: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:90) E/AndroidRuntime( 5079): at com.facebook.react.ReactInstanceManager.<init>(ReactInstanceManager.java:238) E/AndroidRuntime( 5079): at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:281) E/AndroidRuntime( 5079): at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:87) E/AndroidRuntime( 5079): at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:39) E/AndroidRuntime( 5079): at com.awesometsproject.MainApplication.onCreate(MainApplication.java:47) E/AndroidRuntime( 5079): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:999) E/AndroidRuntime( 5079): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4151) E/AndroidRuntime( 5079): ... 10 more E/AndroidRuntime( 5079): Caused by: java.lang.reflect.InvocationTargetException E/AndroidRuntime( 5079): at java.lang.reflect.Constructor.constructNative(Native Method) E/AndroidRuntime( 5079): at java.lang.reflect.Constructor.newInstance(Constructor.java:417) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:80) E/AndroidRuntime( 5079): ... 17 more E/AndroidRuntime( 5079): Caused by: java.lang.NoClassDefFoundError: java.util.Objects E/AndroidRuntime( 5079): at okhttp3.CertificatePinner.withCertificateChainCleaner(CertificatePinner.java:231) E/AndroidRuntime( 5079): at okhttp3.OkHttpClient.<init>(OkHttpClient.java:238) E/AndroidRuntime( 5079): at okhttp3.OkHttpClient$Builder.build(OkHttpClient.java:1015) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevServerHelper.<init>(DevServerHelper.java:132) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerImpl.<init>(DevSupportManagerImpl.java:183) E/AndroidRuntime( 5079): ... 20 more W/ActivityManager( 1456): Force finishing activity com.awesometsproject/.MainActivity ``` With this fix, the app launch successfully in debug mode, without having to remove flipper altogether from our config. Reviewed By: passy Differential Revision: D22521109 Pulled By: mdvacca fbshipit-source-id: 3c0263642438bd7c0d09b045e15a933bd8a26734 * Send key when onKeyPress event is fired from TextInput Summary: Changelog: [Internal] In `onKeyPress` event, we were not returning `key` property. This diff adds `key` property to `onKeyPress` event and removes other, redundant properties from `onKeyPress` event. The implementation has been translated from Paper. Reviewed By: shergin Differential Revision: D21250411 fbshipit-source-id: f1e31381667acb9dec02d0b33883df8f8f5b2a4b * Calling Paper TextInput setTextAndSelection view command now dirties layout Summary: Changelog: [Internal] Previously `setTextAndSelection` was not dirtying layout. This would cause an issue where `setTextAndSelection` causes layout change. For example calling setTextAndSelection with empty string on a multiline auto expanding text input. I changed one example in TextInputSharedExamples.js, "Live Re-Write (no spaces allowed) and clear" example is now multiline. This allows to test whether `setTextAndSelection` dirties layout. Enter multiline string to to the example text input and press clear. Observe that the text input shrinks to single line height. Reviewed By: shergin Differential Revision: D21182990 fbshipit-source-id: de8501ea0b97012cf4cdf8d5f658649139f92da6 * Remove setMostRecentEventCount from TextInput view commands Summary: Changelog: [Internal] We don't use view command `setMostRecentEventCount`, let's get rid of it. Reviewed By: JoshuaGross Differential Revision: D21016600 fbshipit-source-id: 6491c063e9d6a89252300cb47c010b248e473f4b * Restore Previous Behavior for StyleSheet Validation of Null/Undefined Styles (#29171) Summary: https://github.com/facebook/react-native/issues/27264 changed stylesheet validation to avoid enumerating properties on the prototype of a style. It introduces a secondary behavior change, where null/undefined styles used to be tolerated but now lead to an exception. This is because `for in undefined` will noop where `for of Object.keys(undefined)` will throw. This scenario of undefined/null styles seems to actually show up in practice and was previously well tolerated. E.g. `Button.js` has code that looks like this: ```jsx const styles = StyleSheet.create({ button: Platform.select({ ios: {}, android: { elevation: 4, // Material design blue from https://material.google.com/style/color.html#color-color-palette backgroundColor: '#2196F3', borderRadius: 2, }, }), ``` For non ios/Android platforms, that creates a style object which looks like: ```js { button: undefined, ... } ``` This previously meant that the component would be unstyled if created, but now means out-of-tree platforms throw if the builtin Button component is required. This change restores the previous `for in` loop but adds a `hasOwnProperty` check to avoid properties on prototypes. ## Changelog [General] [Fixed] - Restore Previous Behavior for StyleSheet Validation of Null/Undefined Styles Pull Request resolved: https://github.com/facebook/react-native/pull/29171 Test Plan: Validated that importing Buttons will no longer cause an exception, and that invalid properties are still caught. Reviewed By: JoshuaGross Differential Revision: D22118379 Pulled By: TheSavior fbshipit-source-id: 650c64b934ccd12a3dc1b75e95debc359925ad73 * Set windowTranslucentNavigation to false (#29399) Summary: This fixes https://github.com/facebook/react-native/issues/29397. Without this, apps that specify `android:windowTranslucentNavigation` draw the `LogBox` buttons underneath the soft navigation bar, making the buttons unpressable. Before | After :-------------------------:|:-------------------------: <img src="http://ashoat.com/AndroidTranslucentNavigationLogBox.png" width="300" /> | <img src="http://ashoat.com/AndroidTranslucentNavigationLogBoxFixed.png" width="300" /> ## Changelog [Android] [Fixed] - Set LogBox windowTranslucentNavigation to false Pull Request resolved: https://github.com/facebook/react-native/pull/29399 Test Plan: I tested this change on the [repo](https://github.com/Ashoat/LogBoxTest) I set up to reproduce the issue. I set it up to [build `ReactAndroid` from source](https://github.com/Ashoat/LogBoxTest/commit/3a2cdab8777ac381cd3be5a84a5bf3250751ac11) and then edited `node_modules/react-native/ReactAndroid/src/main/res/devsupport/values/styles.xml` directly. Reviewed By: rickhanlonii Differential Revision: D22602970 Pulled By: mdvacca fbshipit-source-id: 8c2adc149aa0157825075022f00bb695956d3121 * Fix image cannot show in iOS 14 (#29420) Summary: This PR is to fix https://github.com/facebook/react-native/issues/29279, which image cannot show in iOS 14 As https://github.com/facebook/react-native/issues/29279#issuecomment-658244428 mention, this issue can be fixed by calling ` [super displayLayer:layer];` it it is still image, to let `UIImageView` handle still image rendering ## Changelog [iOS] [Fixed] - Fix image cannot show in iOS 14 Pull Request resolved: https://github.com/facebook/react-native/pull/29420 Test Plan: Image can be shown in iOS 14 build with Xcode 12 beta, using ```js <Image source={require('./images/some_local_image.jpg')}/> ``` It may also need to test gif image is render correctly ```js <Image source={{uri: 'https://some_remote_gif_image.gif'}}/> ``` Reviewed By: p-sun Differential Revision: D22619448 Pulled By: shergin fbshipit-source-id: f4d0ad83af945a6b8099d4eaea5a5f1933c7bfd2 * [0.63.2] Bump version numbers * botched merge changes 1 * more hermes changes needed from upstream, botched merge? * [RCTPicker] Guard UIKit only API on macOS * [RCTSegmentedControl] Make UIKit agnostic * [RCTDisplayWeakRefreshable] Make platform agnostic * [RCTImageLoader] Make platform agnostic * [RCTDevLoadingView] Make platform agnostic * botched merge changes 2 * [RCTPushNotificationManager] Guard for macOS * v0.63 TODO * [RCTBaseTextInputViewManager] Make platform agnostic * [RCTBaseTextInputView] Make platform agnostic * [RNTester-macOS] Fix * [RCT-Folly] Fix build * [PlatformColorValueTypes] Add macOS shim * [package] Update CLI to no longer require config This makes a previous change more explicit: https://github.com/microsoft/react-native-macos/pull/602 * Fix iOS build failures. * Get RNTester to launch * [CODEOWNERS] Add myself * [flow] Remove deprecated rule in newer Flow https://github.com/facebook/flow/commit/759970c1b6dc0a25171d9969e34eaf5dae70f130 * [flow] Get iOS checks green * [PlatformColor] Duplicate iOS code for macOS This is a naive version of this change, there should likely be some code sharing happening between iOS and macOS. * [test] Make green with macOS fork changes * [test] Get macOS test bundle to build * [Color] Rename alternating colors to match to assumptions * [PlatformExample] Fix examples on macOS * [transform] Use iOS implementation for macOS * [circle] Fix config * [ci] Update metro config as per upstream * [ci] Ignore metro config in e2e tests * Revert "[ci] Ignore metro config in e2e tests" This reverts commit 25f7006bc9ba76b1e002b721954a823b3d710c5c. * Revert "[ci] Update metro config as per upstream" This reverts commit b47ca570be00394bbd92b349eab02083787301e7. * [ci] Only disable custom metro config in e2e test * [ci] Ignore metro config in e2e tests * [ci] Switch to experimental CocoaPods CDN * Revert "[ci] Switch to experimental CocoaPods CDN" This reverts commit 44a92f7f08397406429672b14930d44b6aa06b5e. * [ci] Skip Android tests in Apple PR on master * [rnm-init] Fix pod reference * [rnm-init] Update minimum iOS deployment target Co-authored-by: Christoph Nakazawa <cpojer@fb.com> Co-authored-by: Sergio Estevao <sergioestevao@gmail.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: Sam Mathias Weggersen <sawegger@microsoft.com> Co-authored-by: Tommy Nguyen <tonguye@microsoft.com> Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Héctor Ramos <hector@hectorramos.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Sebastian Markbage <sema@fb.com> Co-authored-by: generatedunixname89002005287564 <generatedunixname89002005287564@fb.com> Co-authored-by: Eddie Dugan <ejd@fb.com> Co-authored-by: Valentin Shergin <shergin@fb.com> Co-authored-by: Max Ovtsin <maxovtsin@fb.com> Co-authored-by: Alexander Kawrykow <akawry@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Spencer Ahrens <sahrens@fb.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Jack Wang <shoubowang@fb.com> Co-authored-by: Oleg Bogdanov <boguscoder@fb.com> Co-authored-by: Michael Bolin <mbolin@fb.com> Co-authored-by: Dan Abramov <gaearon@fb.com> Co-authored-by: Peter Argany <petetheheat@fb.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: George Zahariev <gkz@fb.com> Co-authored-by: Jason Safaiyeh <safaiyeh@protonmail.com> Co-authored-by: Pedro Barbiero <pedrobarbiero@gmail.com> Co-authored-by: Brian Vaughn <bvaughn@fb.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Martin Sherburn <mns@fb.com> Co-authored-by: Tom Underhill <tomun@microsoft.com> Co-authored-by: Ventsislav Dimitrov <4097884+vdmtrv@users.noreply.github.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: Lucas Bento <lucas.bsilva@outlook.com> Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com> Co-authored-by: Vojtech Novak <vonovak@gmail.com> Co-authored-by: Emilis Baliukonis <emilisb@wix.com> Co-authored-by: Jacob Bower <jbower@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: Marc Horowitz <mhorowitz@fb.com> Co-authored-by: Sidharth Guglani <sidharthguglani@fb.com> Co-authored-by: Andrew Coates (REDMOND) <acoates@microsoft.com> Co-authored-by: maciej simka <mcj.simka@gmail.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Pavlos Vinieratos <pvinis@gmail.com> Co-authored-by: Cristiano Santos <cristianomnsantos@gmail.com> Co-authored-by: Daniel Cohen Gindi <Danielgindi@gmail.com> Co-authored-by: Eli White <eliwhite@fb.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: jiggag <jiggag90@gmail.com> Co-authored-by: Emily Janzer <janzer@fb.com> Co-authored-by: Kacper Wiszczuk <kacperwiszczuk@gmail.com> Co-authored-by: Xiaoyu Yin <xyin@fb.com> Co-authored-by: Javier Cuevas <javi@diacode.com> Co-authored-by: Bruno Barbieri <brunobar79@gmail.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Will Holen <willholen@fb.com> Co-authored-by: Pritesh Nandgaonkar <prit91@fb.com> Co-authored-by: sunnylqm <sunnylqm@qq.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Tim Yung <yungsters@fb.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: Devon Deonarine <hello@devondeonarine.ca> Co-authored-by: Radek Czemerys <radko93@gmail.com> Co-authored-by: Hein Rutjes <IjzerenHein@users.noreply.github.com> Co-authored-by: zhongwuzw <zhongwuzw@qq.com> Co-authored-by: Jonny Burger <jonathanburger11@gmail.com> Co-authored-by: Ryan Tremblay <ryan.tremblay@microsoft.com> Co-authored-by: almouro <contact@almouro.com> Co-authored-by: Rick Hanlon <rickhanlonii@gmail.com> Co-authored-by: Matthieu Harlé <bonjour@matthieuharle.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Ashoat Tevosyan <ashoat@gmail.com> Co-authored-by: Tom Cheung <cheungch@gmail.com>
2020-09-30 19:38:06 +03:00
import typeof {PlatformColor} from './Libraries/StyleSheet/PlatformColorValueTypes';
import typeof processColor from './Libraries/StyleSheet/processColor';
import typeof RCTDeviceEventEmitter from './Libraries/EventEmitter/RCTDeviceEventEmitter';
import typeof RCTNativeAppEventEmitter from './Libraries/EventEmitter/RCTNativeAppEventEmitter';
Merge from upstream through 2020-04-24 (#803) * Update default Podfile to not depend on a path (#28572) Summary: Recently, a default Podfile has been modified to not contain all the React Native pods, but use a helper method `use_react_native!`. While this is great, it assumes a hardcoded path of `../node_modules/react-native` to be always the correct location of the React Native. https://github.com/facebook/react-native/blob/d4d8887b5018782eeb3f26efa85125e6bbff73e4/scripts/autolink-ios.rb#L7-L9 Unfortunately, due to the way Ruby works, this completely hides the path away from the users. Before, they could have seen the wrong path explicitly in a Podfile and knew to update it to resolve path-related issues. With the current version in `master`, I can see a lot of issues where developers wonder how to resolve the path issues and how to pass the path itself. https://github.com/facebook/react-native/blob/4118d798265341061105f3a53550db83c66a71cb/template/ios/Podfile#L5-L10 This PR uses React Native CLI configuration (that is already used to link 3rd party dependencies) to explicitly define the correct path to the React Native. As a result, we don't have to change the paths here whether we're running monorepo or not. ## Changelog [IOS] [INTERNAL] - Always provide an explicit path to React Native Pull Request resolved: https://github.com/facebook/react-native/pull/28572 Differential Revision: D20945194 Pulled By: TheSavior fbshipit-source-id: 010f9754f2ed78ef62fd52f4d201f296f5af6d27 * Upgrade Prettier in Xplat to version 1.19.1 Summary: Upgrades Prettier in Xplat to 1.19.1 Ignores upgrading packages on already on versions greater than 1.19.1 Changelog: [Internal] allow-large-files bypass-lint (Note: this ignores all push blocking failures!) Reviewed By: gkz, cpojer Differential Revision: D20879147 fbshipit-source-id: 0deee7ac941e91e1c3c3a1e7d3d3ed20de1d657d * Stop using get_fbobjc_enable_exception_lang_compiler_flags_DEPRECATED in xplat Summary: Old deprecated function. Changelog: [Internal] Reviewed By: nlutsenko Differential Revision: D20148856 fbshipit-source-id: 79d6fb97824b059e50f67ff5a0b4c38ec7a19469 * Add ProGuard rule for hermes (#28571) Summary: This adds a ProGuard for `hermes` rule so it does not have to be added by users manually. https://github.com/facebook/react-native/issues/28270 ## 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 --> [Android] [Added] - ProGuard rule for hermes Pull Request resolved: https://github.com/facebook/react-native/pull/28571 Test Plan: 1. Create a project with/without hermes. 2. Enable proguard. Reviewed By: cpojer Differential Revision: D20947095 Pulled By: hramos fbshipit-source-id: 79b166ad2dd060f20041d9f5cfe2f794c754843d * Move CheckBox JS files to FB Internal Summary: Move CheckBox JS files to FB internal ## Changelog: [General] [Removed] This diff removes the CheckBox export from React Native. Internally, we are requiring CheckBox directly now and externally people will have to use the community maintained module. Reviewed By: cpojer Differential Revision: D20910775 fbshipit-source-id: 809e135dc3f68911ac0a004e6eafa8488f0d5327 * fix: ripple should be applied even when borderless == false (#28526) Summary: With current master, when you render `<Pressable android_ripple={{borderless: false}}>`, there is no ripple effect at all. I think the expected behavior is to have ripple with default color and radius, just not borderless. This was how it was done (by me) in https://github.com/facebook/react-native/pull/28156/files but in the import process, the implementation was changed: https://github.com/facebook/react-native/commit/bd3868643d29e93610e19312571a9736df2cbdf8 so either this PR is a fix or you can just close it (but I'd be curious why). ## 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 --> [Android] [fixed] - ripple should be applied even when borderless == false Pull Request resolved: https://github.com/facebook/react-native/pull/28526 Test Plan: `<Pressable android_ripple={{borderless: false}}>` on master ![SVID_20200404_123614_1](https://user-images.githubusercontent.com/1566403/78424971-6b315a80-7671-11ea-8be4-5fea428bc556.gif) `<Pressable android_ripple={{borderless: false}}>` in this PR ![SVID_20200404_122754_1](https://user-images.githubusercontent.com/1566403/78424986-8bf9b000-7671-11ea-9804-37cd58dbb61e.gif) Differential Revision: D20952026 Pulled By: TheSavior fbshipit-source-id: df2b95fc6f20d7e958e91805b1a928c4f85904f1 * Remove ColorAndroid function as it adds no value over PlatfromColor (#28577) Summary: This change removes the `ColorAndroid` API. It was added more as a validation tool than as something useful to a developer. When making the original [PlatformColor PR](https://github.com/facebook/react-native/pull/27908) we felt it was valuable and useful to have working platform specific methods for the two platforms in core to test that the pattern worked in app code (PlatformColorExample.js in RNTester) and that the Flow validation worked, etc. Practically `PlatformColor()` is more useful to a developer on Android than `ColorAndroid()`. Now that the construct has served its purpose, this PR removes the `ColorAndroid` function and its related tests and other collateral. ## 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 --> [Android] [Removed] - Remove ColorAndroid function as it adds no value over PlatfromColor Pull Request resolved: https://github.com/facebook/react-native/pull/28577 Test Plan: RNTester in both iOS and Android was tested. Jest tests, Flow checks, Lint checks all pass. Reviewed By: cpojer Differential Revision: D20952613 Pulled By: TheSavior fbshipit-source-id: 7d2cbaa2a347fffe59a1f3a26a210676008fdac0 * iOS: mark some old NativeModule targets with depslint_never_remove Summary: Label some BUCK targets properly. Changelog: [Internal] Reviewed By: shergin Differential Revision: D20960917 fbshipit-source-id: 42fa2266105b6c3dd5108a1b56035a19a95cd61f * Update Gradle Wrapper to 6.3 (#28173) Summary: ``` Welcome to Gradle 6.3! Here are the highlights of this release: - Java 14 support - Improved error messages for unexpected failures For more details see https://docs.gradle.org/6.3/release-notes.html ``` ## Changelog [Android] [Changed] - Update Gradle Wrapper to 6.3 Pull Request resolved: https://github.com/facebook/react-native/pull/28173 Test Plan: Build project Differential Revision: D20958894 Pulled By: mdvacca fbshipit-source-id: a02ab0eb6aff97148c12b844fdd1f9f2617ae53f * Fix crash inside RCTRedBox when trying to present same UIViewController twice Summary: Calling `-[RCTRedBox showErrorMessage]` twice causes a crash We used `-[UIViewController isBeingPresented]` to tell whether view controller is already presented. But from the documentation: > A Boolean value indicating whether the view controller is being presented. Source: https://developer.apple.com/documentation/uikit/uiviewcontroller/2097564-beingpresented?language=objc# --- So this means that if you present it, wait until presentation animation is finished and then call `-[RCTRedBox showErrorMessage]` again, following exception will be thrown. ``` *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present modally an active controller <UIViewController: 0x7fc33e422f50>.' ``` Changelog: Fix crash caused by presenting view controller twice from RCTRedBox Reviewed By: PeteTheHeat Differential Revision: D20946645 fbshipit-source-id: 763066e37db4e56efb0118b2e7867ad0724bae81 * Animated: Early detection of division by zero in AnimatedDivision Summary: We currently see a lot of errors happens because of division by zero in `AnimatedDivision` module. We already have a check for that in the module but it happens during the animation tick where the context of execution is already lost and it's hard to find why exactly it happens. Adding an additional check to the constructor should trigger an error right inside render function which should make the error actionable. Changelog: [Internal] Early crash in AnimatedDivision in case of division by zero. Reviewed By: mdvacca Differential Revision: D20969087 fbshipit-source-id: 0d98774b79be2cc56d468a4f56d2d7c8abf58344 * Fabric: Controlling DifferentiatorMode via ReactNativeConfig Summary: Now we can control the differentiator mode via MC. Changelog: [Internal] Fabric-specific internal change. Reviewed By: fkgozali Differential Revision: D20978857 fbshipit-source-id: 13264948762f02f874d8d051c873d378062d6db4 * Upgrade Hermes dependency to 0.5.0 Summary: Use the latest published release of hermes-engine. Update RN to invoke `hermesc` instead of `hermes`. Changelog: [Android] [Changed] - Upgraded to Hermes 0.5.0 allow-large-files Reviewed By: mhorowitz Differential Revision: D20998564 fbshipit-source-id: 4824e273bcb044029a5a7e9379f168d3da47da50 * Set width/height also to Undefined when we change the measure mode to Undefined Summary: Make sure width/height is always passed as Undefined when measure mode is changed to Undefined. Changelog: [Internal][Yoga] Set width and height as Undefined when we change measure mode to Undefined Reviewed By: alickbass Differential Revision: D20029838 fbshipit-source-id: b9931f6ddb13ffd1565889535ade5bbffbe0c304 * Remove redundant input from TextInput Summary: `const ReactNative` is assigned to but never used. Let's get rid of it. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D21016502 fbshipit-source-id: afcb0cfc501adf07e0c4d4452a831160e1cda088 * Update RNTester AppDelegate for changes made to SurfacePresenter API (#28580) Summary: This pull request updates RNTester's AppDelegate's Fabric mode to reflect changes made to the SurfacePresenter APIs. It now makes use of `RCTSurfacePresenterBridgeAdapter` to create its `SurfacePresenter`. ## Changelog [Internal] [Fixed] - Fixed outdated API usage in RNTester's AppDelegate Pull Request resolved: https://github.com/facebook/react-native/pull/28580 Test Plan: `RNTester/RNTester/AppDelegate.mm` now compiles without error when `RN_FABRIC_ENABLED` is enabled. Reviewed By: hramos Differential Revision: D20966067 Pulled By: mdvacca fbshipit-source-id: 8d0168d468240cff61554f2f2df799aaf5d876c1 * Retryable ViewCommand exceptions shouldn't crash Summary: Early ViewCommand Dispatch will solve this category of crashes by going through an entirely different codepath. For users not in that experiment, it might be good to have a mitigation that prevents non-critical issues from crashing (like "blur" failing). Currently, "blur" failures cause lots of screens to crash. There's no useful signal and those crashes aren't super actionable, so seems better to swallow. If/when early viewcommand dispatch ships as the default/only mode, we can remove this try/catch entirely. The only concern I have with landing this is the perf implications of putting a try/catch inside this loop. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D21023213 fbshipit-source-id: 310fe2d55a44bc424692a2365ccd5882f35f9d82 * Remove setMostRecentEventCount from TextInput view commands Summary: Changelog: [Internal] We don't use view command `setMostRecentEventCount`, let's get rid of it. Reviewed By: JoshuaGross Differential Revision: D21016600 fbshipit-source-id: 6491c063e9d6a89252300cb47c010b248e473f4b * label-actions: Add canned response for upgrade issues Summary: Enhance the label-actions config and support a "Type: Upgrade Issue" label. - Point to the Upgrade Support repository whenever the Type: Upgrade Issue label is applied. - Close the issue. Changelog: [Internal] label-actions: Add canned response for upgrade issues Reviewed By: cpojer Differential Revision: D20974607 fbshipit-source-id: 3cd7890aaeb1e57baf2acc5ca85a9b3ae5117c56 * Yoga Podspec: Export YGNode and YGStyle headers (#997) Summary: This pull request adds `YGNode.h` and `YGStyle.h` to the headers exported by Yoga's podspec. They are required by the new Fabric architecture of React Native. The modulemap and its umbrella header automatically generated by Cocoapods adds all exported headers to the `modulemap`. Having YGNode and YGStyle exported through here has problems, because they are only available in environments that have C++ available, and will produce errors otherwise. This pull request fences off the contents of those headers in an `#ifdef __cplusplus` block, so they will not cause errors when imported into environments where C++ isn't available. I had considered adding a custom modulemap to the podspec as part of this pull request, but this way seems the least "invasive", and this way you are able to add and remove exported headers in the podspec without needing to worry about updating the umbrella header at the same time. Changelog: [Internal] - Yoga Podspec: Export YGNore and YGStyle headers Pull Request resolved: https://github.com/facebook/yoga/pull/997 Reviewed By: hramos Differential Revision: D20966075 Pulled By: mdvacca fbshipit-source-id: 5f5caa6b639d11e660b968d681da9a4de6c0eb8e * Add logging to catch null TurboModules Summary: We're still seeing NativeModule eager-init crashes in T46487253. So, just to be extra careful, in case this diff doesn't fix the problem, I'm adding logging into `TurboModuleManager.getModule(moduleName)` to see why TurboModules are showing up as `null`. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D21027984 fbshipit-source-id: 74ee62aeac09a4fdb29547e90ef4fa7c07de17a6 * Remove module cache from ReactPackageTurboModuleManagerDelegate Summary: This cache is unnecessary, because: 1. TurboModuleManager caches all created TurboModules 2. TurboModuleManager calls into the TurboModuleManagerDelegate at most once per NativeModule `moduleName`. This diff also makes ReactPackageTurboModuleManager thread-safe, which should help get rid of the crashes in T46487253. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D21027998 fbshipit-source-id: c9b5ccc3da7b81787b749e70aa5e55883317eed7 * Control concurrent calls into TMMDelegate from TMM Summary: In D20659799, I improved `TurboModuleManager.getModule(moduleName)` thread-safety by ensuring that if two threads race to require the same NativeModule, only one thread creates the NativeModule, while the other one waits until it's created. ## The problem: What I failed to realize was that when two threads race to require two different NativeModules, we can get concurrent calls into `TurboModuleManagerDelegate.getModule(moduleName)`, and `TurboModuleManagerDelegate.getLegacyCxxModule(moduleName)`, which don't have any thread-safe guarantees. ## The fix `TurboModuleManagerDelegate` is supposed to be an input to the TurboModule system. So, rather than expecting that all TurboModuleManagerDelegates are thread-safe, which might be a reasonable ask (see T65532092), this diff has `TurboModuleManager` acquire the delegate's lock before calling into it. This ensures that we don't get concurrent access into the delegate, which could be reading from, or writing to, some data structure in these method calls. (This was the case with `ReactPackageTurboModuleManagerDelegate`, which is what Fb4a and Workplace use under the hood). Changelog: [Android][Fixed] - Control concurrent calls into TMMDelegate from TurboModuleManager Reviewed By: mdvacca Differential Revision: D21025965 fbshipit-source-id: d22c4abfe87f9e534717a06f186dde87d3cd24df * Bump eslint-plugin-react-native-community version to 1.1.0 Summary: This release will include the new platform-colors rule. Changelog: [Internal] (Note: this ignores all push blocking failures!) Reviewed By: cpojer Differential Revision: D21022163 fbshipit-source-id: 65c831b3c820e44f75631b935118b043180ab3c7 * Update Babel to 7.8.x/7.9.x Reviewed By: motiz88 Differential Revision: D20697095 fbshipit-source-id: ef35d02da0916109ce528d3026f7ca0956911dda * fix: do not throw on missing `cliPath`, use the default value (#28625) Summary: The `cliPath` has always been optional value and in fact, even had its default value hardcoded in the React gradle file. In this PR, I am just taking use of it and remove throwing an error, which is going to be a really annoying breaking change. ## Changelog [ANDROID] [INTERNAL] - Don't require `cliPath` Pull Request resolved: https://github.com/facebook/react-native/pull/28625 Test Plan: Run Android project, everything works. Provide custom `cliPath`, it gets respected Reviewed By: cpojer Differential Revision: D21044222 Pulled By: TheSavior fbshipit-source-id: 8029f988d92abb9f64f30e05932c0d407d0c997e * Fix CIRCLE_PR_NUMBER may not always be set (#28640) Summary: This fixes build failures where `CIRCLE_PR_NUMBER` is not set. This can happen if the PR did not come from a fork. ## Changelog [Internal] [Fixed] - Fix CIRCLE_PR_NUMBER may not always be set Pull Request resolved: https://github.com/facebook/react-native/pull/28640 Test Plan: Report bundle size step should pass on both this PR and https://github.com/facebook/react-native/issues/28641. Reviewed By: cpojer Differential Revision: D21045553 Pulled By: TheSavior fbshipit-source-id: fdfcb1bb88a96345b78ca69c49623df71d4cd608 * Add "Open Debugger" and "Open React DevTools" to iOS dev menu Summary: This diff introduces a new "Open Debugger" menu item for VMs that support on device debugging and for opening the React DevTools in Flipper. Provided so that we don't drift too far from the Android code. Changelog: [Internal] Reviewed By: RSNara Differential Revision: D20784270 fbshipit-source-id: 6bb16431d25a6c093a583e2e041b8cffa6765ddd * Changed iOS LaunchScreen from xib to storyboard (#28239) Summary: > Starting April 30, 2020, all apps submitted to the App Store must use an Xcode storyboard to provide the app’s launch screen and all iPhone apps must support all iPhone screens. Updated iOS Launch screen as per [App Store policy change](https://developer.apple.com/news/?id=03042020b). Community discussion: https://github.com/react-native-community/discussions-and-proposals/issues/209 ## Changelog Changed iOS Launch Screen from a `xib` to `storyboard`. The `LaunchScreen.xib` file has been replaced with `LaunchScreen.storyboard`. Xcode automatically picks up the new Launch Screen no additional change is required. [iOS] [Deleted] - Deleted LaunchScreen.xib [iOS] [Added] - Added LaunchScreen.storyboard Pull Request resolved: https://github.com/facebook/react-native/pull/28239 Test Plan: Build the Xcode project under `template/iOS` and verify that the new launch screen is identical to the previous one. Reviewed By: cpojer Differential Revision: D20408892 Pulled By: hramos fbshipit-source-id: 9c38df58d1304088a23f3d73e0fbd87675804f1a * Switch over to JavaTurboModule::InitParams Summary: ## Problem Every time we want to add, remove, or change the data passed to JavaTurboModule's constructor, we have to modify the C++ TurboModule codegen. (The same is true of `ObjCTurboModule`). **Why was this necessary?** - `JavaTurboModule` is effectively an abstract class whose constructor is always invoked by code-generated C++ classes. These C++ code-generated class constructors accept an argument list, and manually foward each and every item in that list to `JavaTurboModule::JavaTurboModule`. ## The fix In this diff, I introduce a struct `JavaTurboModule::InitParams`, to represent a bag of arguments: ``` class JSI_EXPORT JavaTurboModule : public TurboModule { public: struct InitParams { std::string moduleName; jni::alias_ref<JTurboModule> instance; std::shared_ptr<CallInvoker> jsInvoker; std::shared_ptr<CallInvoker> nativeInvoker; }; ``` All `JavaTurboModules` will be created with an instance of this `InitParams` struct, instead of a list of arguments. Our code-generated C++ `jsi::HostObject` sublcasses will simply accept `InitParams` in their constructor, and forward it to `JavaTurboModule`'s constructor. This way, the codegen remains oblivious to what arguments JavaTurboModule requires. ## Okay, but why do we need this change now? In the future, I plan to modify the constructor for `JavaTurboModule` to accept a performance logger, and a `RuntimeExecutor`. Similar modifications are planned for ObjC. For this reason, to avoid these four codemods, and any potential other codemods that occur because we're making modifications to `JavaTurboModule` or `ObjCTurboModule`, I'm launching this codemod, and the codemods in this stack. ## Misc Fix - Previously, we were generating the TurboModule name from the Spec filename. This is incorrect because that name represents the spec name. Now, the name will be forwarded from TurboModuleManager in the `JavaTurboModule::InitParams` struct. ## Alternative implementations I initially considered using `ContextContainer`, but decided against it because: 1. There are no type-safety guarantees. 2. I think it's a bit overkill for this scenario. We just need an opaque bag of data, and for our purposes a simple struct does the job fine. ## Commands run Reviewed By: fkgozali Differential Revision: D21035208 fbshipit-source-id: 9542cafea192081bc34d337ab3a7a783083eb06c * RN: Shrinkwrap Text Layout (Android) Summary: When text is in a constrained parent view using `maxWidth`, long text may wrap. When the text wraps, the final width is dependent on the word breaking strategy and text content. This means that the text width is not necessarily `maxWidth`. However, the current way that we compute text layout does not shrinkwrap the text width as much as possible. This leads to visual gaps to the end-side of wrapped text. This changes the text layout slightly so that we use the length of the longest line. This bug only exists on Android. After this change, Android behaves like iOS. Changelog: [Android] [Fixed] - Fixed excessive space in Text view with word-wrapping Reviewed By: JoshuaGross, mdvacca Differential Revision: D21056031 fbshipit-source-id: e9b7793f2632caafcce69bc15bac61330b0ed958 * (eslint-config) update community eslint plugin in eslint config (#28642) Summary: Updating the community eslint-plugin used in the eslint-config to the latest version. expecting new eslint-config version to be released with this change so that it can be included in new project template for 0.63 https://github.com/react-native-community/releases/issues/186 ## 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] - Update community eslint plugin in the eslint config Pull Request resolved: https://github.com/facebook/react-native/pull/28642 Test Plan: yarn lint passes Differential Revision: D21048976 Pulled By: cpojer fbshipit-source-id: 2c3ec0ef450cf357d8c88db7873f4ca1154b2034 * chore: update CLI to the latest version (#28623) Summary: Bumps CLI to the latest version, needed by https://github.com/facebook/react-native/pull/28572 to work. ## Changelog [INTERNAL] - Bump CLI to latest Pull Request resolved: https://github.com/facebook/react-native/pull/28623 Reviewed By: hramos Differential Revision: D21017766 Pulled By: cpojer fbshipit-source-id: 62a873923c58f8752edb0394db7e6dfceed92485 * Add "Open Debugger" and "Open React DevTools" to Android dev menu Summary: This diff introduces a new "Open Debugger" menu item for VMs that support on device debugging and for opening the React DevTools in Flipper. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20784279 fbshipit-source-id: caecdace00007224692d994a75c106842c8b2acb * Remove the post install step (#28651) Summary: Removes the post install step for Flipper, as the latest version of YogaKit is compatible with swift 5. cc alloy ## 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 --> [Flipper] [Template] - Remove the post install step for Flipper Pull Request resolved: https://github.com/facebook/react-native/pull/28651 Test Plan: Tested a newly created RN app without post install step and it built successfully. Reviewed By: passy Differential Revision: D21064653 Pulled By: priteshrnandgaonkar fbshipit-source-id: da56d0754d918e30a0ebe480c77590f0139d48ac * Revert D21064653: Remove the post install step Differential Revision: D21064653 Original commit changeset: da56d0754d91 fbshipit-source-id: 1086cfdeca9aa3830370ea115ba7b5f05d3fb124 * Remove out of date TODO Summary: No longer relevant. Changelog: [Internal] Reviewed By: mhorowitz Differential Revision: D21070955 fbshipit-source-id: 11b0384501b2780f5ac41899b5e8bbb4f7a4d730 * RNTester LayoutAnimation example: add more options Summary: Add more options to the LayoutAnimation example so it's easier to test more features of LayoutAnimations. 1) Add an option to animate reordering of views 2) Make animations slower, so it's easier to see what's going on and easier to trigger race conditions 3) Add options to mutate without animation, to test interrupting existing animations Changelog: [Internal] Updated Catalyst RNTester LayoutAnimation example with additional options Reviewed By: mdvacca Differential Revision: D21050309 fbshipit-source-id: 1daba4fd487693c34a2d40eb39a68c7d03c24f93 * Add a "reparenting" LayoutAnimation example that animates flattening/unflattening Summary: Simple test to see what it looks like when view flattening/unflattening is animated with LayoutAnimations. Changelog: [Internal] adding another example to LayoutAnimations example Reviewed By: mdvacca Differential Revision: D21074805 fbshipit-source-id: 551ed740f0ab5c5adcb19f5c35e932b8983cd108 * Fix jsi cmake include dirs (#207) Summary: I'm trying to use JSI for a React Native custom module. I saw these existing examples where the JSI API is used in the context of a CMakeLists.txt: https://github.com/terrysahaidak/host-object-test/blob/master/libs/android-jsi/test-jsi/src/main/cpp/CMakeLists.txt https://github.com/ericlewis/react-native-hostobject-demo/pull/4/files#diff-834320be1b4e4016bac27c05dcd17fb9 In both cases, they manually grab the include directories and jsi.cpp from node_modules/react-native, but I also saw that node_modules/react-native/ReactCommon/jsi/jsi already has a CMakeLists.txt that appears to be intended to provide a jsi static lib, so I tried to pull this into my own CMakeLists.txt like this: ``` add_subdirectory(${RN_DIR}/ReactCommon/jsi/jsi ${CMAKE_CURRENT_BINARY_DIR}/jsi) ... target_link_libraries(MyLib jsi) ``` Unfortunately when doing this, the consuming project still doesn't see the correct include directories. The change I'm proposing here is to use `target_include_directories` and declare that `..` is a public (to consumers) include directory for the library named `jsi`. With this change, you can do what I showed above to consume the jsi lib by just pulling in the CMakeLists.txt file into your own CMakeLists.txt file. Changelog: [General][Fixed] Fix jsi cmake include dirs Pull Request resolved: https://github.com/facebook/hermes/pull/207 Reviewed By: willholen Differential Revision: D21074270 Pulled By: tmikov fbshipit-source-id: 7d9ec3255f57a16c0b2be489dffa4540727738a1 * Resolve `kind-of` vulnerability by bumping to 6.0.3 Summary: https://github.com/advisories/GHSA-6c8f-qphg-qjgp Changelog: [General][Changed] Updated transitive dependency kind-of to 6.0.3 to resolve vulnerability (Note: this ignores all push blocking failures!) Reviewed By: cpojer Differential Revision: D21077747 fbshipit-source-id: d5c19b21b665130c6423f5caeddcd6378bac7dcb * Move CheckBox Android files to FB internal (#28658) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/28658 This moves the Java files to FB internal and updates all the buck files. ## Changelog: [Android] [Removed] This diff removes the CheckBox export from React Native. Internally, we are requiring CheckBox directly now and externally people will have to use the community maintained module. Reviewed By: cpojer Differential Revision: D21066998 fbshipit-source-id: 76821fcae899ff7342697ea7dd4737ef3b008213 * Part 1: Update ObjC++ codegen classes to use ObjCTurboModule::InitParams Summary: ## Summary Please check out D21035208. ## Changes - `ObjCTurboModule::ObjCTurboModule` changed to accept a bag of arguments `const ObjCTurboModule::InitParams` instead of an argument list. - TurboModule iOS codegen scripts updated to generated `ObjCTurboModule` subclasses that accept a `const ObjCTurboModule::InitParams` object in their constructor, and forward it to `ObjCTurboModule::ObjCTurboModule`. - All manually checked in code-generated ObjC++ classes (i.e: RCTNativeSampleTurboModule, RCTTestModule, FBReactNativeSpec) are updated. ## Rationale This way, the code-gen can remain constant while we add, remove, or modify the arguments passed to ObjCTurboModule. ## Commands run ``` function update-codegen() { pushd ~/fbsource && js1 build oss-native-modules-specs -p ios && js1 build oss-native-modules-specs -p android && popd; } > update-codegen ``` Changelog: [iOS][Changed] Update ObjCTurboModule to use ObjCTurboModule::InitParams Reviewed By: PeteTheHeat Differential Revision: D21036266 fbshipit-source-id: 6584b0838dca082a69e8c14c7ca50c3568b95086 * Part 2: Update ObjC++ codegen classes to use ObjCTurboModule::InitParams Summary: ## Summary Please check out D21035209. ## Changes - Codemod all ObjC NativeModule `getTurboModuleWithJsInvoker:nativeInvoker:perfLogger` methods to `getTurboModule:(const ObjCTurboModule::Args)` ## Script ``` var withSpaces = (...args) => args.join('\s*') var regexString = withSpaces( '-', '\(', 'std::shared_ptr', '<', '(?<turboModuleClass>(facebook::react::|react::|::|)TurboModule)', '>', '\)', 'getTurboModuleWithJsInvoker', ':', '\(', 'std::shared_ptr', '<', '(?<fbNamespace>(facebook::react::|react::|::|))CallInvoker', '>', '\)', '(?<jsInvokerInstance>[A-Za-z0-9]+)', 'nativeInvoker', ':', '\(', 'std::shared_ptr', '<', '(facebook::react::|react::|::|)CallInvoker', '>', '\)', '(?<nativeInvokerInstance>[A-Za-z0-9]+)', 'perfLogger', ':', '\(', 'id', '<', 'RCTTurboModulePerformanceLogger', '>', '\)', '(?<perfLoggerInstance>[A-Za-z0-9]+)', '{', 'return', 'std::make_shared', '<', '(?<specName>(facebook::react::|react::|::|)Native[%A-Za-z0-9]+SpecJSI)', '>', '\(', 'self', ',', '\k<jsInvokerInstance>', ',', '\k<nativeInvokerInstance>', ',', '\k<perfLoggerInstance>', '\)', ';', '}', ) var replaceString = `- (std::shared_ptr<$<turboModuleClass>>) getTurboModule:(const $<fbNamespace>ObjCTurboModule::InitParams &)params { return std::make_shared<$<specName>>(params); }` const exec = require('../lib/exec'); const abspath = require('../lib/abspath'); const relpath = require('../lib/relpath'); const readFile = (filename) => require('fs').readFileSync(filename, 'utf8'); const writeFile = (filename, content) => require('fs').writeFileSync(filename, content); function main() { const tmFiles = exec('cd ~/fbsource && xbgs -n 10000 -l getTurboModuleWithJsInvoker:').split('\n').filter(Boolean); tmFiles .filter((filename) => !filename.includes('microsoft-fork-of-react-native')) .map(abspath) .forEach((filename) => { const source = readFile(filename); const newSource = source.replace(new RegExp(regexString, 'g'), replaceString); if (source == newSource) { console.log(relpath(filename)); } writeFile(filename, newSource); }); } if (!module.parent) { main(); } ``` ## Re-generating diff ``` > hg revert -r .^ --all > node index.js # run script ``` Changelog: [iOS][Changed] - Make all ObjC NativeModules create TurboModules using ObjCTurboModule::Args Reviewed By: PeteTheHeat Differential Revision: D21036265 fbshipit-source-id: 404bcc548d1775ef23d793527606d02fe384a0a2 * Part 3: Update RCTTurboModuleManagerDelegate to use ObjCTurboModule::InitParams Summary: ## Summary Please check out D21035208. ## Changes - Update `RCTTurboModuleManagerDelegate getTurboModule:instance:jsInvoker:nativeInvoker:perfLogger` to use `RCTTurboModuleManagerDelegate getTurboModule:(const ObjCTurboModule::InitParams)` - Update all implementations of `RCTTurboModuleManagerDelegate` in accordance with this API change Changelog: [iOS][Changed] - Make RCTTurboModuleManagerDelegate create TurboModules via ObjCTurboModuleManager::InitParams Reviewed By: PeteTheHeat Differential Revision: D21036272 fbshipit-source-id: c16002c47db26e2ba143fc1080afe9e2fe1e7816 * chore: update `./scripts/test-manual-e2e.sh` (#28653) Summary: Recent changes broke the script - wrong path to open `RNTesterPods.xcworkspace` and other scripts - we change dir with `cd`. Another change is incorrect use of `RNTesterProject.xcodeproj` instead of a `xcworkspace`. This PR is a simple and short fix to make it run. ## Changelog [INTERNAL] - chore: update `./scripts/test-manual-e2e.sh` Pull Request resolved: https://github.com/facebook/react-native/pull/28653 Test Plan: Run `./scripts/test-manual-e2e.sh`. Things work. Differential Revision: D21079792 Pulled By: hramos fbshipit-source-id: 6bdb8be016f044852ed216ec53f80db40c84b5fd * use default value of enums YGDirection and YGMeasureMode instead of -1 Summary: Changelog: [Internal][Yoga] YGDirection variable was initialized incorrectly by casting -1 to YGDirection. Changing it to default value of direction Same for YGMeasureMode. Reviewed By: pasqualeanatriello Differential Revision: D20869042 fbshipit-source-id: 7bfe490193321baae875ef6fb49a938851950c9f * fix typo as there is no file called YGJNI.cpp (#990) Summary: fix typo in `YogaJNIBase.java` as there is no such file called `YGJNI.cpp` Pull Request resolved: https://github.com/facebook/yoga/pull/990 Reviewed By: pasqualeanatriello Differential Revision: D20735102 Pulled By: SidharthGuglani fbshipit-source-id: 3f9f4d78ba390feae3451330f997a221ab4ec70e * Remove unused packages from xplat/js/package.json Summary: We have a large amount of small packages that are completely unused, or only have one call site. This diff cleans up a lot of them and reduces node_modules by 12 MiB (down to 187). Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D21088213 fbshipit-source-id: 5fa7d3da5cbe744b0d9d3e3450d6135c1488ee79 * Make ColorValue public in StyleSheet.js Summary: This diff makes the ColorValue export "official" by exporting it from StyleSheet in order to encourage its use in product code. Changelog: Moved ColorValue export from StyleSheetTypes to StyleSheet Reviewed By: TheSavior Differential Revision: D21076969 fbshipit-source-id: 972ef5a1b13bd9f6b7691a279a73168e7ce9d9ab * Fabric: `LayoutableShadowNode:getLayoutMetrics` is not a virtual method anymore Summary: We don't use it as vitrual anymore (setLayoutMetrics is a non-virtual method already), so it does not need to be marker virtual. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D21028572 fbshipit-source-id: 99f86fdd4cf2f5972034d9058d7b82bdc8680187 * Fabric: Proper traits for `ImageShadowNode` and `ViewShadowNode` Summary: * <Image> must be a leaf node; having a proper trait will fail earlier in case of misuse (mounting something inside). * <View> must have a `View` trait because it's for what that trait is. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D21028573 fbshipit-source-id: 457716d4661333eb2357f34316f3e495ab4fda24 * Fabric: "Attempt to mutate a sealed object." is now an assert (not exception) Summary: This is a debug-only feature that simply should be an assert. When it triggers in debugger and bubbles to some random exception catch block which makes it impossible to understand was exactly it happens. Making it an assert will stop debugger exactly where it happens. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D21028571 fbshipit-source-id: 3df4ec0da922026bb9df61081cb71113577e06e9 * Fabric: Implementation of `getDebugDescription` for `std::array` Summary: Yoga uses `std::array` a lot (and `std::array` is not a `std::vector`), so it's useful for printing Yoga values. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D21028570 fbshipit-source-id: c6bf114d5362f085ea201ecdc5b7d59646b33ebd * Fabric: `componentregistry` module was decoupled from `uimanager` Summary: We need to break up the `uimanager` module in order to solve circular dependencies problem (which future diff would have otherwise). Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D20885163 fbshipit-source-id: 08eb1ba1d408fc0948e8d0da62380786a40973af * Fabric: `scheduler` module was decoupled from `uimanager` Summary: We need to break up the `uimanager` module in order to solve circular dependencies problem (which future diff would have otherwise). Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D20885645 fbshipit-source-id: 8148bd934879802b076261ed86fa78acf0a07ed3 * Fabric: `templateprocessor` module was decoupled from `uimanager` Summary: We need to break up the `uimanager` module in order to solve circular dependencies problem (which future diff would have otherwise). Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D20885646 fbshipit-source-id: b8e3199c0eacc57a5be1481595cf97c84f972293 * Migrate deprecated frameInterval to preferredFramesPerSecond (#28675) Summary: [frameInterval](https://developer.apple.com/documentation/quartzcore/cadisplaylink/1621231-frameinterval) was deprecated in favor of [preferredFramesPerSecond](https://developer.apple.com/documentation/quartzcore/cadisplaylink/1648421-preferredframespersecond). This migrates the deprecated call over. ## 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] - Migrate frameInterval to preferredFramesPerSecond Pull Request resolved: https://github.com/facebook/react-native/pull/28675 Test Plan: Xcode should no longer throw warnings about the deprecated call. Differential Revision: D21109710 Pulled By: shergin fbshipit-source-id: 772b9f625d3e22cd4d8cd60bddad57ff8611af54 * Fabric: Fix case of Glog include in MountingTest.cpp (#28616) Summary: This pull request changes the include of Glog from `<Glog/logging.h>` to `<glog/logging.h>` in `MountingTest.cpp`. This fixes building on a case-sensitive filesystem. ## Changelog [Internal] [Fixed] - Fabric: Fix case of Glog include in MountingTest.cpp Pull Request resolved: https://github.com/facebook/react-native/pull/28616 Test Plan: The `include` of Glog no longer causes issues with building `MountingTest.cpp` on a case-sensitive filesystem. Differential Revision: D21118085 Pulled By: shergin fbshipit-source-id: c958c54bf88333fd5001127779c855ce8c2666c3 * Fabric: Add Unicode prefix to AttachmentCharacter (#28617) Summary: This pull request adds a Unicode `u8` prefix to the string literal returned in `AttributedString.cpp`'s `Fragment::AttachmentCharacter()`. This fixes the following error when building on MSVC: ``` react\attributedstring\AttributedString.cpp(21): error C4566: character represented by universal-character-name '\uFFFC' cannot be represented in the current code page (1252) ``` ## Changelog [Internal] [Fixed] - Fabric: Add Unicode prefix to AttachmentCharacter Pull Request resolved: https://github.com/facebook/react-native/pull/28617 Test Plan: The Fabric test suite has been ran on a Clang-based build of Fabric on macOS, and no regressions in it have been noted. Differential Revision: D21118078 Pulled By: shergin fbshipit-source-id: c105de5e4edb67fed97ce44153a75d9d380bf588 * Fabric: Fixed incorrect early-return in `UIView+ComponentViewProtocol::updateLayoutMetrics` Summary: Before the change, an incorrect (NaN or Inf) values in LayoutMetrics might force an early return in the `updateLayoutMetrics:oldMetrics:` method implementation. This was not correct because the rest of the method also didn't run in this case, so it might force some value to stale. E.g., imagine we have an instruction that contains NaN size and `display: none`. Previously, the function might just return right before applying sizes and progress the stored "already applied" value of LayoutMetrics which will cause the view being visible even if it should not. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D21110644 fbshipit-source-id: 501319d7b1dcd5c18f27e0ceca3c8d207485c49b * Fix border-stroke drawing after resetting border-radius (#28356) Summary: This PR fixes incorrect drawing of the View borders on Android, after changing the border-radius back to 0 *(and when no background-color is defined)*. This happens because the `drawRoundedBackgroundWithBorders` function in ReactViewBackgroundDrawable changes the style on the Paint object to `STROKE`. This style is however never reverted back to `FILL`. This change ensures that the Paint style is set to `FILL` for the full execution of the `drawRectangularBackgroundWithBorders` function. ## Changelog `[Android] [Fixed] - Fix border-drawing when changing border-radius back to 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28356 Test Plan: **Faulty situation:** ![ezgif com-video-to-gif](https://user-images.githubusercontent.com/6184593/77153163-9759b280-6a99-11ea-82bb-33a1e0a4934c.gif) **After the fix:** ![ezgif com-video-to-gif (1)](https://user-images.githubusercontent.com/6184593/77153825-c91f4900-6a9a-11ea-8e0c-a4280b9e72b8.gif) Differential Revision: D21124741 Pulled By: shergin fbshipit-source-id: 2044f8e8ad59a58df42b64d7ee8c4ad1d3b562f1 * Fabric: Using proper clock in MountingTelemetryTest Summary: Apparently, `std::this_thread::sleep_for` uses a different clock to measure time which causes ofter misalignment with the clock which Telemery uses which makes the test flaky. Using the same clock should fix it. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D21116058 fbshipit-source-id: 52dde2e325776d365431a2a957dcc12dfe53f890 * Fix rounded border drawing when border-radius is smaller than border-width (#28358) Summary: This PR fixes the drawing of the border rounded edges when the border-radius is small than the border-width. The current implementation capped the possible border-radius making it impossible to set smaller border-radii when using thicker borders. After inspection it was found that the rounded-rect calculation is incorrect. ## Changelog `[Android] [Fixed] - Fix rounded border-drawing when border-radius is smaller than border-width` Pull Request resolved: https://github.com/facebook/react-native/pull/28358 Test Plan: **Faulty situation:** As you can see, when the border-radius becomes very low, the border is stuck at a minimum value. Only after setting the border-radius fully to 0 is it again rendered correctly. ![ezgif com-video-to-gif (2)](https://user-images.githubusercontent.com/6184593/77183540-c3435b00-6ace-11ea-950d-29a0ea1757bd.gif) **After the fix:** ![ezgif com-video-to-gif (3)](https://user-images.githubusercontent.com/6184593/77183619-e837ce00-6ace-11ea-93a5-910127d352b7.gif) Differential Revision: D21124739 Pulled By: shergin fbshipit-source-id: cefd1776b77b5b9fb335e95fd7fdd7f345579dc4 * Fabric: `ComponentDescriptor::cloneProps()` now never returns the base props objects Summary: The diff changes how the `empty raw props` optimization works in `ComponentDescriptor::cloneProps()`. Now it only fires only when the base `props` object is null, which is practically all production cases we have (and care about). (I tried, in a normal run there were no cases where the empty raw props were passed with non-null props.) From the other side, the old behavior that may return the same props objects previously several times created bugs and practically unexpected results and practically disallowed to clone props objects easily. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D21110608 fbshipit-source-id: 884807cd8e9c5c3e6cc1c9e4c1f0227259cc21fb * Upgrade to Jest 25 Summary: This diff upgrades Jest to the latest version which fixes a bunch of issues with snapshots (therefore allowing me to enable the Pressable-test again). Note that this also affects Metro and various other tooling as they all depend on packages like `jest-worker`, `jest-haste-map` etc. Breaking changes: https://github.com/facebook/jest/blob/master/CHANGELOG.md This diff increases node_modules by 3 MiB, primarily because it causes more duplicates of `source-map` (0.8 MiB for each copy) and packages like `chalk` 3.x (vs 2.x). The base install was 15 MiB bigger and I reduced it to this size by playing around with various manual yarn.lock optimizations. However, D21085929 reduces node_modules by 11 MiB and the Babel upgrade reduced node_modules by 13 MiB. I will subsequently work on reducing the size through other packages as well and I'm working with the Jest folks to get rid of superfluous TypeScript stuff for Jest 26. Other changes in this diff: * Fixed Pressable-test * Blackhole node-notifier: It's large and we don't need it, and also the license may be problematic, see: https://github.com/facebook/jest/pull/8918 * Updated jest-junit (not a Jest package) but blackholed it internally because it is only used for open source CI. * Updated some API calls we use from Jest to account for breaking changes * Made two absolutely egrigious changes to existing product code tests to make them still pass as our match of async/await, fake timers and then/promise using `setImmediate` is tripping up `regenerator` with `Generator is already run` errors in Jest 25. These tests should probably be rewritten. * Locked everything to the same `resolve` version that we were already using, otherwise it was somehow pulling in 1.16 even though nothing internally uses it. Changelog: [General] Update Jest Reviewed By: rickhanlonii Differential Revision: D21064825 fbshipit-source-id: d0011a51355089456718edd84ea0af21fd923a58 * Apply placeholderColor to TextInput component Summary: Changelog: [Internal] TextInput's `placeholderTextColor` prop was being ignored. This diff fixes that. Reviewed By: JoshuaGross Differential Revision: D21064118 fbshipit-source-id: 33f148c355cee846db010153e0c65ea43155c3c9 * Fix mistake in swapping left/right layout properties Summary: Changelog: [Internal] We were assigned `undefined` value to incorrect edge, instead of `YGEdgeLeft` it should have been `YGEdgeRight`. If node has `YGEdgeRight` value, it needs to be reassigned to `YGEdgeEnd` and its original value set to undefined. Reviewed By: mdvacca Differential Revision: D21095234 fbshipit-source-id: fbecd9b7e6670742ad4a4bb097760aa10eec8685 * Fixed incorrect owner assignment in YGNode move constructor Summary: Assigning self as an owner makes a cycle which is obviously a bug. Changelog: [Internal] Small change in Yoga (should not affect RN). Reviewed By: SidharthGuglani Differential Revision: D21111423 fbshipit-source-id: 1835561c055ac827f5ce98a044f25aed0d1845a5 * Easy diff to add a TODO Summary: Easy diff to add a TODO to refactor `sendAccessibilityEvent` to use ViewCommands This was orginally added D17142507 changelog: [Internal] Internal change Reviewed By: JoshuaGross Differential Revision: D21137348 fbshipit-source-id: aff38ccad8dfbb222f83161e2bd5da82f543e5db * Add support for generating custom messages Summary: Until now we've generated scaffolding entirely based on the official devtools protocol spec. This diff adds support for defining custom domains in `custom.json` which will be merged with the upstream protocol JSON definition. ChangeLog: [Internal] Add support for Hermes-specific CDP messages Reviewed By: bestander Differential Revision: D20754605 fbshipit-source-id: a8075f81816a40114d1a3332192c7aa076b17848 * Implement Hermes.setPauseOnLoad Summary: This Hermes-specific mode is similar to Debugger.setPauseOnExceptions and lets the VM know that it should enter a Pause state whenever a new script is loaded/executed. The debugger can then take its time to parse the source map and update any breakpoints, before automatically continuing. Changelog: [Internal] Implement a Hermes.setPauseOnLoad CDP call Reviewed By: bestander Differential Revision: D20754604 fbshipit-source-id: 7f9d0638706c99e9dcb534699b633f658e364909 * Switch isPackagerRunning to a class method. Summary: This diff exports `isPackagerRunning` as a class method to be used without and instance. Changelog: [Internal] Reviewed By: cpojer Differential Revision: D21094414 fbshipit-source-id: 44becb59e3c08d66e4992c4c1b32d6efcd4fe257 * Fabric: Fixed `getDirtied` vs `isDirty` in `YogaLayoutableShadowNode` Summary: This is quite a fateful mistake. `getDirtied()` returns the pointer to a function which is obviously a mistake here; we should use `isDirty()` instead. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D21028569 fbshipit-source-id: 95212b31f4e32d51c594d5209f295397af3f1252 * Fabric: More strict policies to dirty Yoga nodes in YogaLayoutableShadowNode Summary: Yoga uses a dirty flag to re-layout nodes. In normal, single-threaded approach the policy for dirtying is simple: if a node was changed, we need to dirty it. In the Concurrent Yoga approach, those rules are not so simple, and it seems we haven't formalized those rules yet. Investigating some layout issues that we have in Fabric, I tend to believe that we don't dirty as much we should. Hense this change adds mode dirtying. Reviewed By: JoshuaGross Differential Revision: D21092815 fbshipit-source-id: 4603c97ccb79efcdf5e6a4cc450ebe61b63effb3 * Allow iOS PlatformColor strings to be ObjC or Swift UIColor selectors (#28703) Summary: Per discussion in https://github.com/react-native-community/releases/issues/186 the iOS `PlatformColor()` function is documented to use the semantic color names provided by the system. The referenced HIG documentation itself links to the `UIColor` documentation for semantic colors names. However, these names differ depending on if you are viewing the new Swift API docs or the Objective C docs. The current Objective C implementation in react-native assumes Objective C UIColor selector names that are suffixed 'Color'. But in Swift, Apple provides a Swift Extension on UIColor that makes aliases without the the 'Color' suffix and then makes the original selectors invalid presumably via `NS_UNAVAILABLE_SWIFT`. Since both selector names are valid depending on if you are using Objective C or Swift, let's make both forms be legal for `PlatformColor()`. In `RCTConvert.m` there is a dictionary of legal selector names. The code already supports the ability to have names be aliases of other selectors via a RCTSelector metadata key. The change adds code to the initialization of the map: it iterates over the keys in the map, which are all ObjC style UIColor selectors, and creates aliases by duplicating the entries, creating key names by stripping off the ObjC "Color" suffix, adds the RCTSelector key referring to the original and then appends these new Swift aliases to the map. ## Changelog [iOS] [Changed] - Allow iOS PlatformColor strings to be ObjC or Swift UIColor selectors Pull Request resolved: https://github.com/facebook/react-native/pull/28703 Test Plan: The PlatformColorExample.js is updated to use the new, shorter Swift selector names. There are still other examples in the same file and in unit tests that exercise the ObjC selector names. <img width="492" alt="PlatformColor" src="https://user-images.githubusercontent.com/30053638/79809089-89ab7d00-8324-11ea-8a9d-120b92edeedf.png"> Reviewed By: shergin Differential Revision: D21147404 Pulled By: TheSavior fbshipit-source-id: 0273ec855e426b3a7ba97a87645859e05bcd4126 * Update Differ test Summary: Update differ test so it passes again. Previously to D21111423 (I think) nodes were being incorrectly detected as updated even if they weren't different, so now there are fewer unnecessary Update mutations generated. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D21148647 fbshipit-source-id: cab6e3ecd0a457e1ac3155b3468bcc56663dab0b * Enable Yoga logging in Fabric Debug Summary: This diff extends Fabric to support Yoga logging changeLog: [Internal] Internal changes in Fabric to enable yoga logging Reviewed By: JoshuaGross Differential Revision: D21150195 fbshipit-source-id: a2e8308a79a7b422bf9ecc3a65f822b305f02c5d * Easy diff to document in code how to enable logging of Shadow Tree instrospection Summary: Easy diff to document in code how to enable logging of Shadow Tree instrospection changeLog: [Internal] Internal change used on Fabric Reviewed By: JoshuaGross Differential Revision: D21150196 fbshipit-source-id: 8eb23ec3ea1d574b79b09333428ab52c851065dd * Flip text alignment in case layout direction is RTL Summary: Changelog: [Internal] Flip text alignment in case layout direction is RTL. Reviewed By: JoshuaGross, mdvacca Differential Revision: D21130371 fbshipit-source-id: cf56ca052c17a48e321803b0f99f8a4baaa0e67b * Daily `arc lint --take GOOGLEJAVAFORMAT` Reviewed By: zertosh Differential Revision: D21154707 fbshipit-source-id: 11956915c265f98e286638b91d66d51545e3a311 * Upgrade Flipper to 0.37.0 (#28545) Summary: Bump flipper to 0.37 for both iOS and Android ## Changelog [Android] [Changed] - Upgrade Flipper to 0.37.0 [iOS] [Changed] - Upgrade Flipper to 0.37.0 Pull Request resolved: https://github.com/facebook/react-native/pull/28545 Test Plan: RNTester build pass Reviewed By: rickhanlonii Differential Revision: D20930069 Pulled By: hramos fbshipit-source-id: a7cb719da3e51e6a42d27d5e64bc664398d0d3c5 * Upgrade babel-eslint in xplat/js Summary: `babel-eslint` is the parser you can supply to ESLint based off of Babel. `babel-eslint` 10.1.0 is the newest production version of `babel-eslint`. There are very few changes between 10.0.1 (the lowest previous version) and 10.1.0. There are only 3 non-version-bump commits: 2 bug fixes and enabling parsing of Flow enums. The only project that was on a lower version than 10.0.1 was `/xplat/js/RKJSModules/Libraries/Relay/oss/__github__` - test below Changelog: [Internal] Reviewed By: cpojer Differential Revision: D21055850 fbshipit-source-id: bae0d8af5c6d833a4dbb0ad775c8e5e78ead1051 * RN: Create `RootTag` Type Summary: Creates a `RootTag` type and refactors the `RootTagContext` module a bit. This creates space for eventually changing `RootTag` into an opaque type that is only created once by `AppContainer`, and only consumed by native abstractions. Changelog: [Internal] (Note: this ignores all push blocking failures!) Reviewed By: cpojer Differential Revision: D21127173 fbshipit-source-id: 60177a6e5e02d6308e87f76d12a271114f8f8fe0 * RN: Add `RootTag` Type to TurboModule Summary: Adds `RootTag` as a valid type for arguments and return types in TurboModules (on both Android and iOS). This will enable us to change `RootTag` into an opaque type. There are two compelling reasons to do this: - JavaScript will no longer be able to safely depend on `RootTag` being a number (which means we can change this in the future). - Call sites using `unstable_RootTagContext` will can get a `RootTag`, but call sites using the legacy `context.rootTag` will not. This means the opaque type will give us a strategy for migrating away from legacy context and eventually making `unstable_RootTagContext` the only way to access `RootTag`. Changelog: [Internal] (Note: this ignores all push blocking failures!) Reviewed By: RSNara Differential Revision: D21127170 fbshipit-source-id: baec9d7ad17b2f8c4527f1a84f604fc0d28b97eb * RN: Fix Codegen Schema Buck Dependency (#28719) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/28719 The Buck dependencies for the schema rule is missing the source files for the new codegen (and specifically, the parser). Changelog: [Internal] (Note: this ignores all push blocking failures!) Reviewed By: cpojer Differential Revision: D21162993 fbshipit-source-id: 4addb6f257134e245a5d86dd427ee2536ed6d658 * Flow 0.123.0 in xplat/js Summary: Changelog: [Internal] ## Sync of generated files Ran ``` js1 upgrade www-shared -p core_windowless ``` but had to manually revert ``` RKJSModules/Libraries/www-shared/core_windowless/logging/FBLoggerType.flow.js RKJSModules/Libraries/www-shared/core_windowless/logging/FBLogger.js ``` because they introduced more errors ## Flow version bump ``` ~/fbsource/fbcode/flow/facebook/deploy_xplat.sh 0.123.0 ``` Reviewed By: gkz Differential Revision: D21159821 fbshipit-source-id: e106fcb43e4fc525b9185f8fc8a246e6c3a6b14f * Remove outdated metro type definitions Summary: RN itself does not depend on Metro any longer, which is abstracted away into the CLI. I don't think we need those type definitions any longer as we have proper Metro definitions internally. I'm removing them because they keep showing up in biggrep when I look for things. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D21089924 fbshipit-source-id: 2845277af12dae0f0baefaf85adefffb6ef9f2a5 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D21175893 fbshipit-source-id: 101734c1b968ce241a15648efdcaeabbd789952d * remove tvOS from template (#28706) Summary: According to the [0.62 blog post](https://reactnative.dev/blog/2020/03/26/version-0.62), Apple TV support has moved to react-native-tvos. The template still contains info.plist for tvOS, so I've removed them for future releases. ## 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] [Removed] - Removed tvOS related files from the template Pull Request resolved: https://github.com/facebook/react-native/pull/28706 Test Plan: run `react-native init TestTemplate` and remove tvOS related files and verified that iOS and Android runs on emulator. Differential Revision: D21182211 Pulled By: hramos fbshipit-source-id: 41d2e19e5158d7ec103a37c01a93cf511fc1e4c9 * Fabric: `ConcreteShadowNode::initialStateData()` now accepts a `ShadowNodeFamilyFragment` instead of just a `SurfaceId` Summary: We need it to be able pass an `EventEmitter` object to constructed concrete State objects. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D21169581 fbshipit-source-id: 3eef0310de7e2f061108aa85c1a39678a43fe85e * Fabric: Introducting `ShadowNodeFamilyFragment::Value` Summary: `ShadowNodeFamilyFragment::Value` is a value couter-part type for `ShadowNodeFamilyFragment`. We need that to be able safely copy data stored inside a `ShadowNodeFamilyFragment` object. Changelog: [Internal] Fabric-specific internal change. Reviewed By: kacieb Differential Revision: D21169580 fbshipit-source-id: 1a485e1b2ae47bc7da9476a60466934ac9d61366 * Overhaul RCTTurboModule creation and initialization Summary: ## Problems: In my investigation of T65656635, I realized that the TurboModule system has a number of problems: - In TurboModules, we use 1 lock to create n TurboModules. We should change this setup to n locks for n TurboModules. This way, two threads creating two different NativeModules don't compete for the same lock. Also, this is how it's done in Android (TurboModules & NativeModules), and iOS (NativeModules). - In TurboModules, we don't calculate "requires main queue setup" faithfully. In the legacy system, if a NativeModule has a custom `init` method or a custom `constantsToExport` method, it "requires main queue setup" with a warning. - In TurboModules, we don't create the NativeModule on the main queue, if "requires main queue setup" is true. Instead, the NativeModule is always created on the thread that requires it. - In TurboModules, we don't perform any concurrency control around `id<RCTTurboModule>` setup. We should. ## What this diff does In this diff, I fixed all the aforementioned issues by re-implementing `provideRCTTurboModule:`. **Algorithm Notes:** - **Gist:** When `n` threads race to create NativeModule `x`, only the first thread creates and sets up `x`. All others are told to wait. Once the creator thread finishes its job, it notifies all other waiting threads, which then wake up and return the newly created NativeModule. This algorithm was initially implemented in NativeModules for Android inside (ModuleHolder.java). I modified and implemented it for TurboModules for Android, and now this diff implements it for TurboModules for iOS. - The TurboModule cache is replace with a TurboModuleHolder map. A TurboModuleHolder manages the creation lifecycle of a TurboModule, and holds a condition variable and mutex for doing concurrency control around it. When the bridge invalidates, in TurboModuleManager, we set the `invalidating` flag to true, which prevents the insertion of new entries into the TurboModuleHolder map. - I added a `std::mutex` to serialize calls into the TurboModuleManagerDelegate, so we don't get races if the delegate isn't thread-safe. Changelog: [iOS][Fixed] - Re-implement RCTTurboModuleManager provideRCTTurboModule: Reviewed By: shergin Differential Revision: D21170099 fbshipit-source-id: 8792812c2237d3bfc80c9834c818e011de85b0ea * Fix folly::dynamic crash when attaching a debugger to Hermes Summary: folly_futures was compiled with and exported -DFOLLY_MOBILE=1, while folly_json did not. This flag disables fancy F14 data structures for folly::dynamic in favor of a simple std::unordered_map. This caused inlined/templated code from modules depending on folly_futures to disagree with the implementations in folly_json, leading to a crash. The only such libraries were libhermes-inspector and (transitively) libhermes-executor-debug, and these only use folly::dynamic for CDP serialization, which is why the problem was not more apparent. Changelog: [Internal] Fix crash when attaching a Hermes debugger Reviewed By: mhorowitz Differential Revision: D21193307 fbshipit-source-id: 2b795bb6f4f7f991e2adaacec62d62616117322b * Set black as default text color for <TextInput/> on iOS (#28708) Summary: This is a follow-up pull request to https://github.com/facebook/react-native/issues/28280 (reviewed by shergin). This pull request tried to solve the problem of the default color in a TextInput in dark mode on iOS being white instead of black. I got suggested to solve the problem not on the level of RCTTextAttributes, but on the level of RCTUITextField. Setting `self.textColor = [UIColor black];` in the constructor did not work, because it gets overwritten by nil in `RCTBaseTextInputView.m`. There I implemented the logic that if NSForegroundColorAttributeName color is nil then the color is being set to black. I think the `defaultTextAttributes` property confuses here, because it ends up being the effective text attributes, e.g. if I unconditionally set the default text color to black, it cannot be changed in React Native anymore. So I put the nil check in. ## Changelog [iOS] [Fixed] - TextInput color has the same default (#000) on iOS whether in light or dark mode Pull Request resolved: https://github.com/facebook/react-native/pull/28708 Test Plan: I have manually tested the following: - The default text color in light mode is black - The default text color in dark mode is black - The color can be changed using the `style.color` attribute - Setting the opacity to 0.5 results in the desired behavior, the whole TextInput becoming half the opacity. – Setting the `style.color` to rgba(0, 0, 0, 0.5) works as intended, creating a half-opaque text color. Differential Revision: D21186579 Pulled By: shergin fbshipit-source-id: ea6405ac6a0243c96677335169b214a2bb9ccc29 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D21202121 fbshipit-source-id: 6acb53e6ca941e465b11aeac4215533c16067eed * RN: Rename `{ => Event}ObjectPropertyType` in Codegen Summary: Straightforward rename to clarify the purpose of this type. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D21160790 fbshipit-source-id: eaf5e8c9f51e16134e153a6321857234be1aa338 * RN: Rename `{NativePrimitive => ReservedProp}TypeAnnotation` in Codegen Summary: Straightforward rename to clarify the purpose of this type. The current naming made more sense before the codegen also produced code for NativeModules. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D21160793 fbshipit-source-id: 6787ef298e32ff1b4d506afd831af96764f5af6f * RN: Rename `{ => NativeModule}MethodTypeShape` in Codegen Summary: Straightforward rename to clarify the purpose of this type. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D21160791 fbshipit-source-id: 422d09243edda0660815eb2f0ce51f7e56134983 * RN: Add `RootTag` Codegen Parser Test (and Cleanup) Summary: Adds a `RootTag` parser test for the new codegen for NativeModules/TurboModules. I'm doing this in a prerequisite commit in order to make the diff of the diff clearer when I implement proper support for `RootTag`. This also fixes some of the minor typos and mistakes that I noticed. I also wanted to land these benign snapshot changes independent of the upcoming behavior changes. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D21160792 fbshipit-source-id: 5f29f34035da30d7afa2369dbc19e95954553e88 * RN: Add `RootTag` to New NativeModule Codegen Summary: Adds support for `RootTag` in the new codegen for NativeModules/TurboModules. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D21160788 fbshipit-source-id: 952189f6e8bc8fde8b403d4c0e77b5d66b3f03e4 * RN: Add `RootTag` to New Commands Codegen Summary: Adds support for `RootTag` in the new codegen for Native Component Commands. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D21169371 fbshipit-source-id: 3b25433f3328e9c04cfe45bb176fc06d63559f14 * BackHandler: specify function return type for handler (#28192) Summary: Following the comment https://github.com/DefinitelyTyped/DefinitelyTyped/pull/42618#discussion_r384584159 Modify the flowtype of BackHandler function to have more specific return type. ## Changelog [General] [Changed] - Changed type of BackHandler to be more specific. Pull Request resolved: https://github.com/facebook/react-native/pull/28192 Test Plan: No flow error in RNTester Reviewed By: TheSavior Differential Revision: D20771113 Pulled By: hramos fbshipit-source-id: 5ca65e2a2b3f8726b8fb4606473d8fad5b0ce730 * Fabric: Simplifying Yoga and Fabric integration Summary: The integration with Yoga was pretty complex from day one. The first attempt to make it simpler was in D19963353 when we removed a bunch of layers of indirection. This is the second iteration that aimed to simplify the structure of methods and their responsibilities. The only conceptual change (that I am aware of) in this diff is that now we don't support (imaginary) case where a non-leaf YogaLayoutableShadowNode can have a non-YogaLayoutableShadowNode child. In the previous version, it was a no-op, now it's not supported and an assert will fire. Alongside with refactoring, this diff implements several helper functions that verify the invariants important for the Concurrent Layout in debug mode. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D21198222 fbshipit-source-id: cc085904948056f861562af5bd2571de45a743b9 * Clean up comments about null state wrappers Summary: Updating state with a null wrapper is neither desirable, nor possible. The underlying task was closed, just cleaning up comments. Changelog: [Internal] comments only Reviewed By: mdvacca Differential Revision: D21186545 fbshipit-source-id: d14ddd59d42e8fd91c6e7fd50037311d4e8d0b60 * Modal: disable view flattening explicitly for the children of Modal, the content wrappers Summary: I noticed that in ModalHostShadowNode.java (not used in Fabric), there's an assumption that the Modal will have exactly one child on the native side; this child is explicitly specified in Modal.js. However, in Fabric, these views are flattened and so the Modal will actually have N children - whatever children the product code passes into the Modal. In *theory* this should be fine, but might be causing issues. Not sure. This is an experiment and shouldn't be landed until we verify that (1) this actually matters, (2) that it fixes an issue with Modal on iOS or Android. Changelog: [Internal] Change to make Fabric consistent with non-Fabric Modal Reviewed By: mdvacca Differential Revision: D21191822 fbshipit-source-id: 9d65f346387fd056649d4063d70220f637ba8828 * Support `contentOffset` property in Android's ScrollView and HorizontalScrollView Summary: For a very long time, iOS has supported the `contentOffset` property but Android has not: https://github.com/facebook/react-native/issues/6849 This property can be used, primarily, to autoscroll the ScrollView to a starting position when it is first rendered, to avoid "jumps" that occur by asynchronously scrolling to a start position. Changelog: [Android][Changed] ScrollView now supports `contentOffset` Reviewed By: mdvacca Differential Revision: D21198236 fbshipit-source-id: 2b0773569ba42120cb1fcf0f3847ca98af2285e7 * RN: Fix Text Layout Ignoring Parent Bounds Summary: Fixes text layout so that the parent bounds are correctly respected. This fixes two bugs: - **Parent width is not respected.** This was caused by the recent change to shrink-wrap text layout. - **Parent height is not respected.** This has always been a bug. After this change, Android will behave like iOS. Changelog: [Android] [Fixed] - Text layout no longer ignores parent bounds Reviewed By: mdvacca Differential Revision: D21199030 fbshipit-source-id: cc072bdcff64167db1f79b7bf965e57a7396cdf4 * Remove unnecessary cast to int in TextInlineView measure functions Summary: This diff removes unnecessary (int) casts in the calculation of layout for TextInlineViews changeLog: [Internal][Android] Internal optimization on the calculation of layout for TextInlineViews Reviewed By: JoshuaGross Differential Revision: D21211532 fbshipit-source-id: 920c1f88d042f3e1f6bfd0f560371f7482a62064 * Use RTL in RTLExample when Platform != android (#28742) Summary: This change upstreams a small change we did in react-native-windows to allow the RTLExample RNTester page to function correctly on Windows. The change is part of this Pr: https://github.com/microsoft/react-native-windows/pull/4683 Currently the direction property is gated behind a check for Platform == 'iOS', which means it only works on iOS. Windows supports direction = 'rtl' so I've chanced this check to Platform != 'android'. ## 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] [Changed] - Changed RTLExample RNTester page to use direction = 'rtl' when Platform is not Android. Pull Request resolved: https://github.com/facebook/react-native/pull/28742 Test Plan: Confirmed this change works correctly in RNTester on Windows. Have not confirmed iOS as I don't have Mac hardware. Differential Revision: D21235579 Pulled By: shergin fbshipit-source-id: 47ab93c2bcd0dbc8347c6746081ae3c64f88faa5 * Add Dark Mode support to the App template and NewAppScreen components (#28711) Summary: This PR adds support for the dark mode and dynamic theme changing to the default App template and to the related `NewAppScreen` components. Using `useColorScheme` hook forced me to refactor a bit main `App.js` file, but I think those changes are step in the right direction according to way in which React Native is used in larger apps, so new `Section` component has been extracted to reduce code redundancy/repetition inside `App`. Additional color `darker` has been added to the `Colors` statics from `NewAppScreen` because `dark` was too bright for the Dark Mode backgrounds. Also main `StoryBoard` on iOS has been updated to use theme based colors instead of static or hardcoded ones. There was also an unused, empty `Label` which I have removed. ~~I'm not so much experienced with Android. If someone could also update Android splash screen (if Android requires such change) it will be nice. I want to look at this later using simulator.~~ > I have updated the Android splash screen and tested this change on the Android emulator. If you have any comment or corrections feel free to post them out, I would like to put more work into this PR if it's needed. Dark Mode this days is a part of near every OS, so it could be considered as a standard feature. I hope those changes helps people which struggle with the basic theming implementation (+ there is now an example of hook and `children` prop usage in the template). ## Changelog [Internal] [Added] - Add dark mode support to the default app template Pull Request resolved: https://github.com/facebook/react-native/pull/28711 Test Plan: I have tested the App from the template on the iOS device and in Android emulator with RN `0.63.0-rc`. Screen recording on iOS (demonstarates both modes, both splash screens and transition): ![ezgif-6-e24ee8e839c9](https://user-images.githubusercontent.com/719641/80025923-a04b0300-84e1-11ea-824a-b4363db48892.gif) Screenshot of iOS app in Dark Mode: ![IMG_6542](https://user-images.githubusercontent.com/719641/79885748-c98f6480-83f7-11ea-8c73-1351a721d5d6.PNG) Screenshot of iOS app splash screen in Dark Mode: ![IMG_6544](https://user-images.githubusercontent.com/719641/79960431-add29f80-8485-11ea-985c-b39176024ffa.PNG) Screenshot of Android app in the emulator: ![Screenshot_1587566100](https://user-images.githubusercontent.com/719641/79995454-88f72000-84b7-11ea-810b-dfb70de03c2a.png) Differential Revision: D21236148 Pulled By: shergin fbshipit-source-id: 0c8a9534d3a3f8f8099af939243a889ac4df6cda * Allow use of std::tuple<> with decorators directly Summary: Previously, a derived class, WithTuple, was used. This ran into bugs in MSVC (see https://github.com/microsoft/STL/issues/121). Instead, use specialization to get the same result using std::tuple directly. This avoids the bug, and is a cleaner API. Changelog: [Internal] Reviewed By: dulinriley Differential Revision: D21233677 fbshipit-source-id: 1d75991847164e525b4ba70f65a90627e5f8cd56 * Fabric: Added assert in ShadowNode Summary: It's not allowed to return nullptr from the callback. The assert ensures it which is helpful during development. Probably, we should consider using `gsl::not_null<>` here. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D21149891 fbshipit-source-id: a5f77b35029f22b499491721036405682f812a38 * Fabric: Test for State Reconciliation mechanism Summary: It's not immediately obvious from the UI/UX when/if this mechanism breaks, so it's good to have a test. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D21184718 fbshipit-source-id: 25432a1398cff3ce61f62cf433e3cb73d7a7a93f * ScrollView, HorizontalScrollView: support `null` contentOffset Summary: According to the Flow types, `contentOffset` is nullable. Support that. Changelog: [Internal] Fix to (1) support null contentOffset in ScrollView and HorizontalScrollView, added on Android after the last release. (2) Correctly add support for contentOffset in ScrollView (I missed that when adding it to HorizontalScrollView in the previous diff). Reviewed By: alsun2001 Differential Revision: D21243028 fbshipit-source-id: ebef9a9054a3e4dd88556739e836b7ece48fda12 Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: George Zahariev <gkz@fb.com> Co-authored-by: Scott Wolchok <swolchok@fb.com> Co-authored-by: Radek Czemerys <radko93@gmail.com> Co-authored-by: Lauren Tan <laurentan@fb.com> Co-authored-by: Vojtech Novak <vonovak@gmail.com> Co-authored-by: Tom Underhill <tomun@microsoft.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Frieder Bluemle <frieder.bluemle@gmail.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Valentin Shergin <shergin@fb.com> Co-authored-by: Will Holen <willholen@fb.com> Co-authored-by: Sidharth Guglani <sidharthguglani@fb.com> Co-authored-by: empyrical <empyrical@outlook.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Eli White <eliwhite@fb.com> Co-authored-by: Christoph Nakazawa <cpojer@fb.com> Co-authored-by: Tommy Nguyen <tonguye@microsoft.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: Tim Yung <yungsters@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Pritesh Nandgaonkar <prit91@fb.com> Co-authored-by: Ryan Tremblay <ryan.tremblay@microsoft.com> Co-authored-by: acton393 <zhangxing610321@gmail.com> Co-authored-by: Zack Argyle <zackargyle@fb.com> Co-authored-by: Jason Safaiyeh <safaiyeh@protonmail.com> Co-authored-by: Hein Rutjes <IjzerenHein@users.noreply.github.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: generatedunixname89002005287564 <generatedunixname89002005287564@fb.com> Co-authored-by: sunnylqm <sunnylqm@qq.com> Co-authored-by: Panagiotis Vekris <pvekris@fb.com> Co-authored-by: Jonny Burger <jonathanburger11@gmail.com> Co-authored-by: Keith Melmon <kmelmon@microsoft.com> Co-authored-by: simek <gosimek@gmail.com> Co-authored-by: Marc Horowitz <mhorowitz@fb.com>
2021-07-22 01:24:02 +03:00
import typeof {RootTagContext} from './Libraries/ReactNative/RootTag';
import type {HostComponent as _HostComponentInternal} from './Libraries/Renderer/shims/ReactNativeTypes';
Add HostComponent to the public API of React Native Summary: In React Native there are three types of "Native" components. ``` createReactClass with NativeMethodsMixin ``` ``` class MyComponent extends ReactNative.NativeComponent ``` ``` requireNativeComponent('RCTView') ``` The implementation for how to handle all three of these exists in the React Native Renderer. Refs attached to components created via these methods provide a set of functions such as ``` .measure .measureInWindow .measureLayout .setNativeProps ``` These methods have been used for our core components in the repo to provide a consistent API. Many of the APIs in React Native require a `reactTag` to a host component. This is acquired by calling `findNodeHandle` with any component. `findNodeHandle` works with the first two approaches. For a lot of our new Fabric APIs, we will require passing a ref to a HostComponent directly instead of relying on `findNodeHandle` to tunnel through the component tree as that behavior isn't safe with React concurrent mode. The goal of this change is to enable us to differentiate between components created with `requireNativeComponent` and the other types. This will be needed to be able to safely type the new APIs. For existing components that should support being a host component but need to use some JS behavior in a wrapper, they should use `forwardRef`. The majority of React Native's core components were migrated to use `forwardRef` last year. Components that can't use forwardRef will need to have a method like `getNativeRef()` to get access to the underlying host component ref. Reviewed By: rickhanlonii Differential Revision: D17563615 fbshipit-source-id: b9e6042805517d502770fcba37301c2c5b6452b6
2019-09-25 21:42:07 +03:00
export type HostComponent<T> = _HostComponentInternal<T>;
Introduce flow type to differentiate between HostComponent, NativeMethodsMixin, and NativeComponent Summary: In React Native there are three types of "Native" components. ``` createReactClass with NativeMethodsMixin ``` ``` class MyComponent extends ReactNative.NativeComponent ``` ``` requireNativeComponent('RCTView') ``` The implementation for how to handle all three of these exists in the React Native Renderer. Refs attached to components created via these methods provide a set of functions such as ``` .measure .measureInWindow .measureLayout .setNativeProps ``` These methods have been used for our core components in the repo to provide a consistent API. Many of the APIs in React Native require a `reactTag` to a host component. This is acquired by calling `findNodeHandle` with any component. `findNodeHandle` works with the first two approaches. For a lot of our new Fabric APIs, we will require passing a ref to a HostComponent directly instead of relying on `findNodeHandle` to tunnel through the component tree as that behavior isn't safe with React concurrent mode. The goal of this change is to enable us to differentiate between components created with `requireNativeComponent` and the other types. This will be needed to be able to safely type the new APIs. For existing components that should support being a host component but need to use some JS behavior in a wrapper, they should use `forwardRef`. The majority of React Native's core components were migrated to use `forwardRef` last year. Components that can't use forwardRef will need to have a method like `getNativeRef()` to get access to the underlying host component ref. Note, we will need follow up changes as well as changes to the React Renderer in the React repo to fully utilize this new type. Changelog: [Internal] Flow type to differentiate between HostComponent and NativeMethodsMixin and NativeComponent Reviewed By: jbrown215 Differential Revision: D17551089 fbshipit-source-id: 7a30b4bb4323156c0b2465ca41fcd05f4315becf
2019-09-25 20:10:48 +03:00
const invariant = require('invariant');
const warnOnce = require('./Libraries/Utilities/warnOnce');
module.exports = {
// Components
get AccessibilityInfo(): AccessibilityInfo {
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
return require('./Libraries/Components/AccessibilityInfo/AccessibilityInfo')
.default;
},
get ActivityIndicator(): ActivityIndicator {
return require('./Libraries/Components/ActivityIndicator/ActivityIndicator');
},
get Button(): Button {
return require('./Libraries/Components/Button');
},
// $FlowFixMe[value-as-type]
get DatePickerIOS(): DatePickerIOS {
warnOnce(
'DatePickerIOS-merged',
'DatePickerIOS has been merged with DatePickerAndroid and will be removed in a future release. ' +
"It can now be installed and imported from '@react-native-community/datetimepicker' instead of 'react-native'. " +
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
'See https://github.com/react-native-datetimepicker/datetimepicker',
);
return require('./Libraries/Components/DatePicker/DatePickerIOS');
},
// [TODO(macOS GH#774)
// $FlowFixMe[value-as-type]
get DatePickerMacOS(): DatePickerMacOS {
warnOnce(
'DatePickerMacOS-deprecated',
'DatePickerMacOS has been deprecated and will be removed in a future release. ' +
"DatePickerMacOS needs to be ported to '@react-native-community/datetimepicker'. " +
'See https://github.com/microsoft/react-native-macos/issues/389',
);
return require('./Libraries/Components/DatePickerMacOS/DatePickerMacOS');
}, // ]TODO(macOS GH#774)
// $FlowFixMe[value-as-type]
get DrawerLayoutAndroid(): DrawerLayoutAndroid {
return require('./Libraries/Components/DrawerAndroid/DrawerLayoutAndroid');
},
get FlatList(): FlatList {
return require('./Libraries/Lists/FlatList');
},
get Image(): Image {
return require('./Libraries/Image/Image');
},
get ImageBackground(): ImageBackground {
return require('./Libraries/Image/ImageBackground');
},
get InputAccessoryView(): InputAccessoryView {
return require('./Libraries/Components/TextInput/InputAccessoryView');
},
get KeyboardAvoidingView(): KeyboardAvoidingView {
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
return require('./Libraries/Components/Keyboard/KeyboardAvoidingView')
.default;
},
get MaskedViewIOS(): MaskedViewIOS {
warnOnce(
'maskedviewios-moved',
'MaskedViewIOS has been extracted from react-native core and will be removed in a future release. ' +
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
"It can now be installed and imported from '@react-native-masked-view/masked-view' instead of 'react-native'. " +
'See https://github.com/react-native-masked-view/masked-view',
);
return require('./Libraries/Components/MaskedView/MaskedViewIOS');
},
get Modal(): Modal {
return require('./Libraries/Modal/Modal');
},
v0.63 sync from upstream (#613) * Upgrade to Metro 0.59 Summary: Upgrades RN to Metro 0.59. Changelog: [Internal] Metro Upgrade Reviewed By: motiz88 Differential Revision: D20533864 fbshipit-source-id: 3c5fb8e37d2363edf0b9a1a8cfbdefba00763415 * Fix mock for TextInput (#28332) Summary: This PR adds the `isFocused` method to the mock of the TextInput component. My understanding some of the latest changes on the TextInput to make it use a forwardRef change the way this method is mock giving an error when trying to use in on a mock. The change suggested here fixes the issue. ## Changelog [JavaScript] [Fixed] - Fix the mock for TextInput to support the `isFocused` method Pull Request resolved: https://github.com/facebook/react-native/pull/28332 Reviewed By: cpojer Differential Revision: D20538044 Pulled By: TheSavior fbshipit-source-id: be734af105ab62ffdf9ed4017bd70845e207f8cd * Properly handle LogBox errors during tests Summary: This diff fixes an issue where errors in LogBox during tests would cause the tests to crash. The crash is due to the NativeExceptionsManager module not being mocked (as all native module need to be in tests). The fix is to properly mock the NativeExceptionManger. This fix exposed an infinite loop issue where failures in LogBox will be logged to the ExceptionManager, which logs to the console, which logs to LogBox, creating a loop. This diff also fixes that look by moving the LogBox internal error check to the top of the monkey patched console methods. Changelog: [Internal] Differential Revision: D20428590 fbshipit-source-id: 7289a480c99ba8dee67772178b7629afb40b330a * Back out "Track animations and flush them" Summary: Original commit changeset: b594d0e6e9b6 D20319824 introduced a problem in LayoutAnimations, which makes surfaced as the problem in T63911344. This diff reverts D20319824. Changelog: [Internal] Reviewed By: lunaleaps Differential Revision: D20541918 fbshipit-source-id: ff72b839f57d39051122920a38b2632cbb5ec362 * Consolidate "dispatchMountItems" reentrancy prevention code, and retry code, in one function Summary: Simplifying the dispatchMountItems reentrance and retry logic. Motivation: cleanup so I can work on dispatching ViewCommands before anything else. Importantly, this gives us the properties that: 1) Only one function is responsible for calling dispatchMountItems 2) Only one function is responsible for deciding if we shouldn't call dispatchMountItems due to reentrance 3) Only one function is responsible for all cleanup 4) Only one function maintains all of the relevant flags (except dispatchPreMountItems... two total now, instead of 4 before) Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20437035 fbshipit-source-id: 5370366790eb25f653bee6c1950e747458374a61 * Only retry ViewCommand mount items if exception is marked as "Retryable" Summary: Instead of just blindly retrying all ViewCommands if they fail - which could be dangerous, since it's arbitrary imperative commands we'd be executing twice, potentially with bad app state - we only retry if the ViewCommand throws a "RetryableMountingLayerException". Changelog: [Internal] Optimization to ViewCommands Reviewed By: mdvacca Differential Revision: D20529985 fbshipit-source-id: 0217b43f4bf92442bcc7ca48c8ae2b9a9e543dc9 * Introduce early dispatch of ViewCommands in FabricUIManager Summary: Earlier this week I introduced a change in the old, non-Fabric renderer (D20378633 D20427803) that (gated behind a feature-flag) executes ViewCommands before all other types of commands, as a perf optimization and (I think) a potential fix for a category of race conditions. I've added more details in comments here. The Fabric renderer uses the same feature-flag that I introduced for the non-Fabric renderer. Changelog: [Internal] Fabric Reviewed By: mdvacca Differential Revision: D20449186 fbshipit-source-id: bb3649f565f32c417a6247369902333989a043aa * Change nightly build from hourly to nightly (daily at 00:00) (#28346) Summary: We initially added the nightly build test to run every hour, in order to more quickly validate it. Now that it has been validated we can run it every night as it is intended to do. cc hramos ## Changelog [General] [Changed] - Change nightly build from hourly to nightly Pull Request resolved: https://github.com/facebook/react-native/pull/28346 Reviewed By: cpojer Differential Revision: D20550143 Pulled By: hramos fbshipit-source-id: 9487c6785684ad6ea7e877290d50a33118090a7f * Add diffing to app bundle size reports (#28284) Summary: Add diffing to app bundle size reports. ## Changelog [Internal] [Changed] - Add diffing to app bundle size reports Pull Request resolved: https://github.com/facebook/react-native/pull/28284 Test Plan: - App bundle size reports should now display a diff where available - Right now, the database contains only one entry for the last known good iOS build - Triggering a new build should not create additional comments Reviewed By: cpojer Differential Revision: D20450158 Pulled By: hramos fbshipit-source-id: 720772275f24d3ff0a49705f4dada2efe2e99bd3 * feat: improve monorepo support by removing redundant PROJECT_ROOT (#28354) Summary: Historically, React Native didn't support a lot of custom project structures apart from the standard flat directory with `ios` and `android` folders. The CLI had to be explicitly started from the project root, otherwise Metro didn't work right. In order to resolve the project root in the most accurate way, React Native assumed that project root is always `../../` from its location in `node_modules` - this is not true when the installation gets hoisted (e.g. in a monorepo). To address that, janicduplessis brought support for custom [`PROJECT_ROOT`](https://github.com/facebook/react-native/commit/9ccde378b6e6379df61f9d968be6346ca6be7ead) that allowed overriding the `../../` in case it wasn't true. Today, CLI is able to automatically resolve the project root, no matter where it's started. It will traverse the tree of the directories upwards and stop as soon as it meets `package.json`. As a result, it doesn't really matter from where we start the CLI anymore as a part of `react-native-xcode.sh`. By replacing the default value of `$REACT_NATIVE_DIR/../../` with `$PWD, that is default for all Xcode scripts, we can make the setup for monorepo easier - nobody will need to set `$PROJECT_ROOT` in order to override the incorrect defaults. By default, all scripts defined in Xcode run from `$PWD` directory, which is the location of the iOS project. In the future, we will be able to remove `cd` entirely. To better understand this PR, let's look a few hypothetical structures as an example: #### Monorepo: > tl;dr works out of the box, no need to mess around with paths ``` - package.json - packages/ - my-app/ - index.js - package.json - ios/ - MyApp.xcodeproj ``` **Before this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $REACT_NATIVE_DIR/../../ node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - Because we change the directory to the root of monorepo, CLI throws an error. All in all, there's no `react-native` dependency at the workspace root. - Some users turn `no hoist` in an act of troubleshooting the errors, which resolves the problem - `react-native` is moved under `my-app/node_modules` which makes this mechanism resolve properly. - Some users find out about `PROJECT_ROOT` and set it to overwrite the default value. For example, setting `export PROJECT_ROOT = "$PWD/../` will set the directory to `my-app`, which has a dependency on `react-native` in a `package.json` and makes the CLI happy. **After this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $PWD node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - The `$PWD` is `packages/my-app/ios/` because that's where the Xcode project is located. CLI will automatically set the root to `../` because that's where it finds `package.json` with `react-native` dependency. It will pass that root to Metro, unless users have set a different one themselves. Thanks to that, all paths to JavaScript files remain working and unaffected. - No need to set `PROJECT_ROOT` anymore. - We don't rely on the location of `node_modules`, which is cleaner and future proof. #### Standard: > tl;dr no changes ``` - ios/ - MyApp.xcodeproj - index.js - package.json ``` **Before this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $REACT_NATIVE_DIR/../../ node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - Everything works fine. Path from `react-native` inside `node_modules` is correct - the project root is set right to `/` **After this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $PWD node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - The root will be set to where Xcode project is located, which is `/ios`. This is the PWD for all Xcode scripts. CLI will look for the `package.json` going upwards from `ios` folder. Will stop at `/`, find out it has `react-native` dependency, load it and its commands and proceed further. ## Changelog [iOS] [Feature] - Better monorepo support when building release apk Pull Request resolved: https://github.com/facebook/react-native/pull/28354 Test Plan: - All projects (standard/monorepo) run without issues. - PROJECT_ROOT is not needed. CC: Titozzz (who wrote monorepo guide), alloy, bartolkaruza Reviewed By: cpojer Differential Revision: D20558005 Pulled By: hramos fbshipit-source-id: 2551120beadcfd4c2f1393ce8a2c2fa6b93c9290 * Fix `test_android`: Remove references to fbsource cell (#28363) Summary: Fixes https://github.com/facebook/react-native/issues/28361. ## Changelog [Internal] [CI] - Fix test_android Pull Request resolved: https://github.com/facebook/react-native/pull/28363 Test Plan: Prior to fix: ``` react-native $ ./scripts/circleci/buck_fetch.sh Guessing 168a69309928ba16065cdb33b1775a4af9f924a6 as the last one used version. Using additional configuration options from /Users/hramos/.buckconfig.d/experiments, /etc/buckconfig.d/fb_chef.ini, /etc/buckconfig.d/fb_chef_override.ini Invalidating internal cached state: Watchman failed to start. This may cause slower builds. Parsing buck files: finished in 1.5 sec Buck wasn't able to parse /Users/hramos/git/react-native/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK: IOError: [Errno 2] No such file or directory: '/Users/hramos/git/react-native/tools/build_defs/platform_defs.bzl' Call stack: File "/Users/hramos/git/react-native/.buckd/resources/168a69309928ba16065cdb33b1775a4af9f924a6/buck_server/buck_parser/profiler.py", line 507, in wrapped return func(*args, **kwargs) File "/Users/hramos/git/react-native/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK", line 1 load("//tools/build_defs:platform_defs.bzl", "ANDROID") File "/Users/hramos/git/react-native/.buckd/resources/168a69309928ba16065cdb33b1775a4af9f924a6/buck_server/buck_parser/profiler.py", line 507, in wrapped return func(*args, **kwargs) This error happened while trying to get dependency '//ReactAndroid/src/main/java/com/facebook/fbreact/specs:FBReactNativeSpec' of target '//ReactAndroid/src/main/java/com/facebook/react/devsupport:devsupport' ``` After fix: ``` react-native $ ./scripts/circleci/buck_fetch.sh + buck fetch ReactAndroid/src/test/java/com/facebook/react/modules Guessing 168a69309928ba16065cdb33b1775a4af9f924a6 as the last one used version. Using additional configuration options from /Users/hramos/.buckconfig.d/experiments, /etc/buckconfig.d/fb_chef.ini, /etc/buckconfig.d/fb_chef_override.ini Invalidating internal cached state: Watchman failed to start. This may cause slower builds. Parsing buck files: finished in 1.1 sec Configuration 'ANDROID_SDK' points to an invalid directory '/opt/android_sdk'. When creating rule //ReactAndroid/src/main/java/com/facebook/hermes/instrumentation:instrumentation. ``` > Note: I don't have the Android SDK configured in this machine. Verified on Circle CI. `test_android` is now green: https://circleci.com/gh/facebook/react-native/140682?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link Reviewed By: cpojer Differential Revision: D20564934 Pulled By: hramos fbshipit-source-id: 5d843b8f113c4db5391ee39addc3ff259d962290 * Fix TextInput left/right padding Summary: This fixes two things: 1) Currently it only respects Start and End padding, and if there's a Theme default, it will override Left/Right padding. Whoops. 2) Currently it doesn't respect when a TextInput starts with padding, but then is removed. This resolves both. It still does not account for RTL support. Changelog: [Internal] Fix AndroidTextInput padding Reviewed By: mdvacca Differential Revision: D20573151 fbshipit-source-id: e89791641b6699e728cde9dbd661a8c21485fbc8 * Validate selection range passed to setTextAndSelection Summary: Changelog: [Internal] # Fabric 1. If `start` and `end` parameters in `setTextAndSelection` are -1, we don't move the cursor. Previously the cursor would be moved to beginning of text input. 2. In view commands, do not validate `eventCount`. It is passed in as undefined from JS because Fabric's text input doesn't use `eventCount`. # Paper 1. If `start` and `end` parameters in `setTextAndSelection` are -1, we don't move the cursor. Previously the cursor would be moved to beginning of text input. Reviewed By: shergin Differential Revision: D20538290 fbshipit-source-id: c7aeddc25f58697254474058ce901df958321f7c * Remove ReactTypes from fbsource and React sync Summary: See https://github.com/facebook/react/pull/18366 This contains a fork of the upstream Flow types. We shouldn't be syncing this since these leads to conflicting types. As a result, these uses have already been codemodded away. Only the imports remained. Changelog: [React Core] - Remove ReactTypes from sync. Reviewed By: gaearon Differential Revision: D20583740 fbshipit-source-id: fc86a934cbdca8ff90fe90282b86ecc945a85e5f * Fix controlled TextInput with child nodes Summary: Changelog: [Internal] # There are three changes in this diff ## _stateRevision is replaced with a BOOL `_stateRevision` was protecting against setting attributed string that is already visible to the user. Previously this was ok because the change was only coming from native, any changes from JS were ignored. Imagine following scenario: 1. User taps key. 2. Update state is called on component initiated by native. 3. New state is created with incremented revision by one. 4. `_stateRevision` gets set to new state's revision + 1. 5. Now JS wants to change something because it just learnt that user tapped the key. 6. New state is created again with incremented revision by one. 7. Update state is called on the component, but the change isn't applied to the text view because `_state->getRevision()` will equal `_stateRevision`. By having a BOOL instead of number, we very explicitly mark the region in which we don't want state changes to be applied to text view. ## Calling [_backedTextInputView setAttributedText] move cursor to the end of text input This is prevented by storing what the current selection is and applying it after `[_backedTextInputView setAttributedText]` is called. This was previously invisible because JS wasn't changing contents of `_backedTextInputView`. ## Storing of previously applied JS attributed string in state This is the mechanism used to detect when value of text input changes come from JavaScript. JavaScript sends text input value changes through props and as children of TextInput. We compare what previously was set from JavaScript to what is currently being send from JavaScript and if they differ, this change is communicated to the component. Previously only first attributed string send from JavaScript was send to the component. # Problem If children are used to set text input's value, then there is a case in which we can't tell what source of truth should be. Let's take following example We have a text field that allows only 4 characters, again this is only a problem if those 4 characters come as children, not as value. This is a controller text input. 1. User types 1234. 2. User types 5th character. 3. JavaScript updates TextInput, saying that the content should stay 1234. 4. In `TextInputShadowNode` `hasJSUpdatedAttributedString` will be set to false, because previous JS value is the same as current JS value. Reviewed By: shergin Differential Revision: D20587681 fbshipit-source-id: 1b8a2efabbfa0fc87cba210570142d162efe61e6 * Daily `arc lint --take BUCKFORMAT` Reviewed By: zertosh Differential Revision: D20593906 fbshipit-source-id: b056947c698508119dc9d4d1bba202295b8f0fda * RN picker - implement background color Summary: add support to the android implementation of the Picker component for setting the background color. Changelog: [Android] [Added] - Support item background color in Dialog Picker Differential Revision: D20566131 fbshipit-source-id: d693b40803fa1051ec955c5728994c820fecd9e9 * Fabric: Modernizing Yoga Dirty flag test. Summary: Now we using TEST_F thing that allows consilidating initialization. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D20578788 fbshipit-source-id: 103bcb8fdeb3dbf297385cfe56415bd646e16791 * Fabric: Changing signature of `ComponentDescriptor::createState` Summary: This is pure syntactic change. Often we don't have a shared pointer to ShadowNodeFamily and only have just a reference. At the same time, `ComponentDescriptor::createState` does not have to accept a shared pointer. So, it's better to accept just a reference. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20578787 fbshipit-source-id: 905277001e096d41e75007575b59ea2ea15fbf4b * Fabric: View Test: Changing state should not dirty Yoga tree (in some most cases) Summary: Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D20578789 fbshipit-source-id: 4336165217bd39fc8065cfaeb96ef7753433d48a * Get ReactiveNative compiled with Clang 10 (#28362) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/28362 Fixed a few compilation errors emitted by Clang 10. Changelog: [iOS] [Fixed] - Get ready for Clang 10 Differential Revision: D20549970 fbshipit-source-id: dc36a85d90d3e43a05f045feb57c6ab6ded67da7 * Guard against null values in object parameters for bridged methods Summary: Handles the case when a value in an object parameter of a turbo module spec is null (even if the type is nullable). For example, given: ``` export interface Spec extends TurboModule { +myFunc: ({| foo: ?string, |}) => void; } ``` and calling `NativeModule.myFunc({foo: null})`, we see an error like: ``` JSON value '<null>' of type NSNull cannot be converted to NSString ``` Guarding against this by converting NSNull's to nils ## Changelog: [iOS] [Fixed] - Fix crash when passing null value in object parameter of bridged method Reviewed By: fkgozali Differential Revision: D20591590 fbshipit-source-id: fdb90f34131427a235f2e3c99147bf1e6a9c6732 * Modify pending deletion tags to be cross manageChildren Summary: Changelog: [Internal] Removing historic layout animations index adjustment (D20323928) broke the Dating Secret Crush screen. Since flushing animations (D20319824) had to be reverted due to issues with Saved + Privacy Shortcuts (https://fburl.com/tasks/eijtmifu) we need to track pending deletions across `manageChildren` operations. Reviewed By: JoshuaGross Differential Revision: D20601079 fbshipit-source-id: c6f116683750e97abe7f988cf361d2a6449e90e6 * Enable label-actions on the react-native repository (#28374) Summary: Enhance our issue management workflow by having the bot respond automatically whenever a label is applied to the issue. ## Changelog [Internal] - CI Pull Request resolved: https://github.com/facebook/react-native/pull/28374 Test Plan: Not tested. If needed, could be applied to a different, test repository. Reviewed By: cpojer Differential Revision: D20606887 Pulled By: hramos fbshipit-source-id: 874d1464527ea76bf51394a7d3e98e4fd8f69345 * Fix Animated Value initialized with undefined in ScrollView (#28349) Summary: When passing an object to contentOffset that doesn't have `y` prop set it causes the following error: ``` Error: AnimatedValue: Attempting to set value to undefined This error is located at: in ScrollView (at src/index.js:638) ... ``` This happens since a runtime check was added to the `AnimatedValue` constructor. (a3aaa471eca58b31597b9a0669f7ade385ccb175) According to flow types the object passed to contentOffset should always contain both x and y props but since it worked before when y is undefined I think its fine to patch the runtime behaviour defensively, especially since the code change is simple. ## Changelog [General] [Fixed] - Fix Animated Value initialized with undefined in ScrollView Pull Request resolved: https://github.com/facebook/react-native/pull/28349 Test Plan: Tested that the crash no longer reproduces when passing an empty object to contentOffset. Reviewed By: cpojer Differential Revision: D20601664 Pulled By: hramos fbshipit-source-id: b098a2dd1e702f995a9a92fa6e4e9a204187dac4 * xplat/js/react-native-github/ReactCommon/fabric/components/textinput/ Summary: Changelog: [Internal] Reviewed By: scottrice Differential Revision: D20619227 fbshipit-source-id: 674337e6ce585a4e96d020f9624b874ba86e2d80 * Seed ssh known hosts with github's public key (#28370) Summary: The [previous attempt](https://github.com/facebook/react-native/pull/28304) to fix the publish step failed, so now reverting to manually configuring things. This PR adds an entry to SSH’s `known_hosts` file using github.com’s public key that I have verified as per [these instructions](https://serverfault.com/a/807363): ``` ~/C/R/react-native [master] » nmap github.com --script ssh-hostkey Nmap scan report for github.com (140.82.118.4) rDNS record for 140.82.118.4: lb-140-82-118-4-ams.github.com PORT STATE SERVICE 22/tcp open ssh | ssh-hostkey: | 1024 ad:1c:08:a4:40:e3:6f:9c:f5:66:26:5d:4b:33:5d:8c (DSA) |_ 2048 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48 (RSA) ``` These fingerprints line up with [the ones posted by GitHub](https://help.github.com/en/github/authenticating-to-github/githubs-ssh-key-fingerprints), so my setup should be good and can be trusted to grab the public key from the right host: ``` ~/C/R/react-native [master] » ssh-keyscan -t rsa -H github.com # github.com:22 SSH-2.0-babeld-d48c3acd |1|If6MU203eXTaaWL678YEfWkVMrw=|kqLeIAyTy8pzpj8x8Ae4Fr8Mtlc= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== ``` ## Changelog [Internal] [Fixed] - Make automated publishing of packages from CI work again Pull Request resolved: https://github.com/facebook/react-native/pull/28370 Test Plan: I used the command being added in this PR in [a failed CI job](https://app.circleci.com/pipelines/github/facebook/react-native/4104/workflows/916127cb-177f-4583-9f90-cae5318041d8/jobs/140810). When I invoked the publish script manually I was not greeted by the blocking prompt and the package was successfully published: https://www.npmjs.com/package/react-native/v/0.0.0-56cf99a96 Reviewed By: cpojer Differential Revision: D20601527 Pulled By: hramos fbshipit-source-id: b1a4405228408cfc4a1b3b44ab88c79522af3a66 * Fix app bundle size diff not always being compared against latest commit (#28368) Summary: - Timestamp of entries in our Firebase instance sometimes get stored as number. This means that we may not always be diffing against the latest master commit. - Size report of Android and iOS gets overwritten depending on which build finishes first. ## Changelog [Internal] [Fixed] - App bundle size diff not always being compared against latest commit [Internal] [Fixed] - Android and iOS app bundle size diff overwrite each other Pull Request resolved: https://github.com/facebook/react-native/pull/28368 Test Plan: - We are now using Firebase's own [firebase.firestore.Timestamp.now](https://firebase.google.com/docs/reference/js/firebase.firestore.Timestamp#now) to ensure that we always get a timestamp in the preferred format. This has been tested locally but can only be verified when merged to master and we start getting new data. In the meantime, I'll manually fix up all the entries in the store. - There should be one app bundle size comment for Android and one for iOS in this PR. Reviewed By: cpojer Differential Revision: D20601620 Pulled By: hramos fbshipit-source-id: 0c3e4b78a74cbd659f1957a6aa74322b016e0646 * Hopefully fix so loading crashes Summary: Changelog: [Android][Internal] Fix potential initializer interruption threading crashes. Reviewed By: mdvacca Differential Revision: D20615755 fbshipit-source-id: 58b706deeb6df1998caff5bf2ae9ec60114313fe * Fix label-actions configuration Summary: Adds back a missing label key, fixes open source issue: https://github.com/facebook/react-native/issues/28378 Changelog: [Internal] [CI] - Fix label-actions config Reviewed By: cpojer Differential Revision: D20625887 fbshipit-source-id: 63c90db249aa9c15369a4b5bcab71cbe75c6d4b8 * Changing Order Of mOverrideColorScheme In Constructor Summary: Changelog: [Android] [Updated] mOverrideColorScheme should be assigned before the first colorSchemeForCurrentConfiguration call, so the initial setting of mColorScheme will reflect the override Reviewed By: zackargyle Differential Revision: D20630173 fbshipit-source-id: a2a2d174d3fc40c14f27dce6a7fa8e67203480c9 * hermes | inspector | Don't include posix headers on non-posix systems Summary: Changelog: [Internal] Hermes inspector includes pthreads, arpa and sys headers on all OSes that would break vanilla Windows builds. This diff adds a check for posix-compliance before inclusion (Note: this ignores all push blocking failures!) Reviewed By: dulinriley Differential Revision: D20564449 fbshipit-source-id: 8e264bc3104065dc4315bb291e8560609fe65184 * Upgrade Prettier from 1.17 to 2.0.2. Summary: This gets us on the latest Prettier 2.x: https://prettier.io/blog/2020/03/21/2.0.0.html Notably, this adds support for TypeScript 3.8, which introduces new syntax, such as `import type`. Reviewed By: zertosh Differential Revision: D20636268 fbshipit-source-id: fca5833d003804333a05ba16325bbbe0e06d6c8a * Back out "Upgrade Prettier from 1.17 to 2.0.2." Differential Revision: D20639755 fbshipit-source-id: 5028563f9cf0527a30b4259daac50cdc03934bfd * Fabric: Additional temporary checks in prop parsing infra Summary: While ViewConfig infra isn't perfect we need to check some value for correctness during prop-parsing. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D20639055 fbshipit-source-id: 193dcd0769bc7777bc8d60c964ede72ebdaa83e4 * Update React package Summary: This just updates the `react` package to the latest stable version. We updated it to experimental internally earlier so this brings the open source version to the latest before the branch cut. This doesn't include any breaking changes. Changelog: [General][Changed] - Update to React 16.13.1 Reviewed By: cpojer Differential Revision: D20642909 fbshipit-source-id: 68a4c74bfe72f1abdb33b0b9071a4f4e8e568318 * Fix sketchy null checks induced by new formatting in Prettier 2.0 Summary: Update code to prepare for Prettier 2.0, which will reformat `a || (b || c)` to `a || b || c`. Changelog: [Internal] prepare for Prettier 2.0 Reviewed By: kassens Differential Revision: D20639483 fbshipit-source-id: c2932b1495884684172ba9291d56c546f51711b8 * RN picker - fix types in AndroidDialogPickerManagerInterface Summary: according to [this crash report](https://our.intern.facebook.com/intern/logview/details/facebook_android_crashes/7ba7056481015482c6166d65cb97e49d/?trace_key=1506fe36a70dd5e50cdc8968f6317f27), `value` was throwing an NPE despite being null-checked. this is because it was an `int` rather than an `Integer`, so the null check wasn't working Changelog: Fix types in AndroidDialogPickerManagerInterface Reviewed By: mdvacca Differential Revision: D20646343 fbshipit-source-id: a27587e0a48f5782bcf5ffddb604018218e65206 * Remove RCTExportModule log spam Summary: The bridge complains if modules aren't exported, which isn't really helpful with lazily loaded modules and turbo modules. I considered only turning this off when TurboModules is enabled, but figured we'd be killing this soon anyways... If anyone feels strongly I can go that approach. Changelog: [iOS][Internal] Remove RCTExportModule log spam Reviewed By: shergin Differential Revision: D20629575 fbshipit-source-id: d32d9fe244c4d06acfee982fca7c7f63da294dc5 * De-jank DevLoadingView Summary: ## Problems Repro steps: 1. Disable Fabric (because CMD + R doesn't work with Fabric right now). 2. Open up Marketplace and hit `CMD + OPT + R` 3. **Observe:** The progress bar doesn't show up right away. It also doesn't actually show progress. https://pxl.cl/140g1 RN Support post: https://fb.workplace.com/groups/rn.support/permalink/3437652016283389/ ## Fixes The first problem is that progress bar doesn't actually show progress. **Fix:** Bundle load progress is updated in `RCTCxxBridge`, where we first require `RCTDevLoadingView`, and then call its `updateProgress` method. Previously, we wouldn't lazily load `RCTDevLoadingView`, it already didn't exist. Lazily loading `RCTDevLoadingView` causes the progress view to show up. Here: https://pxl.cl/140gt If you look at the above video, you'll notice there are two stages to the progress bar: stage 1 displays the actual progress. Stage 2 prompts that we're downloading the JS bundle. As you can see, stage 1 and stage 2 have different background colors, even though both of them are green. **Fix:** I adjusted the JS to match the Native color. Here: https://pxl.cl/140gT We're almost there, but the progress bar is dismissed twice? **Fix:** I dug into the code, and the reason why was because when we hit `CMD + R`, we invalidate the bridge, and immediately re-initialize it. This means that we asynchronously invalidate the old TurboModuleManager, and immediately create a brand new one. Therefore, two `RCTDevLoadingView` modules can (and do) exist at once. So, I moved `RCTDevLoadingView` to be an instance member of `FBReactModule`, to ensure that it doesn't get cleaned up and re-created when TurboModuleManager is deleted and re-created. This finally fixed the progress bar jank: https://pxl.cl/140hn Changelog: [iOS][Fixed] - Remove RCTDevLoadingView jank Reviewed By: rickhanlonii Differential Revision: D20607815 fbshipit-source-id: 05825c67adaf3cfda70be0fa2dc92d413dc8921b * Fix retaining self in block in LogBox impl Summary: Logbox has a retain cycle (see linked task for my deeper investigation). This diff doesn't fix the retain cycle, but it's just good practice to not retain self strongly in blocks. Changelog: [iOS][Internal] Fix retaining self in block in LogBox implementation Reviewed By: shergin Differential Revision: D20630693 fbshipit-source-id: cf399495e9bcd1917932fcc0e9c9d2d2a32bf6f0 * Flow type infoLog Summary: Changelog: [General][Internal] flow type infoLog Reviewed By: zackargyle Differential Revision: D20577939 fbshipit-source-id: eed4401b2ae0a6bf845fdcb54c6abe1fe98fe7c1 * Replace fbsource// with // in xplat/js/ files [1] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: scottrice Differential Revision: D20495655 fbshipit-source-id: a57b72f694c533e2e16dffe74eccb8fdec1f55f5 * Deploy Flow 0.121 to Xplat (#901) Summary: Deploy Flow 0.121 to Xplat bypass-lint allow-large-files Closes https://github.com/facebook/flipper/pull/901 Changelog: [Internal] Reviewed By: panagosg7 Differential Revision: D20570316 fbshipit-source-id: a76983d6f46c8b995ce2dd5cd1e014534790698a * Replace fbsource// with // in xplat/js/ files [3] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D20656211 fbshipit-source-id: deb91b917d349bc500acbb03d734ff621f6e1fc7 * Replace fbsource// with // in xplat/js/ files [4] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: JoshuaGross, shergin Differential Revision: D20656696 fbshipit-source-id: 10f02decb1dc969fd3491ac90d97f09e2bda59e7 * Add Needs: Repro bot action (#28397) Summary: Add automated response for Needs: Repro ## Changelog [Internal] [Added] - Add automated response for Needs: Repro Pull Request resolved: https://github.com/facebook/react-native/pull/28397 Test Plan: Bot should add a comment with the Needs: Repro label. Reviewed By: cpojer Differential Revision: D20665378 Pulled By: hramos fbshipit-source-id: 1c7d878faacf935a640849f74c81f119e5c7e92d * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D20666684 fbshipit-source-id: 32255ac7509e0257693969a7b4b044569af30df7 * ✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392) Summary: Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`. Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job. What was done in this PR: * The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use. * The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument. * The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument * The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument ## Changelog [Internal] [CI] - ✅ Green CI, disabled test infrastructure work Pull Request resolved: https://github.com/facebook/react-native/pull/28392 Test Plan: Verified on Circle CI Reviewed By: cpojer Differential Revision: D20665512 Pulled By: hramos fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726 * Upgrade internal packages to support ESLint >= 6 (#28393) Summary: Fixes https://github.com/facebook/react-native/issues/28293 I've tested it with https://github.com/react-native-community/react-native-template-typescript and it seems to be working as expected - no warnings, supports typescript 3.8. (note: I didn't upgrade the package version as I don't know how the releases work for this package) ## Changelog [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/28393 Reviewed By: hramos Differential Revision: D20647112 Pulled By: cpojer fbshipit-source-id: ca6b67971f625dc8125a58f9220dfcd86250ba94 * Fabric: Fixing a deadlock in RCTSurfacePresenter Summary: This is another attempt to fix an issue very similar to T59424871. The previous attempt was in D19249490. I don't know why we don't see production crashes (stalls) but it happened to me (and not to me) in the debugger. The previous attempt didn't work because we still could have a deadlock because we tried to acquired shared mutex already owned exclusively by the `suspend` method. Here is another approach: Instead of using one shared mutex, now we use two. One is similar to what we had and another that protects `suspend` and `resume`. Besides that, now we pass a Scheduler to functions that use that explicitly. This way we can be more explicit about acquiring mutexes and the overall flow of execution. The idea is: Now an arbitrary code that can be reentrant does not cover with mutexes, so the deadlock is not possible. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20639228 fbshipit-source-id: 98515742f00f2ae94b50b585c9f1f0611e169ebe * Update React Hooks Plugin Summary: Updates `eslint-plugin-react-hooks` to 3.0.0. This introduces a new lint error when you use a Hook inside a class. Changelog: [General][Changed] - Updated the React Hooks ESLint Plugin Reviewed By: cpojer Differential Revision: D20675528 fbshipit-source-id: d0cbe9748fd15df7a4c6de00bd1462610e0a43d6 * Upgrade React DevTools 4.0.6 -> 4.6.0 Summary: Upgrading the embedded version of React DevTools, primarily to pull in [this PR](https://github.com/facebook/react/pull/18397) which will reduce the impact of this package on `node_modules` size. # Update process Following a similar process as D15973709, I began by searching for [all of the references](https://our.intern.facebook.com/intern/biggrep/?corpus=xplat&filename=.json&case=false&view=default&extre=&s=%22react-devtools&engine=apr_strmatch&context=false&filter[uninteresting]=false&filter[intern]=false&filter[test]=false&grep_regex=) to the `react-devtools-core` package and updated all v4 usage to to point to the new 4.6.0 release: 1: Manually update "react-devtools-core" versions: ``` js/package.json js/react-native-github/package.json nuclide/package.json sonar/desktop/app/package.json sonar/desktop/plugins/reactdevtools/package.json vscode/modules/vscode-webview/package.json ``` 2: Setup Yarn proxy: ``` yarn config set proxy http://fwdproxy:8080/ yarn config set https-proxy http://fwdproxy:8080 ``` 3: Run "yarn" in each of the above directories. 4: Run the lockfile shell script: ``` ~/xplat/js/scripts/update-oss-yarn-lockfile.sh ``` 5: Update the generated `MOBILE_JS_NODE_MODULE_DEPS.bzl` by running ``` js1 build buckfiles ``` ## Changelog: [General] [Changed] - Upgrade embedded React DevTools backend from v4.0.6 to v4.6.0. Reviewed By: cpojer, gaearon Differential Revision: D20676091 fbshipit-source-id: 99865bdba9bce45e2a7d582d5fb550cfdbeeca3a * Make ScrollView use ForwardRef Summary: Have ScrollView use forwardRef so that the host component methods like `measure` and `measureLayout` are available without having to call `getNativeScrollRef`. Instead, you can use `<ScrollView ref={myRef} />` and directly call all methods of ScrollView and host components on `myRef`. Previous usage: ``` const myRef = React.createRef<React.ElementRef<typeof ScrollView>>(); <ScrollView ref={myRef} /> const innerViewRef = myRef.current.getNativeScrollRef(); innerViewRef.measure(); ``` New usage: ``` const myRef = React.createRef<React.ElementRef<typeof View>>(); <ScrollView ref={myRef} /> // now, myRef.current can be used directly as the ref myRef.current.measure(); myRef.current.measureLayout(); // Additionally, myRef still has access to ScrollView methods myRef.current.scrollTo(...); ``` Changes: * Added deprecation warnings to ScrollView methods `getNativeScrollRef`, `getScrollableNode`, and `getScrollResponder` * Added the forwardRef call to create `ForwardedScrollView` - this takes in `ref` and passes it into the class ScrollView as `scrollViewRef`. * Forwarded the ref to the native scroll view using `setAndForwardRef`. * Added statics onto `ForwardedScrollView` so that `ScrollView.Context` can still be accessed. * Added type `ScrollViewImperativeMethods`, which lists the public methods of ScrollView. * Converted all public methods of ScrollView to arrow functions. This is because they need to be bound to the forwarded ref. * Bound all public methods of ScrollView to the forwarded ref in the `setAndForwardRef` call. * Flow typed the final output (ForwardedScrollView) as an abstract component that takes in the props of the `ScrollView` class, and has all methods of both the inner host component (`measure`, `measureLayout`, etc) and the public methods (`scrollTo`, etc). Changes to mockScrollView: * Changed mockScrollView to be able to mock the function component instead of a class component * Updated necessary tests Changelog: [General] [Changed] - Make ScrollView use forwardRef Reviewed By: TheSavior Differential Revision: D19304480 fbshipit-source-id: 6c359897526d9d5ac6bc6ab6d5f9d82bfc0d8af4 * Fix issue with onEndReached Summary: onEndReached can be triggered twice when more items are added to the end of the list. This change makes it so that a second call to onEndReached won't happen until the user scrolls down to the new end of the list. Changelog: [General] [Fixed] - Fix double call to onEndReached in VirtualizedList Reviewed By: sahrens Differential Revision: D20066740 fbshipit-source-id: 129d7ae6bfd241eeea18fe0bb12b82be67735874 * Remove console warnings from ScrollView methods Summary: The newly added console warnings in D19304480 are adding a lot of warning noise due to missed infra callsites. Those callsites need to be updated before these warnings can be added. Changelog: [Removed] Remove console warnings from ScrollView methods Reviewed By: rickhanlonii Differential Revision: D20700917 fbshipit-source-id: cb618ee3a291d26e1942e4f91bbc02dee41fb78b * Upgrade react-docgen, jscodeshift and flow-parser Summary: In preparation for upgrading babel, I'm updating some of our source transform tools to the latest versions. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D20675201 fbshipit-source-id: fa4fee2652529c6677087e42cdd1325a8080e46f * Ship State Reconciliation 100% on all platforms Summary: State Reconciliation has been running 50/50 for a while and all metrics look stable. This is necessary for providing a good experience so we should ship to everyone unconditionally. Changelog: [Internal] Fabric diffing reconciliation process improvement Reviewed By: mdvacca Differential Revision: D20715694 fbshipit-source-id: 25b2635ecc29b67e2911679c9db66bc84d37dec1 * Core telemetry tests: update so they pass on my machine Summary: `std::this_thread::sleep_for` is not really precise and will attempt to sleep for "at least" that much time, but may sleep much longer depending on what CPUs are doing and scheduling policies. To get this to pass on my machine, I had to substantially increase the thresholds. Changelog: [Internal] Reviewed By: shergin Differential Revision: D20689571 fbshipit-source-id: f159420d24a95da2b5d95d49ed7882e783291e98 * Optimize diff algorithm to produce fewer remove+insert ("move") paired instructions Summary: An evolution of D20633188 but more performant. There are three optimized paths before the slow path. The first optimized path tries to pair identical nodes from old/new tree, and generate Update mutations, until we hit nodes that are different (indicating either a remove or an insert). This already existed. The next two optimizations, introduced by Tim in his JS pseudocode, were inspired by ReactJS's diffing algorithm. They work in cases where the rest of the nodes are (1) all removals/deletes or (2) all creates+inserts. Finally, if those final two optimized paths can't run, it's because there is a mix of delete+remove, create+insert, and "move" operations, mixed at the beginning, middle, and/or end of the list. This has slightly better average/best-case complexity as the previous implementation. In particularly pathological cases where all nodes are arbitrarily reordered, or reversed, for instance (ABCDE->EDCBA) the algorithm has the same complexity as the previous algorithm (quadratic). For now iOS is pinned to the older differ Changelog: [Internal] Experiment to optimize diffing algorithm in Fabric Reviewed By: shergin Differential Revision: D20684094 fbshipit-source-id: d29fba95a0328156c023e1c87804f23770ee1d91 * Unit test for V2 "minimal instruction" diffing algorithm Summary: This unit test is to verify that the new diffing algorithm generates a "minimal" instruction set, with regards to removes and inserts ("moves"). These unit tests are here to verify the expected behavior in this new algorithm, but these tests may be modified or deleted in the future if we decide we want to change this behavior. Changelog: [Internal] fabric unit test Reviewed By: mdvacca Differential Revision: D20706592 fbshipit-source-id: 5f9991498e0d788ecbf88d938bfe6d3f0f27af40 * Add ES Lint rules for `DynamicColorIOS()`and `ColorAndroid()` (#28398) Summary: The [PlatformColor PR](https://github.com/facebook/react-native/pull/27908) added support for iOS and Android to express platform specific color values. The primary method for an app to specify such colors is via the `PlatformColor()` method that takes string arguments. The `PlatformColor` method returns an opaque Flow type enforcing that apps use the PlatformColor method instead of creating Objects from scratch -- doing so would make it harder to write static analysis tools around Color values in the future. But in addition to `PlatformColor()`, iOS has a `DynamicColorIOS()` method that takes an Object. The Flow type for this Object cannot be opaque, but we still want to enforce that app code doesn't pass variables instead of Object literals or that values in the Objects are variables. To ensure `DynamicColorIOS()` can be statically analyzed this change adds an ESLint rule to enforce that `DynamicColorIOS()` takes an Object literal of a specific shape. A `ColorAndroid()` was also introduced not for practical use but just to test having platform specific methods for more than one platform in the same app. A second ESLint rule is created for `ColorAndroid` as well. ## Changelog [General] [Changed] - Add ES Lint rules for `DynamicColorIOS()`and `ColorAndroid()` Pull Request resolved: https://github.com/facebook/react-native/pull/28398 Test Plan: `yarn lint` passes. Reviewed By: cpojer Differential Revision: D20685383 Pulled By: TheSavior fbshipit-source-id: 9bb37ccc059e74282b119577df0ced63cb9b1f53 * fix: Android gradle config when bundling for release (#28415) Summary: This fix aims to address the issue when bundling an Android app for release and getting the error exhibited in https://github.com/facebook/react-native/issues/28002 which I also encountered myself. The config was changed sometime in November 2019 (as part of https://github.com/facebook/react-native/issues/26940, commit https://github.com/facebook/react-native/commit/a3b08048674e324dbe1f0ca816f35607e9e06a2f) to be very opinionated when it comes to the use of `npx` which Gradle itself cannot find anyway (I have `npx` installed globally and it didn't pick it up). Another issue that the use of `npx` creates is that Gradle should only ever use the currently installed react-native cli rather than a (possibly) higher version which may not always have backward compatibility. The proposed change simply throws a more descriptive error rather than defaulting to a tool which may or may not exist on the machine, be it CI or a development environment. I've also modified the RNTester app to reflect the correct config implementation relative to the RNTester app itself. In real projects, the config inside `android/app/build.gradle` should look similar to the following snippet: ``` project.ext.react = [ cliPath: "$rootDir/../node_modules/react-native/cli.js", entryFile: "index.js" ]; ``` ## Changelog [Android] [Fixed] - Gradle release config Pull Request resolved: https://github.com/facebook/react-native/pull/28415 Test Plan: - [x] Successfully bundled an Android release build with correct config - [x] Works with RNTester app Reviewed By: mdvacca Differential Revision: D20714372 Pulled By: hramos fbshipit-source-id: 4d66139249c6f840582a71a48c64e6a6595f7af0 * Reimplement D19965405: Small improvements in Differentiator/TinyMap Summary: Two things: 1) I reimplement Valentin's idea in D19965405, so that TinyMaps can be iterated over, with a couple of bugfixes (calling front() or back() on an empty vector will crash). 2) I now use TinyMap instead of better::map in the "optimized" diffing algorithm. 3) `erase` now actually removes elements from the vector, but only when more than half of elements have been erased. 4) If you repeatedly erase elements at the beginning of the vector, they will no longer be iterated over. This is a specific optimization for our heaviest TinyMap use-cases. These amount to some small but hopefully somewhat meaningful perf improvements. Changelog: [Internal] Fabric perf Reviewed By: shergin Differential Revision: D20718719 fbshipit-source-id: 91f4b2e2e0f6387ae484e43d5b0095103087baa6 * Remove LayoutInspectingPolicy.includeScrollViewContentOffset Summary: `LayoutInspectingPolicy` has two flags, `includeTransform` and `includeScrollViewContentOffset`. `includeScrollViewContentOffset` seems to be redundant for two reasons. # 1st From looking at callers, they have always the same value. I looked at all call sites, and they are either always both set to true or both set to false. # 2nd The way we include scroll view content offset, is through transformation, so setting `includeTransform` to true and `includeScrollViewContentOffset` to false will include content offset anyway. In order to make both flags work, we would need to introduce further changes to `getRelativeLayoutMetrics`. But since the flag isn't used anyway, I think it is better to get rid of it for now. If we need it in the future, we could re-introduce it. Reviewed By: shergin Differential Revision: D20622256 fbshipit-source-id: fb6156c66b752319ea928239fa723ff90688b0a0 * Add support for translation and rotation to operator * between Rect and Transform Summary: Changelog: [Internal] Until now `Rect operator*(Rect const &rect, Transform const &transform)` supported only scaling. Now it supports translation and rotation as well. Reviewed By: shergin Differential Revision: D20622876 fbshipit-source-id: 1b65393bd3fd6fd9a8941903e0f2681a10097e4a * Include transform property when calling getRelativeLayoutMetrics Summary: Changelog: [Internal] Current implementation of `measure` doesn't take transform into account.. So if you had a view which has width and height 100 and had `Scale(0.5, 0.5, 1)` (this will shrink view by half). Calling `getRelativeLayoutMetrics` would report its size being `{100, 100}`. This applies if view's parent has transformation as well, because transformation is applied to all subviews of the view as well. Reviewed By: mdvacca Differential Revision: D20621590 fbshipit-source-id: 2cf902a0494291c821ecada56f810c5e6620db5a * feat: migrate appveyor to circleci (#28245) Summary: This issue closes https://github.com/facebook/react-native/issues/28241 Migrated Windows test from AppVeyor to CircleCI ## Changelog [Internal] [Changed] - Migrated Windows test from AppVeyor to CircleCI Pull Request resolved: https://github.com/facebook/react-native/pull/28245 Test Plan: For CircleCI to Pass Reviewed By: cpojer Differential Revision: D20689163 Pulled By: hramos fbshipit-source-id: 285c762457ef00f7884ee9157b3f336044c0452f * Remove "Debug with Nuclide" option Summary: This is no longer needed. Reviewed By: cpojer Differential Revision: D20722274 fbshipit-source-id: 5bc3104e90811d724f42aadbf137ab8eff718ca0 * experiment to preload RN bridge after fb4a bookmarks render Summary: Changelog: [Android][Internal] add internal supermodule label Reviewed By: mdvacca Differential Revision: D20434200 fbshipit-source-id: fae50309cdd0df4a4523c2f88d1c8e01a7163575 * Fix CursorDrawable Color Tint for Android 10+ Summary: Accessing this field via reflection is explicitly blacklisted by Google in Android 10 and higher. They have provided a new API to change the color, which I have implemented here. [The old setColorFilter is deprecated](https://developer.android.com/reference/android/graphics/drawable/Drawable#setColorFilter(int,%20android.graphics.PorterDuff.Mode)) so I also updated that method call as well. Changelog: [General] [Fixed] Use new setTextCursorDrawable API for Android 10 Reviewed By: JoshuaGross Differential Revision: D20656068 fbshipit-source-id: 58a92b57c0a892c7c87fc5d735e4ceaa4e987ec7 * Early return on tinting CursorDrawable if no color supplied Summary: There's (potentially) a lot of expensive reflection calls here that, as best I can tell, end up being ignored if the supplied color is null. Better to early return. Changelog: [General] [Internal] Preclude reflection when setting cursor color if color is null Reviewed By: JoshuaGross Differential Revision: D20670594 fbshipit-source-id: 480a988355bbd79008002c4326d4b35035ec2a95 * Partial React Sync for Inspector Summary: Partial sync for React that includes: - https://github.com/facebook/react/pull/18388 - https://github.com/facebook/react/commit/dd7e5e4f5ac2ffac3171ef61daee2cb1edc69635 Created from this branch: https://github.com/facebook/react/compare/master...rickhanlonii:rh-partial-3-24?expand=1 Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20651395 fbshipit-source-id: 67baf7c407f75d9fd01c17f2203a77a38567100e * Enable inspector for Fabric Summary: ## Overview This diff refactors the Inspector, moving logic to look up view data for a touched view inside the renderer as `getInspectorDataForViewAtPoint`. We then implement that same function for Fabric in order to support the inspector in that renderer. Requires https://github.com/facebook/react/pull/18388 ## Motivation Reason one for this refactor is that, previously, the inspector held all of the logic to look up view data for a given x,y touch coordinate. To do this, it would take the React tag and coordinates, look up the native view tag, measure it, and then ask React internals for the Fiber information of that tag. All of this is deeply coupled to React internals, yet the logic is outside of React core in the Inspector. Reason two is that, for Fabric, the logic for getting the view data is different than Paper. In Fabric, we pass the x,y coordinates to native directly, which returns an instance handle. That handle can be used to measure the ShadowNode, or retrieve the Fiber information. By moving the logic into the renderer in React core, we decouple the implementation details of looking up view data for a tapped point and allow ourselves the ability to add and change renderer-specific code for the actual lookup without impacting outsiders like the Inspector. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D20291710 fbshipit-source-id: a125223f2e44a6483120c41dc6146ad75a0e3e68 * chore: update url of warning message from deprecated imports (#28452) Summary: Some of the repository name of Lean Core(https://github.com/facebook/react-native/issues/23313) libraries has been renamed. This PR updates the warning message to display the updated url. ## Changelog [General] [Changed] - Update warning message of deprecated imports Pull Request resolved: https://github.com/facebook/react-native/pull/28452 Test Plan: updated URL can be accessed. Reviewed By: cpojer Differential Revision: D20745184 Pulled By: TheSavior fbshipit-source-id: 2c3ed6a000b45022ca6c4862305aa567c4d18b2e * Add `upgrade-support` link on issue creation (#28411) Summary: This PR adds a https://github.com/react-native-community/upgrade-support link for the user when creating an issue. Changelog: [Internal] Pull Request resolved: https://github.com/facebook/react-native/pull/28411 Reviewed By: cpojer Differential Revision: D20714274 Pulled By: hramos fbshipit-source-id: 4ca42224a50e386b95f21f0fb236a917e1b6b982 * Update PixelRatio 'getFontScale' method description (#28407) Summary: Refs facebook/react-native-website#1776. Despite in-code description `PixelRatio.getFontScale()` is working properly on the iOS (it also reflects the user settings). This PR updates the in-code description to match current behaviour. I have decided to skip in the code information about additional setting in `Accessibility` menu and in `Control Centre`, but if you think it is important just let me know, I can update this PR. ## Changelog [Internal] [Fixed] - Fix PixelRatio getFontScale method description Pull Request resolved: https://github.com/facebook/react-native/pull/28407 Test Plan: N/A Differential Revision: D20750260 Pulled By: shergin fbshipit-source-id: c40ec2fd49cd60e2975351c3a1c453aab0045da4 * Remove allowDisablingImmediateExecutionOfScheduleMountItems feature flag Summary: No longer needed. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20747684 fbshipit-source-id: a8077519b7670d72e23267b1c1423556ec97be3f * RuntimeExecutor helpers that modify the way of the callback is being executed. Summary: Here we implement a bunch of helper methods that allow customizing the behavior of a RuntimeExecutor "on-demand" on the caller side. We will use it in the next diff(s). Changelog: [Internal] Fabric-specific internal change. Reviewed By: PeteTheHeat Differential Revision: D20551411 fbshipit-source-id: 51d3cd02b69753110c0e1155347c6e52eb882c7d * Fabric: Using `executeSynchronouslyOnSameThread_CAN_DEADLOCK` in MainRunLoopEventBeat Summary: We are replacing inline-ed implementation with practically the same one implemented as the helper method. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20551409 fbshipit-source-id: fcc6f497cd240af65fba534051c217fe5746ce82 * Set RootNodeKind trait in ModalHostViewShadowNode Summary: Changelog: [internal] `ModalHostViewShadowNode` didn't have `RootNodeKit` trait, therefore `getRelativeLayoutMetrics` was including nodes in ancestors that it shouldn't have. Reviewed By: shergin Differential Revision: D20735801 fbshipit-source-id: 6b81e3b174c2f82e530abc2bca2da8bebc2270b0 * mention RNTester app in contributor guide (#28042) Summary: motivation is following - the RNTester app is imho the best place to try out any changes that a contributor would make, yet it is not directly mentioned in the contributor guide. This fixes it. ## Changelog [Internal] - Docs Pull Request resolved: https://github.com/facebook/react-native/pull/28042 Test Plan: not necessary Reviewed By: TheSavior Differential Revision: D20401260 Pulled By: hramos fbshipit-source-id: 01c1b7dff56b59909c94b2feb609650f0baba1a9 * Buck: Use Android SDK 29 during build (#28455) Summary: Fixes `test_android` and `test_docker` build failures. Thanks to dulmandakh for identifying the fix. Changelog: [Internal] [Android] [Changed] - Use Android SDK 29 to build during CI tests Pull Request resolved: https://github.com/facebook/react-native/pull/28455 Test Plan: Circle CI shows `test_android` and `test_docker` passing: https://app.circleci.com/jobs/github/facebook/react-native/142273 Reviewed By: sturmen Differential Revision: D20766589 Pulled By: hramos fbshipit-source-id: 8ef8a8ce3a6e7353ae47425accb3bd26cf1608c4 * Assign orderIndex_ in ConcreteViewShadowNode constructor instead of ViewShadowNode's constructor Summary: Changelog: [Internal] `orderIndex_` was only being assigned for `ViewShadowNode`, not for other `ShadowNodes` that are later represented on the screen. Reviewed By: shergin Differential Revision: D20746477 fbshipit-source-id: c04c2cfea14b9141d22bc3d9e9bb4c0c59925754 * Implement nativePerformanceNow to improve Profiler API results (#27885) Summary: When experimenting with React Profiler API (https://reactjs.org/docs/profiler.html), I noticed that durations are integers without a debugger, but they are doubles with higher precision when debugger is attached. After digging into React Profiler code, I found out that it's using `performance.now()` to accumulate execution times of individual units of work. Since this method does not exist in React Native, it falls back to Javascript `Date`, leading to imprecise results. This PR introduces `global.nativePerformanceNow` function which returns precise native time, and a very basic `performance` polyfill with `now` function. This will greatly improve React Profiler API results, which is essential for profiling and benchmark tools. Solves https://github.com/facebook/react-native/issues/27274 ## Changelog [General] [Added] - Implement `nativePerformanceNow` and `performance.now()` Pull Request resolved: https://github.com/facebook/react-native/pull/27885 Test Plan: ``` const initialTime = global.performance.now(); setTimeout(() => { const newTime = global.performance.now(); console.warn('duration', newTime - initialTime); }, 1000); ``` ### Android + Hermes ![Screenshot_1580198068](https://user-images.githubusercontent.com/13116854/73245757-af0d6c80-41b5-11ea-8130-dde14ebd41a3.png) ### Android + JSC ![Screenshot_1580199089](https://user-images.githubusercontent.com/13116854/73246157-92256900-41b6-11ea-87a6-ac222383200c.png) ### iOS ![Simulator Screen Shot - iPhone 8 - 2020-01-28 at 10 06 49](https://user-images.githubusercontent.com/13116854/73245871-f136ae00-41b5-11ea-9e31-b1eff5717e62.png) Reviewed By: ejanzer Differential Revision: D19888289 Pulled By: rickhanlonii fbshipit-source-id: ab8152382da9aee9b4b3c76f096e45d40f55da6c * Save/restore IP when leaving the interpreter Summary: This diff implements the instruction pointer save/restore trick Tzvetan came up with; allowing us to observe and modify the IP from outside the interpreter loop with negligible overhead. From Tzvetan's internal post on the subject: > [Today] the interpreter IP is just a local variable in the interpreter function, so there is no way to get to its value from outside the function. It lives in a register and we don't want to make it a Runtime field since the overhead [of accessing it via memory in the interpeter loop] would kill us. > However, if you really think about it, it only lives in a register while the interpreter function is running. For the rest of the time, it is spilled by the C++ compiler onto the stack. So, precisely when we need it, it is actually stored in memory. The only problem is, we don't know where! Admittedly, that is an annoying problem, but it feels like it should be solvable. > What if, instead of relying on the compiler to spill the IP register, we manually spill it ourselves, to a known location? It works. Example: https://godbolt.org/z/ftSDnp This diff implements this approach across the whole interpreter loop: whenever we call out of the loop we capture/publish the IP and restore it again immediately after the external call returns. This means we can now see the IP outside the interpret loop and even change it. This is effectively "for free" as the compiler now skips spilling/restoring the IP behind the scenes. The immediate benefit of this is knowing the current IP allows us to have more accurate stack-traces during execution. In future this may enabled tricks like changing the IP before returning to the interpreter loop, allowing things outside the interpreter to affect program flow without adding logic to the interpreter loop. Reviewed By: tmikov Differential Revision: D20151091 fbshipit-source-id: 3814382639800208d8985a32ede31ba8f7ff7c80 * Plumb through memory allocation profiler feature to Chrome Inspector Summary: Changelog: Make allocation profiler feature of Chome Inspector work Reviewed By: dulinriley Differential Revision: D20383003 fbshipit-source-id: 8a10c310d5a639a6644763adb53f2f0017057587 * chore: update lint config in template (#28443) Summary: Updating the eslint config and metro-preset used in project template. ## Changelog [General] [Changed] - Upgrade eslint-config and metro-preset in project template Pull Request resolved: https://github.com/facebook/react-native/pull/28443 Test Plan: - Start new project with `npx react-native init TestLint` - upgrade lint and metro-config - run lint and start up emulator on iOS and android Reviewed By: cpojer Differential Revision: D20771048 Pulled By: hramos fbshipit-source-id: a6d387b8687cee348681bcb10d22c7e3de291ed7 * Apply buckformat in preparation for updating buildifier Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D20773287 fbshipit-source-id: 144bb13191312eef246646b99e1dc06304c6d210 * Circle CI Housekeeping: Windows, e2e (#28471) Summary: Circle CI Housekeeping: * Integrate Windows job into `tests` workflow * Add parametrized e2e tests command * Move js e2e tests out of the disabled test quarantine area * Parametrize and split `test_ios` job to reduce total execution time by ~13 minutes **Before:** Longest running iOS job at 39 minutes. | Setup Job Runtime | Job | Job Runtime | Total Runtime | | - | - | - | - | | 01:24 | test_ios | 38:04 | **39:28** | | 01:24 | test_ios_frameworks | 38:02 | 39:26 | ![Screen Shot 2020-03-31 at 12 40 29 PM](https://user-images.githubusercontent.com/165856/78068308-044c3280-734d-11ea-96bf-2e50691a0ef7.png) **After:** Longest running iOS job down to 26 minutes. | Setup Job Runtime | Job | Job Runtime | Total Runtime | | - | - | - | - | | 01:26 | test_ios_unit | 20:48 | 22:14 | | 01:26 | test_ios_unit_frameworks | 22:52 | 24:18 | | 01:26 | test_ios_detox | 24:35 | 39:28 | | 01:26 | test_ios_detox_frameworks | 24:54 | **26:20** | ![Screen Shot 2020-03-31 at 12 39 22 PM](https://user-images.githubusercontent.com/165856/78068294-fe565180-734c-11ea-96da-8836231d7747.png) ## Changelog [Internal] [CI] - CI Housekeeping Pull Request resolved: https://github.com/facebook/react-native/pull/28471 Test Plan: Circle CI Reviewed By: cpojer Differential Revision: D20774521 Pulled By: hramos fbshipit-source-id: 4a2f5a4083cd76dcb51d5ccaf726cd204fca222e * Fix bug in optimized differ Summary: The differ was still producing correct, but not minimal, instruction sets in some cases due to an optimization that was buggy. This affected cases where 2+ nodes were inserted at the beginning of a list. It would trigger the old behavior where all nodes after the first would be removed, deleted, then reinserted. See the test case (which was failing and now passed) and P128190998 (the 3->4 transition) for samples. Changelog: [Internal] Fabric differ Reviewed By: mdvacca Differential Revision: D20785729 fbshipit-source-id: 2fea6a816753066abb358ed7bb51003140cd5fc4 * Use `buildCodeFrameError` in babel-plugin-inline-view-configs Summary: The next version of Babel changes how it prints file names in errors. This diff fixes the test by using `/` as the `cwd` and switches the plagin to use `path.buildCodeFrameError` so errors will be more helpful for users. I renamed the `nodePath` variable to `path` because that's what babel plugins usually do. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D20781805 fbshipit-source-id: cc149dce6389aa9402ce70ea30035c74a6150ea3 * Swap left and right yoga position with start and end in RTL context Summary: Changelog: [Internal] Paper swaps right and left in RTL setting, this logic is in [RCTShadowView.m](https://our.intern.facebook.com/intern/diffusion/FBS/browse/master/xplat/js/react-native-github/React/Views/RCTShadowView.m?commit=cdd504cfbee66ae0659495604c4ff7b5764a1d9e&lines=529-549). For Fabric instead of doing it during yoga props assignment, I swap the left/right with start/end just before we pass yoga nodes to layout calculation. Reviewed By: shergin Differential Revision: D20420040 fbshipit-source-id: b777f2658f56c173743b2034b8b5059e3e0c9840 * Fix inline-view-configs test on Windows. Summary: *facepalm* The file path is platform specific. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D20793023 fbshipit-source-id: 4fbcbf982911ee449a4fa5067cc0c5d81088ce04 * Pass isRTL flag from FabricUIManager Fabric core Summary: Changelog: [Internal] Send `isRTL` flag and `doLeftAndRightSwapInRTL` flags from Java to Fabric Core. Reviewed By: JoshuaGross, mdvacca Differential Revision: D20776005 fbshipit-source-id: 946c239d9a11ebea958b0a6d04f2316b7cd77311 * Promote shadowColor to formsStackingContext property Summary: Changelog: [Internal] View with `ShadowColor` was getting flattened and therefore views didn't have shadow property set. This is fixed by promoting ShadowColor so in case it is set, it forms stacking context. Reviewed By: shergin Differential Revision: D20792201 fbshipit-source-id: 1033ac00e32047ffbb14e61b7c26348c578d132d * Get CallInvokers from the bridge Summary: ## Context For now, assume TurboModules doesn't exist. **What happens when we call an async NativeModule method?** Everytime JS calls an async NativeModule method, we don't immediately execute it. The legacy infra pushes the call into some queue managed by `MessageQueue.js`. This queue is "flushed" or "emptied" by the following events: - **Flushed:** A C++ -> JS call. NativeModule async methods can called with an `onSuccess` and/or `onFail` callback(s). Calling `NativeToJsBridge::invokeCallback` to invoke one of these callbacks is one way for ObjC++/C++/Java to call into JS. Another way is via JSModule method calls, which are initiated by `NativeToJsBridge::callFunction`. - **Flushed:** When `JSIExecutor::flush` is called. Since TurboModules don't exist, this only happens when we call `JSIExecutor::loadApplicationScript`. - **Emptied:** When more than 5 ms have passed, and the queue hasn't been flushed/emptied, on the next async NativeModule method call, we add to the queue. Afterwards, we empty it, and invoke all the NativeModule method calls. **So, what's the difference between flushed and emptied?** > Note: These are two terms I just made up, but the distinction is important. If the queue was "flushed", and it contained at least one NativeModule method call, `JsToNativeBridge` dispatches the `onBatchComplete` event. On Android, the UIManager module is the only module that listens to this event. This `onBatchComplete` event doesn't fire if the queue was "emptied". **Why does any of this matter?** 1. TurboModules exist. 2. We need the TurboModules infra to have `JsToNativeBridge` dispatch `onBatchComplete`, which depends on: - **Problem 1:** The queue being flushed on calls into JS from Java/C++/ObjC++. - **Problem 2:** There being queued up NativeModule async method calls when the queue is flushed. In D14656466, fkgozali fixed Problem 1 by making every C++/Java/Obj -> JS call from TurboModules also execute `JSIExecutor::flush()`. This means that, with TurboModules, we flush the NativeModule async method call queue as often as we do without TurboModules. So far, so good. However, we still have one big problem: As we convert more NativeModules to TurboModules, the average size of the queue of NativeModule method calls will become smaller and smaller, because more NativeModule method calls will be TurboModule method calls. This queue will more often be empty than not. Therefore, we'll end up dispatching the `onBatchComplete` event less often with TurboModules enabled. So, somehow, when we're about to flush the NativeModule method call queue, we need `JsToNativeBridge` to understand that we've executed TurboModule method calls in the batch. These calls would have normally been queued, which would have led the queue size to be non-zero. So if, during a batch, some TurboModule async method calls were executed, `JsToNativeBridge` should dispatch `onBatchComplete`. **So, what does this diff do?** 1. Make `Instance` responsible for creating the JS `CallInvoker`. 2. Make `NativeToJsBridge` responsible for creating the native `CallInvoker`. `Instance` calls into `NativeToJsBridge` to get the native `CallInvoker`. 3. Hook up `CatalystInstanceImpl`, the Android bridge, with the new JS `CallInvoker`, and the new native `CallInvoker`. This fixes `onBatchComplete` on Android. iOS work is pending. Changelog: [Android][Fixed] - Ensure `onBatchComplete` is dispatched correctly with TurboModules Reviewed By: mdvacca Differential Revision: D20717931 fbshipit-source-id: bc3ccbd6c135b7f084edbc6ddb4d1e3c0c7e0875 * Make HermesRuntime::description() always include "HermesRuntime" Summary: If name is passed in as part of RuntimeConfig, that is included in the description, too. Changelog: [Internal] Reviewed By: dulinriley Differential Revision: D20716320 fbshipit-source-id: f2fba6df32f496090dee787d8b7f55a6a4dd8ed8 * Fix Yoga flexshrink with min-width sizing issue Summary: While resolving the flexible items we calculate totalFlexShrinkScaledFactors which uses the flexBasis or initial width of node (Not min-width). At a later stage during distribution of space we are subtracting value from this which also takes care of min-width. For example If node has flexShrink 1 and width 100 and min-width 301 then totalFlexShrinkScaledFactors will become -1*100 = -100 but later we are subtracting -1 * 301 (min-width) = -301 which is ambiguous and causing layout inconsistencies with how web behaves. Fixed this by only using the flexBasis or width for these calculations. Changelog: [Internal][Yoga] Fix layout issue when flexShrink and min-width are used together Reviewed By: pasqualeanatriello Differential Revision: D20219419 fbshipit-source-id: 948fbc06ca541d4ad307c88c8a2df65d157778b1 * More consistent snapshots on windows (#28482) Summary: Get jest tests to be runnable on windows, and match current snapshots ## Changelog [Internal] [Fixed] - More consistent snapshots on windows Pull Request resolved: https://github.com/facebook/react-native/pull/28482 Test Plan: run `yarn test` on a windows machine, and hit the test_windows circleci tests Reviewed By: hramos Differential Revision: D20799002 Pulled By: cpojer fbshipit-source-id: da3db0171c34a43199c7d3dc17b622b37bc91701 * Improve component stack parsing Summary: Update the error log message parsing to fix missing component stacks in console.errors. Changelog: [Internal] Reviewed By: cpojer Differential Revision: D20801985 fbshipit-source-id: ae544200315a8c3c0310e8370bc38b0546734f38 * Implement RCTWarn equivalent on Android Summary: ## Overview This diff is an RFC to port a logging feature from iOS to Android. Changelog: [Internal] ## Motivation On iOS we have the following log functions and behaviors available for logging native warnings and errors: - **Warnings** (`RCTLogWarn`) - Log level 'warn' to console - Display warning in LogBox - **Errors** (`RCTLogError`) - Log level 'error' to console - Display a native RedBox (needs converted to show a LogBox if available) - **Logs** - We also have `RCTLog`, `RCTTrace`, `RCTAdvice`, `RCTInfo`, which just log to the console. In Java, we have: - **Warnings** - **None**, added in this diff - **Errors** (`DevSupportManager.showNewJavaError`) - Log level 'error' to console with `FLog.e` - Display a native RedBox (needs converted to show a LogBox if available - **Logs** - `ReactSoftException` (crashes the app??) - `ReactNoCrashSoftException` (only logs??) - Others? ## Details This diff adds a method to pair with `RCTLogWarn`, `DevSupportManager.showNewJavaWarning`, which will log to the console and show a LogBox warning if LogBox is available. ## Concerns I have a few concerns/questions about the state of logging on Android: - Should/can we move all of the logging to it's own class, like how RCTLog works? - Why does some logging happen on DevSupportManager and some in other classes? - If we moved it all to it's own class, how could we access the reactContext to call the RCTLog JS module Reviewed By: JoshuaGross Differential Revision: D20056394 fbshipit-source-id: 32d57e300685e46da8039fc77cb22b4084acf81a * Remove unused feature flag: useMapNativeAccessor Summary: useMapNativeAccessor isn't being used anywhere. Changelog: [Internal] Removing unused internal feature flags: mUseMapNativeAccessor and mUseArrayNativeAccessor Reviewed By: mdvacca Differential Revision: D20788147 fbshipit-source-id: bf670508326813602cb544f86d3d2164651d3394 * Remove unused Feature Flag: lazilyLoadViewManagers Summary: Remove unused feature flag. This is not used within Facebook and I'm not aware of usage outside of FB. Changelog: [Removed] Removing Android feature flag: lazilyLoadViewManagers Reviewed By: mdvacca Differential Revision: D20788210 fbshipit-source-id: 435316e3de7830d7cb7f14537351883e4fc6eeaa * Remove unused feature flag: enableExtraWebViewLogs Summary: Hard-coded to false everywhere, and write-only. We never read from this. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20788252 fbshipit-source-id: ae117ebc51db7045947b9713602527ff4220833e * Remove unused feature flag: logDroppedViews Summary: Remove unused internal feature flag, logDroppedViews. Changelog: [Internal] Reviewed By: lunaleaps Differential Revision: D20797353 fbshipit-source-id: 1bfea7fcce9e80cdb92cda59a89c7dd817d4a581 * Split loadApplicationScript into initializeRuntime and loadBundle (#27844) Summary: This is the first of three PRs related to enabling multi-bundle support in React Native. More details, motivation and reasoning behind it can be found in RFC [here](https://github.com/react-native-community/discussions-and-proposals/issues/152). Logic responsible for installing globals was pulled out from `loadApplicationScript` to `initializeRuntime` since it should be ran only once, what was left was renamed to `loadBundle`. It's based on dratwas work from [here](https://github.com/callstack/react-native/tree/feat/multibundle/split-load-application), but applied to current `master` to avoid rebasing 3-months old branch and issues that come with that. ## Changelog [Internal] [Changed] - split `loadApplicationScript` into `initializeRuntime` and `loadBundle` to enable multi-bundle support in the future Pull Request resolved: https://github.com/facebook/react-native/pull/27844 Test Plan: Initialized new RN app with CLI, set RN to build from source and verified the still app builds and runs OK using code from this branch. Reviewed By: rickhanlonii Differential Revision: D19888605 Pulled By: ejanzer fbshipit-source-id: 24ace48ffe8978796591fe7c6cf53a61b127cce6 * Back out "Fix controlled TextInput with child nodes" Summary: Changelog: [Internal] Original commit changeset: 1b8a2efabbfa Original diff D20587681 breaks non-controlled text input. Reviewed By: motiz88 Differential Revision: D20815935 fbshipit-source-id: 70577ed1e5701850ff0e30a6592945a31c2a8bec * Fixed crash in JSIExecutor::NativeModuleProxy Summary: JSIExecutor::NativeModuleProxy is an object created by JSIExecutor and essentially representing that in JavaScript world. Before this change, JSIExecutor::NativeModuleProxy had a raw reference to JSIExecutor which (I believe) caused a crash because JSIExecutor can be deallocated before JSIExecutor::NativeModuleProxy. Now, instead of storing a pointer to JSIExecutor, we store a weak pointer to JSINativeModules which we can safely validate before calling on it. Changelog: [Internal] Fixed crash in JSIExecutor Now the configuration looks like this: ``` + - - - - - - - - - - - - - - - - - - - - - Something else | | shared_ptr<jsi::Runtime> runtime --+ | | + - - - - - - - - - - - - - - - - - - - - - | | | +------------------------------------------+ | | | | | JSExecutorFactory | | +--------------------------------+-------------------------------+ | | +-----------------------+ | | | +------------------------------------------+ | | v | | | +------------------------------------------+ | +--------------------------+ | | | | | | | | ModuleRegistry | | v | | | | | +------------------------------------------+ | | +------------------------------------------+ | | HermesRuntimeImpl | | | | | | (jsi::Runtime) |--+ | | +->+------------------------------------------+ | | | | | | | |std::unordered_map<std::string, size_t> | | +------------------------------------------+ | | | | |modulesByName_ | | | | | | | | | | | | | +------------------------------------------+ | | | | +->+------------------------------------------+ | +-----------------------+ | | |std::vector<std::unique_ptr<NativeModule>>| | | | | |modules_ | | | | | | | | v | | +------------------------------------------+ | +------------------------------------------+ | | | | | | | | | JSIExecutor::NativeModuleProxy | | | | | | | | | +------------------------------------------+ | | | +------------------------------------------+ | | | | | | +->+------------------------------------------+ | | | | NativeToJsBridge | |shared_ptr<JSINativeModules> | | | | | | |nativeModules_ | | | | +------------------------------------------+ +------------------------------------------+--+-----+------------------------------------+ | | | | | | +->+------------------------------------------+ | | | | | |unique_ptr<JSExecutor> | | | | | | |m_executor | | | | | | |(`::destroy()` resets it.) | | | | | | +------------------------------------------+--------------------------------+ | | | | +->+------------------------------------------+ | | | | | | |shared_ptr<JsToNativeBridge> | | | | | | | |m_delegate | | | | | | | +------------------------------------------+--+ v | | | | +->+------------------------------------------+ | +------------------------------------------+ | | | | |shared_ptr<MessageQueueThread> | | | | | | | | |m_executorMessageQueueThread | | | HermesExecutor: JSIExecutor: JSExecutor | | | | | +------------------------------------------+ | | | | | | | | +------------------------------------------+ | | | | | | | | | | | +->+------------------------------------------+ | | | | | | |shared_ptr<jsi::Runtime> | | | | | | | |runtime_ | | | | | | | +------------------------------------------+--+ | | | | +->+------------------------------------------+ | | | | | |shared_ptr<JSINativeModules> | | | | | | |nativeModules_ | | | | | | +------------------------------------------+--------+------------------------------------+ | +--------------------------+ +->+------------------------------------------+ | | | | |std::shared_ptr<ExecutorDelegate> | | v | | |delegate_ | | +------------------------------------------+ | | +------------------------------------------+--+ | | | | | | | | JSINativeModules | | | | | | | | | | | +------------------------------------------+ | | | | | | | | | +-->+------------------------------------------+ | +-----------------------------------------------------------------------------------+ | |m_moduleRegistry | | | | |(shared_ptr) | | | | +------------------------------------------+--+ | | | | v | +------------------------------------------+ | | | | | JsToNativeBridge: ExecutorDelegate | | | | | +------------------------------------------+ | | | +->+------------------------------------------+ | |shared_ptr<ModuleRegistry> | | |m_registry | | +------------------------------------------+-----------------------------------------------------------------+ ``` Reviewed By: RSNara Differential Revision: D20817257 fbshipit-source-id: 9ae378dbe880aaabfef7ae783dae2f94ee4b0af5 * Fix crash caused by <Modal> trying to present view controller twice Summary: Changelog: [Internal] `_viewController` was being presented twice causing following exception ``` 'Application tried to present modally an active controller <FBReactRootViewController: 0x7fe741818b80; ``` Reviewed By: shergin Differential Revision: D20820395 fbshipit-source-id: 5c9489011e5f99d8bd37befbd544d2d55a650589 * Loosen up restrictions for internal changelogs (#28486) Summary: Do not nag on PRs that contain internal changelogs (meaning, the change doesn't need to be called out in release notes). ## Changelog [Internal] - This should be acceptable. Pull Request resolved: https://github.com/facebook/react-native/pull/28486 Test Plan: See PR. Reviewed By: cpojer Differential Revision: D20817454 Pulled By: hramos fbshipit-source-id: a7082c4db05ec53ad27349db7e5bce2cfffd6930 * Fix TextInlineViews when UIImplementation processes two roots at the same time Summary: This diff cleans the variable NativeViewHierarchyOptimizer.mTagsWithLayoutVisited right after all the view updates for a rootShadowNode have been processed by the UIImplementation class. This intends to fix the bug reported in the task: T61185028, which root cause seems related to the fact that the variable NativeViewHierarchyOptimizer.mTagsWithLayoutVisited is not cleaned up when updating multiple rootShadowNodes as part of the same batch changelog: [Android][internal] internal bug fix Reviewed By: JoshuaGross Differential Revision: D20812921 fbshipit-source-id: 28067ee29a931d7a9e9c33c90aceb4e3512dac1a * Add a React Feature Flag to control TextInlineView fix Summary: This diff adds a temporary Feature Flag to control a fix in TextInlineView (see previous diffs of the stack) changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D20812920 fbshipit-source-id: 90fece9b29ba173546d96e4d9baf1ccabb3031b2 * Pass native CallInvoker to ObjCTurboModule constructor Summary: This is necessary to integrate TurboModule async method dispatch with the bridge's `onBatchComplete` event. See D20717931 for more details. This diff is similar to D20480971. **Note:** This stack doesn't really make any functional changes, since the native CallInvoker is `nullptr` right now. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809199 fbshipit-source-id: bf465a3a51bdddb8b56d1e696ca510fdf071f9ec * Manual changes required to make ObjCTurboModule accept native CallInvoker Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809200 fbshipit-source-id: d540eec9a3360a031f75d76a6ab9fb15303f8af5 * Codemod all getTurboModuleWithJsInvoker methods to accept a native CallInvoker Summary: To make iOS TurboModules integrate with the bridge's onBatchComplete event, they need to use a native CallInvoker. This call invoker is created by the `NativeToJsBridge`, and ObjCTurboModule will use this native CallInvoker to dispatch TurboModule method calls. This diff makes sure that ObjCTurboModules are created with that native CallInvoker. ## Script ``` var withSpaces = (...args) => args.join('\s*') var regexString = withSpaces( '-', '\(', 'std::shared_ptr', '<', '(?<turboModuleClass>(facebook::react::|react::|::|)TurboModule)', '>', '\)', 'getTurboModuleWithJsInvoker', ':', '\(', 'std::shared_ptr', '<', '(?<callInvokerClass>(facebook::react::|react::|::|)CallInvoker)', '>', '\)', '(?<jsInvokerInstance>[A-Za-z0-9]+)', 'perfLogger', ':', '\(', 'id', '<', 'RCTTurboModulePerformanceLogger', '>', '\)', '(?<perfLoggerInstance>[A-Za-z0-9]+)', '{', 'return', 'std::make_shared', '<', '(?<specName>(facebook::react::|react::|::|)Native[%A-Za-z0-9]+SpecJSI)', '>', '\(', 'self', ',', '\k<jsInvokerInstance>', ',', '\k<perfLoggerInstance>', '\)', ';', '}', ) var replaceString = `- (std::shared_ptr<$<turboModuleClass>>) getTurboModuleWithJsInvoker:(std::shared_ptr<$<callInvokerClass>>)$<jsInvokerInstance> nativeInvoker:(std::shared_ptr<$<callInvokerClass>>)nativeInvoker perfLogger:(id<RCTTurboModulePerformanceLogger>)$<perfLoggerInstance> { return std::make_shared<$<specName>>(self, $<jsInvokerInstance>, nativeInvoker, $<perfLoggerInstance>); }` const exec = require('../lib/exec'); const abspath = require('../lib/abspath'); const relpath = require('../lib/relpath'); const readFile = (filename) => require('fs').readFileSync(filename, 'utf8'); const writeFile = (filename, content) => require('fs').writeFileSync(filename, content); function main() { const tmFiles = exec('cd ~/fbsource && xbgs -n 10000 -l getTurboModuleWithJsInvoker:').split('\n').filter(Boolean); tmFiles .filter((filename) => !filename.includes('microsoft-fork-of-react-native')) .map(abspath) .forEach((filename) => { const source = readFile(filename); const newSource = source.replace(new RegExp(regexString, 'g'), replaceString); if (source == newSource) { console.log(relpath(filename)); } writeFile(filename, newSource); }); } if (!module.parent) { main(); } ``` Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809202 fbshipit-source-id: 5d39b3cacdaa5681b70ce1803351d0432dd74550 * Make RCTTurboModuleManagerDelegate getTurboModule accept native CallInvoker and PerfLogger Summary: Might be worthwhile to just kill this method instead, since we're having all NativeModules provide their TurboModule jsi::HostObjects. But I'll leave that decision to a later time. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809201 fbshipit-source-id: ee73d4b5454a76460832a54f9b864841e5b2b9c0 * eslint-config: add version badge and add homepage for eslint-config (#28506) Summary: Add version badge to README of eslint-config, and add specific url for the homepage so people looking at the npm package can find out where the package is from. ## Changelog [Internal] [Changed] - Add version badge to README of eslint-config Pull Request resolved: https://github.com/facebook/react-native/pull/28506 Test Plan: Not required as the only changes are made in README and homepage prop of package.json Differential Revision: D20837085 Pulled By: cpojer fbshipit-source-id: 820d3b44b069780ec8764c6152d2e7fd5220933c * Rename Instance::getNativeCallinvoker to Instance::getDecoratedNativeCallInvoker Summary: Now, instead of accepting a `std::function` that schedules work, and returning a `CallInvoker`, `Instance::getDecoratedNativeCallInvoker` will accept a `CallInvoker` that schedules work, and return a decorated `CallInvoker`. I think this change will help with readability. It also clarifies that the bridge is adding additional behaviour to the native `CallInvoker`. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20826885 fbshipit-source-id: a2c5681d10a4544ee3d2a0d1f1cbd386ef06d0e6 * Add CallInvoker::invokeSync Summary: We'll be using a native CallInvoker to dispatch sync and async method calls to ObjC NativeModules. This native CallInvoker will hold a reference to the ObjC NativeModule's method queue. **Why is the native CallInvoker required for ObjC NativeModules?** In the case where the ObjC NativeModule neither provides nor requests a method queue, we must create a method queue for it. When we go to invoke a method from JS, for these NativeModules specifically, there is no way to access this method queue. A native CallInvoker is a convenient abstraction that holds on to that method queue. For async calls, we'll just call `CallInvoker::invokeAsync`, and for sync calls, we'll just call `CallInvoker::invokeSync`. **Why do we need sync call support for native `CallInvoker`?** In ObjC, sync NativeModule method calls block the JS thread, then execute synchronously on the NativeModule's method queue, and then unblock the JS thread. This is what'll be implemented by `CallInvoker::invokeSync`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20829955 fbshipit-source-id: efb9d5408a1ade81069a943c865f232d4d10acfe * Export Instance::getDecoratedNativeCallInvoker from RCTCxxBridge Summary: `RCTTurboModuleManager` will create a native `CallInvoker` for each ObjC NativeModule. This `CallInvoker` will be used to dispatch calls from JS to native. Before passing the native `CallInvoker` to the `ObjCTurboModule`, it'll first use `RCTCxxBridge decorateNativeCallInvoker` to get a bridge-aware decorated native `CallInvoker`. That way, the bridge remains informed about async TurboModule method calls that took place since the last time it was flushed. This ensures that we don't end up dispatching `onBatchComplete` any less with TurboModules on than we do with TurboModules off. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20831546 fbshipit-source-id: b2eb4e0097e0dabf8c4bd8fdc4c850a0858af699 * Add Author Feedback label automatically (#28484) Summary: Improve issue triage by automatically adding the "Needs: Author Feedback" label. NOTE: The old label-actions app should be disabled when this PR is merged: https://github.com/apps/label-actions/installations/7445225 ## Changelog [Internal] - Issue Triage Pull Request resolved: https://github.com/facebook/react-native/pull/28484 Test Plan: Verified the same `label-actions.yml` and workflow config on a private repo. Reviewed By: cpojer Differential Revision: D20817443 Pulled By: hramos fbshipit-source-id: 39732dd67509c9fb9cf6ff7306913f5ec088266d * docs: add README and specify file in package.json (#28507) Summary: Adding a README for `react-native-codegen` since the package was published. Also added a `files` prop in package.json so unused file won't be included in the package. ## Changelog [Internal] [Changed] - Add README for react-native-codegen. Pull Request resolved: https://github.com/facebook/react-native/pull/28507 Test Plan: verify js files to function correctly without including files other than `src` Reviewed By: rickhanlonii Differential Revision: D20836113 Pulled By: cpojer fbshipit-source-id: e860f14760e9c1dbe121f5fb95ccf72d4ddb2af1 * Make the link easier to copy. (#28516) Summary: Making a PR from GitHub, I need to copy-paste the link, and it would be easier to just triple-click a line with the URL rather than carefully selecting the URL from the text. <img width="723" alt="Screen Shot 2020-04-03 at 17 33 47" src="https://user-images.githubusercontent.com/100233/78378550-6c12af80-75d1-11ea-93a4-2eae568ce602.png"> ## Changelog [General] [Changed] - Make PR template easier to use with changelog URL. Pull Request resolved: https://github.com/facebook/react-native/pull/28516 Reviewed By: fkgozali Differential Revision: D20842238 Pulled By: hramos fbshipit-source-id: 3fef7a994f36a996bbbc52556600d468a56210a9 * Upgrade tests to Xcode 11.3.1 (#28498) Summary: Upgrade Sandcastle and Circle CI tests to use Xcode 11.3.1 across the board. Pull Request resolved: https://github.com/facebook/react-native/pull/28498 Pull Request resolved: https://github.com/facebook/react-native/pull/28501 Changelog: [Internal] - Use Xcode 11.3.1 in iOS tests Reviewed By: fkgozali Differential Revision: D20821844 fbshipit-source-id: b250ca82bdf2c9fb7faa765d3e2433eb46efd692 * Fixes iOS reload through metro "r" command key (#28477) Summary: This allows the iOS device to be reloaded through the metro command line, besides the fact that whenever packagerServerHost is called, it will only get the IP address once when debugging. ## Changelog [iOS] [Fixed] - Fixed connection of metro reload command to iOS device Pull Request resolved: https://github.com/facebook/react-native/pull/28477 Test Plan: - Build any react-native project in debug mode to an iOS device connected through USB - Press the “r” key on the terminal that is running metro - The device should now reload the project Reviewed By: cpojer Differential Revision: D20818462 Pulled By: TheSavior fbshipit-source-id: 6d9792447d205223dad8fbd955518885427cbba8 * Create method queues for NativeModules that neither provide nor request one Summary: ## Problem: Let `A` be the set of all ObjC NativeModules that neither provide nor reqeust a method queue. The TurboModule system dispatches all method calls to NativeModules in `A` synchronously to the JS thread. Here is the relevant logic: **RCTTurboModule.mm:** Link: https://fburl.com/diffusion/nz9gqje8 ``` jsi::Value performMethodInvocation( // ... ) { // ... dispatch_queue_t methodQueue = NULL; if ([instance_ conformsToProtocol:protocol(RCTBridgeModule)] && [instance_ respondsToSelector:selector(methodQueue)]) { methodQueue = [instance_ performSelector:selector(methodQueue)]; } if (methodQueue == NULL || methodQueue == RCTJSThread) { // This is the default mode of execution: on JS thread. block(); } else if (methodQueue == dispatch_get_main_queue()) { ``` **Why does this end up happening?** 1. NativeModules that request a method queue have `synthesize methodQueue = _methodQueue` in their `implementation` section. This generates a `methodQueue` getter for the NativeModule, and also creates an ivar to back that getter. The TurboModule system generates a `dispatch_queue_t` and uses ObjC's KVC API to write to the ivar. So in the above logic, for NativeModules that provide a method queue, methodQueue will neither be `NULL` nor `RCTJSThread`, so we don't dispatch synchronously to the JS thread. 2. NativeModules that provide a method queue will return something that is not `NULL` or something that is `RCTJSThread`. If they return `NULL`, the infra will throw an error early. If they return `RCTJSThread`, we'll dispatch synchronously to the JS thread, as we should (...wait. For async NativeModule methods that dispatch to `RCTJSThread`, should we dispatch asynchronously to the JS thread, via jsInvoker? **Edit:** Nope: https://fburl.com/diffusion/ivt9b40s.). In all other cases, we dispatch to appropriately to the respective method queue. 3. For NativeModules that neither provide nor request a method queue (i.e: NativeModules in `A`), they don't implement the `methodQueue` selector. Therefore, we dispatch synchronously to the JS thread. ## The fix (Part 1): The first step towards fixing this problem is to generate `dispatch_queue_t`s for NativeModules in `A`. That's what this diff accomplishes. Changelog: [iOS][Fixed] - Create method queue for NativeModules that don't provide nor request one. Reviewed By: fkgozali Differential Revision: D20821054 fbshipit-source-id: 17a73550ad96766c5c7e719e28e1cc879e36465c * Rename duplicate name `<ScrollView>` example on RNTester (#28515) Summary: Tiny change. When searching for `scro` in the RNTester, two `<ScrollView>`s come up, from different example files. One is the "simple" one and the other is the "regular" one. Before: <img width="370" alt="Screen Shot 2020-04-03 at 17 14 01" src="https://user-images.githubusercontent.com/100233/78377338-c6ab0c00-75cf-11ea-9c45-2dcdd6460f6d.png"> After: <img width="369" alt="Screen Shot 2020-04-03 at 17 13 38" src="https://user-images.githubusercontent.com/100233/78377371-cf034700-75cf-11ea-89ea-aa3ff2f3988c.png"> ## Changelog [Internal] [Changed] - Rename the "simple" ScrollView example in RNTester to "ScrollSimpleView". Pull Request resolved: https://github.com/facebook/react-native/pull/28515 Test Plan: - Try to search for `scro` in RNTester. Reviewed By: fkgozali Differential Revision: D20842264 Pulled By: hramos fbshipit-source-id: 3db54a826ae774108e62690e7f154e85b541520f * Fix Fabric SSTs, so they actually run in Fabric instead of Paper, convert ServerSnapshotTestsAppImpl to functional component Summary: Update instrumentation test infra for Fabric tests. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D19961919 fbshipit-source-id: 17264b6308712dddece730effd57832817e148cf * Fixed scrollview inset when RN view is embedded in another view (#27607) Summary: I'm using RNN, which embeds RN view inside native view controllers. On iOS 13, a modal view controller is "floating" and is offset from the top of the screen. This causes the calculation of inset in `KeyboardAvoidingView` incorrect as it mixes local view controller coordinate space, with keyboard's screen coordinate space. ## Changelog [iOS] [Fixed] - Fixed `KeyboardAvoidingView` inset in embedded views (i.e modal view controllers on iOS 13) Pull Request resolved: https://github.com/facebook/react-native/pull/27607 Test Plan: 1. Tested before and after in a simple view controller (should stay the same) 2. Tested before and after in a modal view controller (should be offset before, and fixed after) 3. Repeated no. 2 with each device rotation (upsideDown, landscapeLeft, landscapeRight) Reviewed By: cpojer Differential Revision: D20812231 Pulled By: TheSavior fbshipit-source-id: fbd72739fb7152655028730e284ad26ff4a5da73 * Bump react-native-codegen to 0.0.2 Summary: Changelog: [Internal] Reviewed By: cpojer Differential Revision: D20843514 fbshipit-source-id: c611bf91d311c6ce8a7e469d267a0417b2ee58e5 * Rename ScrollViewSimpleExample Summary: Changelog: [Internal] - Rename ScrollViewSimpleExample in RNTester Reviewed By: fkgozali Differential Revision: D20846977 fbshipit-source-id: 397589cb0a17beaf37a25b91ad8efa4a2bc62358 * Remove console warnings for innerViewNode/Ref Summary: Remove these warnings until the methods in ScrollResponder have been moved into ScrollView, so that unactionable warnings aren't firing. Changelog: [General][Removed] Remove console warnings for innerViewNode/Ref in ScrollView Reviewed By: TheSavior Differential Revision: D20850624 fbshipit-source-id: ce90988e204c3cc3b93536842ec3caa12cf6994e * Make TurboModules dispatch method calls via native CallInvoker Summary: This diff: 1. Has ObjC NativeModules use the native `CallInvoker` to invoke JS -> native sync/async calls. 2. Integrates the native `CallInvoker` for each ObjC NativeModule with the bridge. This way, the bridge is informed of all JS -> native TurboModule method calls, and dispatches `onBatchComplete` appropriately. Changelog: [iOS][Fixed] Integrate ObjC TurboModules async method calls with the bridge Reviewed By: fkgozali Differential Revision: D20831545 fbshipit-source-id: da1cbb4ecef4cae85841ca7ef625ab8e380760cd * add ripple config object to Pressable (#28156) Summary: Motivation is to support ripple radius just like in TouchableNativeFeedback, plus borderless attribute. See https://github.com/facebook/react-native/pull/28009#issuecomment-589489520 In the current form this means user needs to pass an `android_ripple` prop which is an object of this shape: ``` export type RippleConfig = {| color?: ?ColorValue, borderless?: ?boolean, radius?: ?number, |}; ``` Do we want to add methods that would create such config objects - https://facebook.github.io/react-native/docs/touchablenativefeedback#methods ? ## Changelog [Android] [Added] - support borderless and custom ripple radius on Pressable Pull Request resolved: https://github.com/facebook/react-native/pull/28156 Test Plan: Tested locally in RNTester. I noticed that when some content is rendered after the touchables, the ripple effect is "cut off" by the boundaries of the next view. This is not specific to Pressable, it happens to TouchableNativeFeedback too but I just didn't notice it before in https://github.com/facebook/react-native/pull/28009. As it is an issue of its own, I didn't investigate that. ![pressable](https://user-images.githubusercontent.com/1566403/75098762-785f2200-55ba-11ea-8842-e648317610e3.gif) I changed the Touchable example slightly too (I just moved the "custom ripple radius" up to show the "cutting off" issue), so just for completeness: ![touchable](https://user-images.githubusercontent.com/1566403/75098763-81e88a00-55ba-11ea-9528-e0343d1e054b.gif) Reviewed By: yungsters Differential Revision: D20071021 Pulled By: TheSavior fbshipit-source-id: cb553030934205a52dd50a2a8c8a20da6100e23f * Make TurboModule creation thread-safe Summary: NativeModules can be created from any number of threads. In the legacy system, `ModuleHolder`, the class responsible for creating NativeModules, has built-in concurrency control to ensure that NativeModule creation is thread-safe. This diff introduces that thread-safety to the TurboModule infra. Basically, after this diff, if `n` threads race to create a TurboModule x, only the first thread will create x. All other threads will wait until x is created. Changelog: [Android][Fixed] - Make TurboModule creation thread-safe Reviewed By: mdvacca Differential Revision: D20659799 fbshipit-source-id: 2b720fe1ea49e40ae0d6dae50d422f23a6f45520 * Remove unused fields from error dialog Summary: Removed in https://github.com/facebook/react/pull/18487 Changelog: [React Core] Logging changes Reviewed By: gaearon Differential Revision: D20853086 fbshipit-source-id: 4b0002f21269f415769a2ac8305ba5750245f7d1 * Fix crash when enabling Performance Monitor on iOS 13.4 (#28512) Summary: This PR fixes a crash when opening the Performance Monitor on iOS 13.4. Detailed info: https://github.com/facebook/react-native/issues/28414 ## Changelog `[iOS] [Fixed] - Fix crash when enabling Performance Monitor on iOS 13.4` ## How This PR prevents the JavaScriptCore option from being set altogether. This ensures that the performance monitor keeps working, but on iOS 13.4 and higher, it will no longer crash trying to show the GC usage. Pull Request resolved: https://github.com/facebook/react-native/pull/28512 Test Plan: Tested on iOS 13.4 (simulator): ![image](https://user-images.githubusercontent.com/6184593/77903803-c6370c00-7283-11ea-8b71-b6b6546c82f6.png) Tested on iOS 13.1 (simulator) ![image](https://user-images.githubusercontent.com/6184593/77903499-41e48900-7283-11ea-9d14-83f67a3b7b77.png) - Verified that the `setOption` was called, but the Performance Monitor didn't show any GC usage regardless. - Identical PR https://github.com/expo/react-native/pull/21 has been shipped and tested in Expo Client 37 Fixes https://github.com/facebook/react-native/issues/28414 Reviewed By: PeteTheHeat Differential Revision: D20851131 Pulled By: TheSavior fbshipit-source-id: ff96301036e8487db59f95947bbe6841fe230e1e * Modify warning message (#28514) Summary: Modify deprecation warning message for `AccessibilityInfo.fetch` - https://reactnative.dev/docs/accessibilityinfo#isscreenreaderenabled - https://github.com/facebook/react-native/commit/523ab8333800afbfb169c6fd70ab6611fe07cc2a ## Changelog [Internal] [Changed] - Modify deprecation warning message for `AccessibilityInfo.fetch` Pull Request resolved: https://github.com/facebook/react-native/pull/28514 Test Plan: Try using `AccessibilityInfo.fetch` and check log Reviewed By: cpojer Differential Revision: D20850223 Pulled By: TheSavior fbshipit-source-id: e21bb20b7a02d9f2ed6e27e2bfecbac0aebf9e09 * Set _borderLayer.frame when border changes Summary: Changelog: [Internal] Setting `_borderLayer.frame` inside `-[RCTViewComponentView layoutSubviews]` causes unwanted animation because it is not wrapped in `CATransaction`. Moving it to `-[RCTViewComponentView updateLayoutMetrics]` which is called inside `CATransaction`. Reviewed By: shergin Differential Revision: D20836890 fbshipit-source-id: 2048a25fd2edb8109f6275c1186c0adae4b9f504 * Add API for getting sourceURL directly from ReactContext Summary: In bridgeless mode, the CatalystInstance doesn't exist, but we still need to be able to access the sourceURL in SourceCodeModule (which is needed to render the images in LogBox warnings and errors). This diff adds a new API for getting the sourceURL directly from ReactContext, instead of having to call context.getCatalystInstance().getSourceURL(), and updates SourceCodeModule to use it. Changelog: [Internal] Reviewed By: RSNara Differential Revision: D20848700 fbshipit-source-id: 3ecda81a17121178b76bbb3e9b0f27f103c1961a * imp: Remove unused `npx` reference (#28544) Summary: Recently we removed `npx` usage from `react-native-cli` flow. After checking usages in this repo I found unused reference. ## 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] [Removed] - Remove unused `npx` reference Pull Request resolved: https://github.com/facebook/react-native/pull/28544 Test Plan: Tests pass Reviewed By: cpojer Differential Revision: D20873090 Pulled By: hramos fbshipit-source-id: 12e05e9635a83f19439024766817e4599320af98 * Add debug logs to track down T62192299 exception source Summary: Add debug logs to track down T62192299 exception source Changelog: [Internal] Reviewed By: RSNara Differential Revision: D20878063 fbshipit-source-id: 94acd56c45d4b529a695d1b4d2bfd10d8f725e63 * Back out "Fixed scrollview inset when RN view is embedded in another view" Summary: Original commit changeset: fbd72739fb71 Changelog: Back out "[react-native][PR] Fixed scrollview inset when RN view is embedded in another view" Reviewed By: TheSavior Differential Revision: D20878607 fbshipit-source-id: 0d77b9fb08c637f7894c399a219a242e472b0700 * Fail silently in AppStateModule.sendEvent if CatalystInstance is not available Summary: According to our logs, 80% of these warnings are coming from AppStateModule. It's not particularly interesting or surprising that the CatalystInstance would be torn down when there's some app event, so let's stop taking up DB space with a useless message. Reviewed By: ejanzer, mdvacca Differential Revision: D20879426 fbshipit-source-id: b1182461aed4a66d82cb34bbd4b12782af6ed7b3 * Move DebugEnvironment helper to open source Summary: This is an internal only module that we use to detect whether we are in async debugging mode. Changelog: [Internal] Reviewed By: yungsters Differential Revision: D20879780 fbshipit-source-id: 5915f4e1c54a3fda0cf607c77f463120264fdbc4 * Fix Appearance module when using Chrome Debugger Summary: The appearance module uses sync native module methods which doesn't work with the chrome debugger. This broke in 0.62: https://github.com/facebook/react-native/issues/26705 This fix makes the appearance module return 'light' when using the chrome debugger. Changelog: [Fixed] Appearance `getColorScheme` no longer breaks the debugger Reviewed By: yungsters Differential Revision: D20879779 fbshipit-source-id: ad49c66226096433bc9f270e004ad4a6f54fa8c2 * Extend Android ImageViewManager to support analyticsTag prop Summary: This diff extends the Android Image View manager to support the new analyticsTag prop. this prop is going to be used to track performance for images in android changelog: [Android][Added] Add analyticsTag prop into ImageView component Reviewed By: JoshuaGross Differential Revision: D20880602 fbshipit-source-id: e302e8fa83706e6517b228d44a3094a1686830f7 * Extend Image.android to support analyticsTag prop Summary: Quick diff to extend Image.android component to support analytics tag prop changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D20880601 fbshipit-source-id: 99bc11f36ce46953c00480f7c8d628cf6c0a9263 * Create ImageContext object to allow udpating the analyticsTag prop for RN sections Summary: As part of this diff I create the new ImageContext object that will be used to allow the update of the analyticsTag prop for components that contain multiple images in their view hierarchy changelog: [JS][Added] Add ImageContext object, this object can be used to update the Imageview's analyticsTag prop on RN components that contain multiple images in their view hierarchy Reviewed By: JoshuaGross Differential Revision: D20880603 fbshipit-source-id: f2094bfd3ab1c867cf7c107e678a098aab7e94a8 * Ez cleanup in ImageProps Summary: Ez cleanup in ImageProps, this import is not being used anymore changelog: [internal] internal change Reviewed By: JoshuaGross Differential Revision: D20880600 fbshipit-source-id: 7d903b5a6e16c37e61dec661b6bd1f9a6b442cc3 * Exclude all FlipperKit transitive dependencies from iOS Release builds (#28504) Summary: The `:configuration` option from `pod` only affects the specified pod and not its dependencies [1]. Therefore in order to avoid all transitive dependencies being linked in the resulting Release IPA we need to list them in the `Podfile`. Note that this will still build Flipper's pods when doing a Release, but it won't link it in the resulting IPA. [1] https://guides.cocoapods.org/syntax/podfile.html#pod Fixes https://github.com/react-native-community/upgrade-support/issues/28 Related https://github.com/CocoaPods/CocoaPods/issues/9658 ## Changelog * [iOS] [Fixed] - Exclude Flipper from iOS Release builds Pull Request resolved: https://github.com/facebook/react-native/pull/28504 Test Plan: Create a new React Native 0.62 project, run `pod install`, then diff: ``` ProjectName/ios/Pods/Target Support Files/Pods-ProjectName/Pods-ProjectName.debug.xcconfig` ``` and ``` ProjectName/ios/Pods/Target Support Files/Pods-ProjectName/Pods-ProjectName.relaese.xcconfig ``` ![image](https://user-images.githubusercontent.com/855995/78337679-a3fa0280-7591-11ea-8142-6f82cbc6be58.png) Reviewed By: passy Differential Revision: D20894406 Pulled By: priteshrnandgaonkar fbshipit-source-id: 680780f0f5a85fd8423b85a271a499bd12f06d00 * Fix crash in FabricUIManager.onMeasure Summary: Changelog: [Internal] The cause of crash was `NullPointerException`, which happened because of `mReactContextForRootTag.get(rootTag)` returning `null`. This is solved by checking whether it returns `null` before passing it to `I18nUtil`. Reviewed By: mdvacca Differential Revision: D20890623 fbshipit-source-id: c884c6838b83b944a5438375a4c060c1f5b1dc6e * Fix flow types of ImageContext Summary: ez diff to Fix flow types of ImageContext changelog: [internal] internal change to update flow types of ImageContext Reviewed By: TheSavior Differential Revision: D20883647 fbshipit-source-id: 6dba83ab431e56a71f96c39005ebcccf39a7da9a * Avoid passing analyticsTag prop to native if this is set to null Summary: This diff avoids passing the analyticsTag prop to native if this is set to null changelog: [internal] internal optimization Reviewed By: TheSavior Differential Revision: D20904498 fbshipit-source-id: f1ea1e5aa3199ef073668df86ca7cf6e20f70c5b * Rename analyticsTag -> internal_analyticsTag in ImageView component Summary: This diff renames the analyticsTag prop for the intenral_analyticsTag in ImageView component changelog: [internal] Creation of internal_analyticTag prop in ImageView, for now this prop is meant to be used internally. Reviewed By: TheSavior Differential Revision: D20904497 fbshipit-source-id: 2a28f746772ee0f9d657ec71549020c1f3e9d674 * Make Vibration.vibrate compatible with TurboModules (#27951) Summary: This PR fixes a compatibility issue with the Vibration module and TurboModules. The TurboModules spec doesn't allow nullable arguments of type Number, causing the following problem: ![IMG_3758](https://user-images.githubusercontent.com/1247834/73803879-10be6f80-4790-11ea-92d4-a008f0007681.PNG) ## Changelog [iOS] [Fixed] - Make Vibration library compatible with TurboModules. Pull Request resolved: https://github.com/facebook/react-native/pull/27951 Test Plan: Just submitted a PR to my own app to fix the issue [here](https://github.com/rainbow-me/rainbow/pull/340) The problem should be reproducible on RNTester due to this line: https://github.com/facebook/react-native/blob/91f139b94118fe8db29728ea8ad855fc4a13f743/RNTester/js/examples/Vibration/VibrationExample.js#L66 and should be working on this branch. Reviewed By: TheSavior Differential Revision: D19761064 Pulled By: hramos fbshipit-source-id: 84f6b62a2734cc09d450e906b5866d4e9ce61124 * Fix Cocoapods builds Summary: ## Problem For some reason, D20831545 broke the `use_frameworks!` build of RNTester. ## Building RNTester ``` pushd ~/fbsource/xplat/js/react-native-github/RNTester && USE_FRAMEWORKS=1 pod install && open RNTesterPods.xcworkspace && popd; ``` ## Error I built RNTester locally, and the error was this: ``` Undefined symbols for architecture x86_64: "facebook::jsi::HostObject::set(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&, facebook::jsi::Value const&)", referenced from: vtable for facebook::react::ObjCTurboModule in RCTImageEditingManager.o vtable for facebook::react::ObjCTurboModule in RCTImageLoader.o vtable for facebook::react::ObjCTurboModule in RCTImageStoreManager.o "facebook::jsi::HostObject::getPropertyNames(facebook::jsi::Runtime&)", referenced from: vtable for facebook::react::ObjCTurboModule in RCTImageEditingManager.o vtable for facebook::react::ObjCTurboModule in RCTImageLoader.o vtable for facebook::react::ObjCTurboModule in RCTImageStoreManager.o ld: symbol(s) not found for architecture x86_64 ``` ## Fix It looked like libraries that depend on "ReactCommon/turbomodule/core" weren't linking to JSI correctly. So, I modified all such Podspecs to also depend on "React-jsi": ``` arc rfr ' s.dependency "ReactCommon/turbomodule/core", version' ' s.dependency "ReactCommon/turbomodule/core", version\n s.dependency "React-jsi", version' ``` This seemed to do the trick. In buck, we'd fix this problem using exported_dependencies. I skimmed through cocoapods, and couldn't find such a configuration option there. So, I guess this will have to do? Changelog: [iOS][Fixed] - Fix Cocoapods builds of RNTester Reviewed By: fkgozali, hramos Differential Revision: D20905465 fbshipit-source-id: 60218c8274ec165752a428f2a7a9a546607c8fec * Add minimumSize to RCTRootView & RCTRootShadowView Summary: This adds a `minimumSize` property to RCTRootView, and forwards any changes to it's shadow view. This **does not** change any default behaviour, as the default minimum size is `CGSizeZero` before & after this diff. Changelog: [iOS][Internal] Add minimumSize to RCTRootView & RCTRootShadowView Reviewed By: RSNara Differential Revision: D20905456 fbshipit-source-id: a03f880e782891f60ef86b9c898965e05a5e796e * Make RCTNativeAnimatedModule into a TurboModule Summary: D20831545 integrated TurboModules with the bridge's `onBatchComplete` event. This fixed the RCTNativeAnimatedModule jank, so I'm re-converting RCTNativeAnimatedModule into a TurboModule. Changelog: [iOS][Fixed] - Make RCTNativeAnimatedModule TM-compatible Reviewed By: PeteTheHeat Differential Revision: D20850744 fbshipit-source-id: bb85a1bb27963e7d39bf149d0a3d7b71c88175da * upgrade to flow 0.122.0 Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D20919782 fbshipit-source-id: 3d5dc54ea4daafb8a1d96cad6c35a2dab4c24097 * Switch order of onSelectionChange and onChange events send from native Summary: Changelog: [Internal] UIKit uses either `UITextField` or `UITextView` as its UIKit element for `<TextInput>`. `UITextField` is for single line entry, `UITextView` is for multiline entry. There is a problem with order of events when user types a character. In `UITextField` (single line text entry), typing a character first triggers `onChange` event and then `onSelectionChange`. JavaScript depends on this order of events because it uses `mostRecentEventCount` from this even to communicate to native that it is in sync with changes in native. In `UITextView` (multi line text entry), typing a character first triggers `onSelectionChange` and then `onChange`. As JS depends on the correct order of events, this can cause issues. An example would be a TextInput which changes contents based as a result of `onSelectionChange`. Those changes would be ignored as native will throw them away because JavaScript doesn't have the newest version. Reviewed By: JoshuaGross Differential Revision: D20836195 fbshipit-source-id: fbae3b6c0d388fc059ca2541ae980073b8e5f6c7 * Maintain selection and cursor location when setting string on TextInput Summary: Changelog: [Internal] Calling `_backedTextInputView.attributedText = attributedString` causes cursor to be moved to the end of text input. This applies to both, `UITextField` and `UITextView`. This is not desired as when JS sets a new text, we don't want the cursor to be moved to the end of text input. JS has the option to use view commands if it wishes to move cursor somewhere. Reviewed By: JoshuaGross Differential Revision: D20836201 fbshipit-source-id: 9234e54cfbc5fc206f723626988e505275788aae * Implement event count for TextInput Summary: Changelog: [Internal] Implementation of event count for Fabric's Text input. Reviewed By: JoshuaGross Differential Revision: D20800185 fbshipit-source-id: 988692cb2fc786649821cccb06e629b40b9b0479 * Migrate setNativeProps to commands in iOS text input Summary: Changelog: Move from setNativeProps to ViewCommands. Reviewed By: JoshuaGross Differential Revision: D20843018 fbshipit-source-id: 9be9d2bbee01f2e15279e3c3ae785c1a5b163765 * Update default Podfile to not depend on a path (#28572) Summary: Recently, a default Podfile has been modified to not contain all the React Native pods, but use a helper method `use_react_native!`. While this is great, it assumes a hardcoded path of `../node_modules/react-native` to be always the correct location of the React Native. https://github.com/facebook/react-native/blob/d4d8887b5018782eeb3f26efa85125e6bbff73e4/scripts/autolink-ios.rb#L7-L9 Unfortunately, due to the way Ruby works, this completely hides the path away from the users. Before, they could have seen the wrong path explicitly in a Podfile and knew to update it to resolve path-related issues. With the current version in `master`, I can see a lot of issues where developers wonder how to resolve the path issues and how to pass the path itself. https://github.com/facebook/react-native/blob/4118d798265341061105f3a53550db83c66a71cb/template/ios/Podfile#L5-L10 This PR uses React Native CLI configuration (that is already used to link 3rd party dependencies) to explicitly define the correct path to the React Native. As a result, we don't have to change the paths here whether we're running monorepo or not. ## Changelog [IOS] [INTERNAL] - Always provide an explicit path to React Native Pull Request resolved: https://github.com/facebook/react-native/pull/28572 Differential Revision: D20945194 Pulled By: TheSavior fbshipit-source-id: 010f9754f2ed78ef62fd52f4d201f296f5af6d27 * chore: update CLI * fix: do not throw on missing `cliPath`, use the default value (#28625) Summary: The `cliPath` has always been optional value and in fact, even had its default value hardcoded in the React gradle file. In this PR, I am just taking use of it and remove throwing an error, which is going to be a really annoying breaking change. ## Changelog [ANDROID] [INTERNAL] - Don't require `cliPath` Pull Request resolved: https://github.com/facebook/react-native/pull/28625 Test Plan: Run Android project, everything works. Provide custom `cliPath`, it gets respected Reviewed By: cpojer Differential Revision: D21044222 Pulled By: TheSavior fbshipit-source-id: 8029f988d92abb9f64f30e05932c0d407d0c997e * chore: remove Kotlin version from the default template * (eslint-config) update community eslint plugin in eslint config (#28642) Summary: Updating the community eslint-plugin used in the eslint-config to the latest version. expecting new eslint-config version to be released with this change so that it can be included in new project template for 0.63 https://github.com/react-native-community/releases/issues/186 ## 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] - Update community eslint plugin in the eslint config Pull Request resolved: https://github.com/facebook/react-native/pull/28642 Test Plan: yarn lint passes Differential Revision: D21048976 Pulled By: cpojer fbshipit-source-id: 2c3ec0ef450cf357d8c88db7873f4ca1154b2034 * [0.63.0-rc.0] Bump version numbers * Upgrade Hermes dependency to 0.5.0 Summary: Use the latest published release of hermes-engine. Update RN to invoke `hermesc` instead of `hermes`. Changelog: [Android] [Changed] - Upgraded to Hermes 0.5.0 allow-large-files Reviewed By: mhorowitz Differential Revision: D20998564 fbshipit-source-id: 4824e273bcb044029a5a7e9379f168d3da47da50 * Remove the post install step (#28651) Summary: Removes the post install step for Flipper, as the latest version of YogaKit is compatible with swift 5. cc alloy ## 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 --> [Flipper] [Template] - Remove the post install step for Flipper Pull Request resolved: https://github.com/facebook/react-native/pull/28651 Test Plan: Tested a newly created RN app without post install step and it built successfully. Reviewed By: passy Differential Revision: D21064653 Pulled By: priteshrnandgaonkar fbshipit-source-id: da56d0754d918e30a0ebe480c77590f0139d48ac * Allow iOS PlatformColor strings to be ObjC or Swift UIColor selectors (#28703) Summary: Per discussion in https://github.com/react-native-community/releases/issues/186 the iOS `PlatformColor()` function is documented to use the semantic color names provided by the system. The referenced HIG documentation itself links to the `UIColor` documentation for semantic colors names. However, these names differ depending on if you are viewing the new Swift API docs or the Objective C docs. The current Objective C implementation in react-native assumes Objective C UIColor selector names that are suffixed 'Color'. But in Swift, Apple provides a Swift Extension on UIColor that makes aliases without the the 'Color' suffix and then makes the original selectors invalid presumably via `NS_UNAVAILABLE_SWIFT`. Since both selector names are valid depending on if you are using Objective C or Swift, let's make both forms be legal for `PlatformColor()`. In `RCTConvert.m` there is a dictionary of legal selector names. The code already supports the ability to have names be aliases of other selectors via a RCTSelector metadata key. The change adds code to the initialization of the map: it iterates over the keys in the map, which are all ObjC style UIColor selectors, and creates aliases by duplicating the entries, creating key names by stripping off the ObjC "Color" suffix, adds the RCTSelector key referring to the original and then appends these new Swift aliases to the map. ## Changelog [iOS] [Changed] - Allow iOS PlatformColor strings to be ObjC or Swift UIColor selectors Pull Request resolved: https://github.com/facebook/react-native/pull/28703 Test Plan: The PlatformColorExample.js is updated to use the new, shorter Swift selector names. There are still other examples in the same file and in unit tests that exercise the ObjC selector names. <img width="492" alt="PlatformColor" src="https://user-images.githubusercontent.com/30053638/79809089-89ab7d00-8324-11ea-8a9d-120b92edeedf.png"> Reviewed By: shergin Differential Revision: D21147404 Pulled By: TheSavior fbshipit-source-id: 0273ec855e426b3a7ba97a87645859e05bcd4126 * Fix folly::dynamic crash when attaching a debugger to Hermes Summary: folly_futures was compiled with and exported -DFOLLY_MOBILE=1, while folly_json did not. This flag disables fancy F14 data structures for folly::dynamic in favor of a simple std::unordered_map. This caused inlined/templated code from modules depending on folly_futures to disagree with the implementations in folly_json, leading to a crash. The only such libraries were libhermes-inspector and (transitively) libhermes-executor-debug, and these only use folly::dynamic for CDP serialization, which is why the problem was not more apparent. Changelog: [Internal] Fix crash when attaching a Hermes debugger Reviewed By: mhorowitz Differential Revision: D21193307 fbshipit-source-id: 2b795bb6f4f7f991e2adaacec62d62616117322b * Update react.gradle (#28776) Summary: Running `./gradlew assembleRelease` fails as the path to the CLI contains a new line at the end. We don't run this command in `debug` mode, hence it passed the testing. My bad. Fixed, checked in both `debug` with `bundleInDebug: true` and `release`. Fixes https://github.com/facebook/react-native/issues/28700 ## Changelog [INTERNAL] [ANDROID] - Fix `React.gradle` to build Android apps in production Pull Request resolved: https://github.com/facebook/react-native/pull/28776 Test Plan: Running `./gradlew assembleRelease` works Reviewed By: hramos Differential Revision: D21287789 Pulled By: TheSavior fbshipit-source-id: dc3ec8eef7a919b072b562d2bd455e2f704bc083 * Revert D21064653: Remove the post install step Differential Revision: D21064653 Original commit changeset: da56d0754d91 fbshipit-source-id: 1086cfdeca9aa3830370ea115ba7b5f05d3fb124 * Bump @react-native-community/eslint-config in new app template Summary: Changelog: [Changed][General] Update react-native-community/eslint-config to 1.1.0, adding the new color rule Reviewed By: rickhanlonii Differential Revision: D21342153 fbshipit-source-id: ac1367353d4d3e69b6df29dc16f9fcb60cde3519 * [0.63.0-rc.1] Bump version numbers * Upgrade Flipper to 0.37.0 (#28545) Summary: Bump flipper to 0.37 for both iOS and Android [Android] [Changed] - Upgrade Flipper to 0.37.0 [iOS] [Changed] - Upgrade Flipper to 0.37.0 Pull Request resolved: https://github.com/facebook/react-native/pull/28545 Test Plan: RNTester build pass Reviewed By: rickhanlonii Differential Revision: D20930069 Pulled By: hramos fbshipit-source-id: a7cb719da3e51e6a42d27d5e64bc664398d0d3c5 * Enable with CocoaPods `:configuration` (#28796) Summary: ~~⚠️ Depends on https://github.com/facebook/flipper/pull/1086 and a new Flipper release.~~ Fixes https://github.com/facebook/react-native/commit/17f025bc26da13da795845a3f7daee65563420c0#commitcomment-38831234 Currently user’s are being told to add a definition of the `FB_SONARKIT_ENABLED` macro and examples, including those in stock React Native templates, set this for the user by making use of a `post_install` hook in the user’s `Podfile`. This leads to confusion, fragile code [when a user’s project dir structure deviates from vanilla], and is ultimately not necessary as CocoaPods already has dedicated mechanisms to: * specify build settings (through the `xcconfig` property); * and selectively include certain pods only in certain build configurations (e.g. debug). ## 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] [Changed] - Entirely control Flipper being enabled through inclusion in Podfile and optionally limiting to certain build configurations using the `:configuration` directive. Pull Request resolved: https://github.com/facebook/react-native/pull/28796 Test Plan: Tested using the changes of https://github.com/facebook/flipper/pull/1086 in a new app that uses RN `master`. Reviewed By: priteshrnandgaonkar Differential Revision: D21449754 Pulled By: passy fbshipit-source-id: 9ff7c7f4ffc32b364b1edd82b94e0b80c3997625 * Pressable: Rename pressRectOffset to pressRetentionOffset to be consistent with other touchables Summary: Text and the other Touchables have this prop called pressRetentionOffset. Pressable should be consistent with that. Changelog: [Breaking][General]: Pressable: Rename pressRectOffset to pressRetentionOffset to be consistent with other touchables Reviewed By: yungsters Differential Revision: D21552255 fbshipit-source-id: 31e64bad9e48ac98e4934dd2f4c0a7f526de5cb6 * iOS: Fix Animated image crash when CADisplayLink target in RCTWeakProxy is nil Summary: When self is nil, this may crash in RCTUIImageViewAnimated.m. ``` _displayLink = [CADisplayLink displayLinkWithTarget:[RCTWeakProxy weakProxyWithTarget:self] selector:selector(displayDidRefresh:)]; ``` Replace `RCTWeakProxy` with a concrete class `RCTDisplayWeakRefreshable` that has the displayDidRefresh method, that calls the displayDidRefresh method in its weak target. https://github.com/facebook/react-native/pull/28070#issuecomment-619295254 Changelog: [iOS] [Fixed] - Fix Animated image crash when CADisplayLink target in RCTWeakProxy is nil Reviewed By: shergin Differential Revision: D21419385 fbshipit-source-id: da7c3c38f81ea54f633da7f59359e07680ea2faf * Pressable: Add Support for Inspector Overlay Summary: Adds support for the debug overlay (enabled via the Inspector) that the legacy touchable components supported. Changelog: [General][Added] - Added Inspector overlay support for Pressable Reviewed By: TheSavior Differential Revision: D21614412 fbshipit-source-id: b884e04f8dba1bfd35e61de25d33d6d47bc34b03 * Changed iOS LaunchScreen from xib to storyboard (#28239) Summary: > Starting April 30, 2020, all apps submitted to the App Store must use an Xcode storyboard to provide the app’s launch screen and all iPhone apps must support all iPhone screens. Updated iOS Launch screen as per [App Store policy change](https://developer.apple.com/news/?id=03042020b). Community discussion: https://github.com/react-native-community/discussions-and-proposals/issues/209 ## Changelog Changed iOS Launch Screen from a `xib` to `storyboard`. The `LaunchScreen.xib` file has been replaced with `LaunchScreen.storyboard`. Xcode automatically picks up the new Launch Screen no additional change is required. [iOS] [Deleted] - Deleted LaunchScreen.xib [iOS] [Added] - Added LaunchScreen.storyboard Pull Request resolved: https://github.com/facebook/react-native/pull/28239 Test Plan: Build the Xcode project under `template/iOS` and verify that the new launch screen is identical to the previous one. Reviewed By: cpojer Differential Revision: D20408892 Pulled By: hramos fbshipit-source-id: 9c38df58d1304088a23f3d73e0fbd87675804f1a * Fix debugging on android for 0.63 (#29204) Summary: Currently on react native 0.63-rc.0 and 0.63-rc.1 enabling debugging throws an exception. It looks like something may have been missed in unregistering JSDevSupport in this commit c20963e ![crash](https://user-images.githubusercontent.com/14797029/85500252-2acae400-b5b1-11ea-938a-674b55e649b2.gif) This should fix https://github.com/facebook/react-native/issues/28746 and https://github.com/facebook/react-native/issues/29136 ## Changelog [Android] [Fixed] - Fix crash when enabling debug Pull Request resolved: https://github.com/facebook/react-native/pull/29204 Test Plan: To recreate the bug: npx react-native init RN063 --version 0.63.0-rc.1 react-native start react-native run-android Enable debug mode from react native dev menu After this commit, the crash no longer occurs ![non crash](https://user-images.githubusercontent.com/14797029/85500241-269ec680-b5b1-11ea-8cfe-85bfda4dd222.gif) Reviewed By: TheSavior Differential Revision: D22395406 Pulled By: RSNara fbshipit-source-id: 046df77ae1c1de96870fb46f409d59e7d6a68c0d * [0.63.0] Bump version numbers * Add ProGuard rule for hermes (#28571) Summary: This adds a ProGuard for `hermes` rule so it does not have to be added by users manually. https://github.com/facebook/react-native/issues/28270 ## 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 --> [Android] [Added] - ProGuard rule for hermes Pull Request resolved: https://github.com/facebook/react-native/pull/28571 Test Plan: 1. Create a project with/without hermes. 2. Enable proguard. Reviewed By: cpojer Differential Revision: D20947095 Pulled By: hramos fbshipit-source-id: 79b166ad2dd060f20041d9f5cfe2f794c754843d * Fix rounded border drawing when border-radius is smaller than border-width (#28358) Summary: This PR fixes the drawing of the border rounded edges when the border-radius is small than the border-width. The current implementation capped the possible border-radius making it impossible to set smaller border-radii when using thicker borders. After inspection it was found that the rounded-rect calculation is incorrect. ## Changelog `[Android] [Fixed] - Fix rounded border-drawing when border-radius is smaller than border-width` Pull Request resolved: https://github.com/facebook/react-native/pull/28358 Test Plan: **Faulty situation:** As you can see, when the border-radius becomes very low, the border is stuck at a minimum value. Only after setting the border-radius fully to 0 is it again rendered correctly. ![ezgif com-video-to-gif (2)](https://user-images.githubusercontent.com/6184593/77183540-c3435b00-6ace-11ea-950d-29a0ea1757bd.gif) **After the fix:** ![ezgif com-video-to-gif (3)](https://user-images.githubusercontent.com/6184593/77183619-e837ce00-6ace-11ea-93a5-910127d352b7.gif) Differential Revision: D21124739 Pulled By: shergin fbshipit-source-id: cefd1776b77b5b9fb335e95fd7fdd7f345579dc4 * Fix border-stroke drawing after resetting border-radius (#28356) Summary: This PR fixes incorrect drawing of the View borders on Android, after changing the border-radius back to 0 *(and when no background-color is defined)*. This happens because the `drawRoundedBackgroundWithBorders` function in ReactViewBackgroundDrawable changes the style on the Paint object to `STROKE`. This style is however never reverted back to `FILL`. This change ensures that the Paint style is set to `FILL` for the full execution of the `drawRectangularBackgroundWithBorders` function. ## Changelog `[Android] [Fixed] - Fix border-drawing when changing border-radius back to 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28356 Test Plan: **Faulty situation:** ![ezgif com-video-to-gif](https://user-images.githubusercontent.com/6184593/77153163-9759b280-6a99-11ea-82bb-33a1e0a4934c.gif) **After the fix:** ![ezgif com-video-to-gif (1)](https://user-images.githubusercontent.com/6184593/77153825-c91f4900-6a9a-11ea-8e0c-a4280b9e72b8.gif) Differential Revision: D21124741 Pulled By: shergin fbshipit-source-id: 2044f8e8ad59a58df42b64d7ee8c4ad1d3b562f1 * Fixes TextInput shaking when typing Chinese (#28805) Summary: Fixes https://github.com/facebook/react-native/issues/28488. ## Changelog [iOS] [Fixed] - Fixes TextInput shaking when typing Chinese Pull Request resolved: https://github.com/facebook/react-native/pull/28805 Test Plan: Demo see https://github.com/facebook/react-native/issues/28488. Differential Revision: D21376803 Pulled By: shergin fbshipit-source-id: b1fe6cc5f67d42ef98a6c12b8ab9990feac0e2a7 * Set black as default text color for <TextInput/> on iOS (#28708) Summary: This is a follow-up pull request to https://github.com/facebook/react-native/issues/28280 (reviewed by shergin). This pull request tried to solve the problem of the default color in a TextInput in dark mode on iOS being white instead of black. I got suggested to solve the problem not on the level of RCTTextAttributes, but on the level of RCTUITextField. Setting `self.textColor = [UIColor black];` in the constructor did not work, because it gets overwritten by nil in `RCTBaseTextInputView.m`. There I implemented the logic that if NSForegroundColorAttributeName color is nil then the color is being set to black. I think the `defaultTextAttributes` property confuses here, because it ends up being the effective text attributes, e.g. if I unconditionally set the default text color to black, it cannot be changed in React Native anymore. So I put the nil check in. ## Changelog [iOS] [Fixed] - TextInput color has the same default (#000) on iOS whether in light or dark mode Pull Request resolved: https://github.com/facebook/react-native/pull/28708 Test Plan: I have manually tested the following: - The default text color in light mode is black - The default text color in dark mode is black - The color can be changed using the `style.color` attribute - Setting the opacity to 0.5 results in the desired behavior, the whole TextInput becoming half the opacity. – Setting the `style.color` to rgba(0, 0, 0, 0.5) works as intended, creating a half-opaque text color. Differential Revision: D21186579 Pulled By: shergin fbshipit-source-id: ea6405ac6a0243c96677335169b214a2bb9ccc29 * Enable array buffers in JSCRuntime.cpp (#28961) Summary: The JavaScriptCore implementation of JSI [does not currently support array buffers](https://github.com/facebook/react-native/blob/master/ReactCommon/jsi/JSCRuntime.cpp#L925-L943). The comments in the code suggest the JSC version used by React Native does not work with array buffers, but this seems to be out of date since the current version of JSC used by React Native does indeed support array buffers. This change just enables array buffers in JSCRuntime.cpp. NOTE: See https://github.com/react-native-community/discussions-and-proposals/issues/91#issuecomment-632371219 for more background on this change. ## Changelog [General] [Added] - Support for array buffers in the JavaScriptCore implementation of JSI Pull Request resolved: https://github.com/facebook/react-native/pull/28961 Test Plan: To test these changes, I just made some temporary changes to RNTester to use JSI to inject a test function into the JS runtime that reads from and writes to an array buffer, and call that function from the JS of the RNTester app (see https://github.com/ryantrem/react-native/commit/28152ce3f4ae0fa906557415d106399b3f072118). For the JS side of this, specifically look at https://github.com/ryantrem/react-native/blob/28152ce3f4ae0fa906557415d106399b3f072118/RNTester/js/RNTesterApp.android.js#L13-L18 For the native side of this, specifically look at https://github.com/ryantrem/react-native/blob/28152ce3f4ae0fa906557415d106399b3f072118/RNTester/android/app/src/main/cpp/JSITest.cpp#L22-L38 Reviewed By: shergin Differential Revision: D21717995 Pulled By: tmikov fbshipit-source-id: 5788479bb33c24d01aa80fa7f509e0ff9dcefea6 * Fix font variant crash on Android < 4.4 (#29176) Summary: In RN 0.62 support for `fontVariant` was added on Android. Using that prop crashes the app on Android below KitKat (4.3 and below) To reproduce just add any Text with the `fontVariant` styling prop in the app: ```js <Text style={{fontVariant: ['tabular-nums']}}>This will crash</Text> ``` It will crash any device running Android below KitKat with the error: ![image](https://user-images.githubusercontent.com/4534323/85073452-18206b80-b1bb-11ea-8d7e-96f27fa1a320.png) This is caused by `java.utils.Objects` only being available on Android 4.4+ ## Changelog [Android] [Fixed] - Fix font variant crash on Android < 4.4 Pull Request resolved: https://github.com/facebook/react-native/pull/29176 Test Plan: [TextUtils.equals](https://developer.android.com/reference/android/text/TextUtils#equals) was added as soon as API level 1, so no compatibility issue here. Tested on Emulator running Android 4.1, no crash anymore. I've searched for other occurences of `java.utils.Objects` in the project, and this was the only one, so no need to remove other occurences ✅ Reviewed By: JoshuaGross Differential Revision: D22337316 Pulled By: mdvacca fbshipit-source-id: 5507b21b237a725d596d47b5c01e269895b16d4a * Fix LogBox.ignoreAllLogs used with no argument (#29310) Summary: When you call `LogBox.ignoreAllLogs()` it should ignore logs. This fixes a bug that made this equivalent to `LogBox.ignoreAllLogs(false)` ## Changelog [General] [Fixed] - LogBox.ignoreAllLogs() should ignore logs Pull Request resolved: https://github.com/facebook/react-native/pull/29310 Test Plan: Added tests Reviewed By: TheSavior Differential Revision: D22448436 Pulled By: rickhanlonii fbshipit-source-id: 6ba12b9d9c1f29cf3ac503946ac5ca0097425a7a * Pressable: Minimum Press Duration Summary: When a `Pressable` has a configured (or the default) `delayPressIn` and no (or the default) `delayPressOut`, tapping very quickly can lead to intantaneous invocation of `onPressIn` and `onPressOut`. The end result is that users may never experience any intended visual press feedback. This changes `Pressable` to accept (and be preconfigured with a default) **minimum press duration**. The minimum press duration ensures that even if the press is released before `delayPressIn` has elapsed, `onPressOut` will still wait the remaining time up to `minPressDuration` before firing. Note that setting a non-zero `delayPressOut` is insufficient because if a user holds down on a `Pressable` for longer than `delayPressIn`, we still want `onPressOut` to fire immediately when the press is released. Changelog: [General][Changed] - Added `minPressDuration` to `Pressable`. Reviewed By: TheSavior Differential Revision: D21614708 fbshipit-source-id: 502f3d8ad6a40e7762435b6df16809c8798dd92c * chore: bring back script to org shape * [0.63.1] Bump version numbers * Exclude okhttp from flipper dependency (#29260) Summary: This fixes https://github.com/facebook/react-native/issues/28481. As explained in [this comment](https://github.com/facebook/react-native/issues/28481#issuecomment-645546195), the flipper network plugin pulls a more recent version of okhttp (3.14), but only versions of okhttp up to 3.12 works on Android API 21 and less. This prevented being able to run the app in debug mode, it was still working fine in release mode. ## 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 --> [Android] [Fixed] - Fix unable to run in debug mode on Android API < 21 Pull Request resolved: https://github.com/facebook/react-native/pull/29260 Test Plan: Using `yarn react-native run-android` the app would instantly crash with this error in `adb logcat`: ``` E/AndroidRuntime( 5079): java.lang.RuntimeException: Unable to create application com.awesometsproject.MainApplication: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created E/AndroidRuntime( 5079): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4154) E/AndroidRuntime( 5079): at android.app.ActivityThread.access$1300(ActivityThread.java:130) E/AndroidRuntime( 5079): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1255) E/AndroidRuntime( 5079): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 5079): at android.os.Looper.loop(Looper.java:137) E/AndroidRuntime( 5079): at android.app.ActivityThread.main(ActivityThread.java:4745) E/AndroidRuntime( 5079): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 5079): at java.lang.reflect.Method.invoke(Method.java:511) E/AndroidRuntime( 5079): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) E/AndroidRuntime( 5079): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) E/AndroidRuntime( 5079): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 5079): Caused by: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:90) E/AndroidRuntime( 5079): at com.facebook.react.ReactInstanceManager.<init>(ReactInstanceManager.java:238) E/AndroidRuntime( 5079): at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:281) E/AndroidRuntime( 5079): at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:87) E/AndroidRuntime( 5079): at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:39) E/AndroidRuntime( 5079): at com.awesometsproject.MainApplication.onCreate(MainApplication.java:47) E/AndroidRuntime( 5079): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:999) E/AndroidRuntime( 5079): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4151) E/AndroidRuntime( 5079): ... 10 more E/AndroidRuntime( 5079): Caused by: java.lang.reflect.InvocationTargetException E/AndroidRuntime( 5079): at java.lang.reflect.Constructor.constructNative(Native Method) E/AndroidRuntime( 5079): at java.lang.reflect.Constructor.newInstance(Constructor.java:417) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:80) E/AndroidRuntime( 5079): ... 17 more E/AndroidRuntime( 5079): Caused by: java.lang.NoClassDefFoundError: java.util.Objects E/AndroidRuntime( 5079): at okhttp3.CertificatePinner.withCertificateChainCleaner(CertificatePinner.java:231) E/AndroidRuntime( 5079): at okhttp3.OkHttpClient.<init>(OkHttpClient.java:238) E/AndroidRuntime( 5079): at okhttp3.OkHttpClient$Builder.build(OkHttpClient.java:1015) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevServerHelper.<init>(DevServerHelper.java:132) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerImpl.<init>(DevSupportManagerImpl.java:183) E/AndroidRuntime( 5079): ... 20 more W/ActivityManager( 1456): Force finishing activity com.awesometsproject/.MainActivity ``` With this fix, the app launch successfully in debug mode, without having to remove flipper altogether from our config. Reviewed By: passy Differential Revision: D22521109 Pulled By: mdvacca fbshipit-source-id: 3c0263642438bd7c0d09b045e15a933bd8a26734 * Send key when onKeyPress event is fired from TextInput Summary: Changelog: [Internal] In `onKeyPress` event, we were not returning `key` property. This diff adds `key` property to `onKeyPress` event and removes other, redundant properties from `onKeyPress` event. The implementation has been translated from Paper. Reviewed By: shergin Differential Revision: D21250411 fbshipit-source-id: f1e31381667acb9dec02d0b33883df8f8f5b2a4b * Calling Paper TextInput setTextAndSelection view command now dirties layout Summary: Changelog: [Internal] Previously `setTextAndSelection` was not dirtying layout. This would cause an issue where `setTextAndSelection` causes layout change. For example calling setTextAndSelection with empty string on a multiline auto expanding text input. I changed one example in TextInputSharedExamples.js, "Live Re-Write (no spaces allowed) and clear" example is now multiline. This allows to test whether `setTextAndSelection` dirties layout. Enter multiline string to to the example text input and press clear. Observe that the text input shrinks to single line height. Reviewed By: shergin Differential Revision: D21182990 fbshipit-source-id: de8501ea0b97012cf4cdf8d5f658649139f92da6 * Remove setMostRecentEventCount from TextInput view commands Summary: Changelog: [Internal] We don't use view command `setMostRecentEventCount`, let's get rid of it. Reviewed By: JoshuaGross Differential Revision: D21016600 fbshipit-source-id: 6491c063e9d6a89252300cb47c010b248e473f4b * Restore Previous Behavior for StyleSheet Validation of Null/Undefined Styles (#29171) Summary: https://github.com/facebook/react-native/issues/27264 changed stylesheet validation to avoid enumerating properties on the prototype of a style. It introduces a secondary behavior change, where null/undefined styles used to be tolerated but now lead to an exception. This is because `for in undefined` will noop where `for of Object.keys(undefined)` will throw. This scenario of undefined/null styles seems to actually show up in practice and was previously well tolerated. E.g. `Button.js` has code that looks like this: ```jsx const styles = StyleSheet.create({ button: Platform.select({ ios: {}, android: { elevation: 4, // Material design blue from https://material.google.com/style/color.html#color-color-palette backgroundColor: '#2196F3', borderRadius: 2, }, }), ``` For non ios/Android platforms, that creates a style object which looks like: ```js { button: undefined, ... } ``` This previously meant that the component would be unstyled if created, but now means out-of-tree platforms throw if the builtin Button component is required. This change restores the previous `for in` loop but adds a `hasOwnProperty` check to avoid properties on prototypes. ## Changelog [General] [Fixed] - Restore Previous Behavior for StyleSheet Validation of Null/Undefined Styles Pull Request resolved: https://github.com/facebook/react-native/pull/29171 Test Plan: Validated that importing Buttons will no longer cause an exception, and that invalid properties are still caught. Reviewed By: JoshuaGross Differential Revision: D22118379 Pulled By: TheSavior fbshipit-source-id: 650c64b934ccd12a3dc1b75e95debc359925ad73 * Set windowTranslucentNavigation to false (#29399) Summary: This fixes https://github.com/facebook/react-native/issues/29397. Without this, apps that specify `android:windowTranslucentNavigation` draw the `LogBox` buttons underneath the soft navigation bar, making the buttons unpressable. Before | After :-------------------------:|:-------------------------: <img src="http://ashoat.com/AndroidTranslucentNavigationLogBox.png" width="300" /> | <img src="http://ashoat.com/AndroidTranslucentNavigationLogBoxFixed.png" width="300" /> ## Changelog [Android] [Fixed] - Set LogBox windowTranslucentNavigation to false Pull Request resolved: https://github.com/facebook/react-native/pull/29399 Test Plan: I tested this change on the [repo](https://github.com/Ashoat/LogBoxTest) I set up to reproduce the issue. I set it up to [build `ReactAndroid` from source](https://github.com/Ashoat/LogBoxTest/commit/3a2cdab8777ac381cd3be5a84a5bf3250751ac11) and then edited `node_modules/react-native/ReactAndroid/src/main/res/devsupport/values/styles.xml` directly. Reviewed By: rickhanlonii Differential Revision: D22602970 Pulled By: mdvacca fbshipit-source-id: 8c2adc149aa0157825075022f00bb695956d3121 * Fix image cannot show in iOS 14 (#29420) Summary: This PR is to fix https://github.com/facebook/react-native/issues/29279, which image cannot show in iOS 14 As https://github.com/facebook/react-native/issues/29279#issuecomment-658244428 mention, this issue can be fixed by calling ` [super displayLayer:layer];` it it is still image, to let `UIImageView` handle still image rendering ## Changelog [iOS] [Fixed] - Fix image cannot show in iOS 14 Pull Request resolved: https://github.com/facebook/react-native/pull/29420 Test Plan: Image can be shown in iOS 14 build with Xcode 12 beta, using ```js <Image source={require('./images/some_local_image.jpg')}/> ``` It may also need to test gif image is render correctly ```js <Image source={{uri: 'https://some_remote_gif_image.gif'}}/> ``` Reviewed By: p-sun Differential Revision: D22619448 Pulled By: shergin fbshipit-source-id: f4d0ad83af945a6b8099d4eaea5a5f1933c7bfd2 * [0.63.2] Bump version numbers * botched merge changes 1 * more hermes changes needed from upstream, botched merge? * [RCTPicker] Guard UIKit only API on macOS * [RCTSegmentedControl] Make UIKit agnostic * [RCTDisplayWeakRefreshable] Make platform agnostic * [RCTImageLoader] Make platform agnostic * [RCTDevLoadingView] Make platform agnostic * botched merge changes 2 * [RCTPushNotificationManager] Guard for macOS * v0.63 TODO * [RCTBaseTextInputViewManager] Make platform agnostic * [RCTBaseTextInputView] Make platform agnostic * [RNTester-macOS] Fix * [RCT-Folly] Fix build * [PlatformColorValueTypes] Add macOS shim * [package] Update CLI to no longer require config This makes a previous change more explicit: https://github.com/microsoft/react-native-macos/pull/602 * Fix iOS build failures. * Get RNTester to launch * [CODEOWNERS] Add myself * [flow] Remove deprecated rule in newer Flow https://github.com/facebook/flow/commit/759970c1b6dc0a25171d9969e34eaf5dae70f130 * [flow] Get iOS checks green * [PlatformColor] Duplicate iOS code for macOS This is a naive version of this change, there should likely be some code sharing happening between iOS and macOS. * [test] Make green with macOS fork changes * [test] Get macOS test bundle to build * [Color] Rename alternating colors to match to assumptions * [PlatformExample] Fix examples on macOS * [transform] Use iOS implementation for macOS * [circle] Fix config * [ci] Update metro config as per upstream * [ci] Ignore metro config in e2e tests * Revert "[ci] Ignore metro config in e2e tests" This reverts commit 25f7006bc9ba76b1e002b721954a823b3d710c5c. * Revert "[ci] Update metro config as per upstream" This reverts commit b47ca570be00394bbd92b349eab02083787301e7. * [ci] Only disable custom metro config in e2e test * [ci] Ignore metro config in e2e tests * [ci] Switch to experimental CocoaPods CDN * Revert "[ci] Switch to experimental CocoaPods CDN" This reverts commit 44a92f7f08397406429672b14930d44b6aa06b5e. * [ci] Skip Android tests in Apple PR on master * [rnm-init] Fix pod reference * [rnm-init] Update minimum iOS deployment target Co-authored-by: Christoph Nakazawa <cpojer@fb.com> Co-authored-by: Sergio Estevao <sergioestevao@gmail.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: Sam Mathias Weggersen <sawegger@microsoft.com> Co-authored-by: Tommy Nguyen <tonguye@microsoft.com> Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Héctor Ramos <hector@hectorramos.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Sebastian Markbage <sema@fb.com> Co-authored-by: generatedunixname89002005287564 <generatedunixname89002005287564@fb.com> Co-authored-by: Eddie Dugan <ejd@fb.com> Co-authored-by: Valentin Shergin <shergin@fb.com> Co-authored-by: Max Ovtsin <maxovtsin@fb.com> Co-authored-by: Alexander Kawrykow <akawry@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Spencer Ahrens <sahrens@fb.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Jack Wang <shoubowang@fb.com> Co-authored-by: Oleg Bogdanov <boguscoder@fb.com> Co-authored-by: Michael Bolin <mbolin@fb.com> Co-authored-by: Dan Abramov <gaearon@fb.com> Co-authored-by: Peter Argany <petetheheat@fb.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: George Zahariev <gkz@fb.com> Co-authored-by: Jason Safaiyeh <safaiyeh@protonmail.com> Co-authored-by: Pedro Barbiero <pedrobarbiero@gmail.com> Co-authored-by: Brian Vaughn <bvaughn@fb.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Martin Sherburn <mns@fb.com> Co-authored-by: Tom Underhill <tomun@microsoft.com> Co-authored-by: Ventsislav Dimitrov <4097884+vdmtrv@users.noreply.github.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: Lucas Bento <lucas.bsilva@outlook.com> Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com> Co-authored-by: Vojtech Novak <vonovak@gmail.com> Co-authored-by: Emilis Baliukonis <emilisb@wix.com> Co-authored-by: Jacob Bower <jbower@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: Marc Horowitz <mhorowitz@fb.com> Co-authored-by: Sidharth Guglani <sidharthguglani@fb.com> Co-authored-by: Andrew Coates (REDMOND) <acoates@microsoft.com> Co-authored-by: maciej simka <mcj.simka@gmail.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Pavlos Vinieratos <pvinis@gmail.com> Co-authored-by: Cristiano Santos <cristianomnsantos@gmail.com> Co-authored-by: Daniel Cohen Gindi <Danielgindi@gmail.com> Co-authored-by: Eli White <eliwhite@fb.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: jiggag <jiggag90@gmail.com> Co-authored-by: Emily Janzer <janzer@fb.com> Co-authored-by: Kacper Wiszczuk <kacperwiszczuk@gmail.com> Co-authored-by: Xiaoyu Yin <xyin@fb.com> Co-authored-by: Javier Cuevas <javi@diacode.com> Co-authored-by: Bruno Barbieri <brunobar79@gmail.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Will Holen <willholen@fb.com> Co-authored-by: Pritesh Nandgaonkar <prit91@fb.com> Co-authored-by: sunnylqm <sunnylqm@qq.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Tim Yung <yungsters@fb.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: Devon Deonarine <hello@devondeonarine.ca> Co-authored-by: Radek Czemerys <radko93@gmail.com> Co-authored-by: Hein Rutjes <IjzerenHein@users.noreply.github.com> Co-authored-by: zhongwuzw <zhongwuzw@qq.com> Co-authored-by: Jonny Burger <jonathanburger11@gmail.com> Co-authored-by: Ryan Tremblay <ryan.tremblay@microsoft.com> Co-authored-by: almouro <contact@almouro.com> Co-authored-by: Rick Hanlon <rickhanlonii@gmail.com> Co-authored-by: Matthieu Harlé <bonjour@matthieuharle.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Ashoat Tevosyan <ashoat@gmail.com> Co-authored-by: Tom Cheung <cheungch@gmail.com>
2020-09-30 19:38:06 +03:00
get Pressable(): Pressable {
return require('./Libraries/Components/Pressable/Pressable').default;
},
// $FlowFixMe[value-as-type]
get ProgressBarAndroid(): ProgressBarAndroid {
warnOnce(
'progress-bar-android-moved',
'ProgressBarAndroid has been extracted from react-native core and will be removed in a future release. ' +
"It can now be installed and imported from '@react-native-community/progress-bar-android' instead of 'react-native'. " +
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
'See https://github.com/react-native-progress-view/progress-bar-android',
);
return require('./Libraries/Components/ProgressBarAndroid/ProgressBarAndroid');
},
// $FlowFixMe[value-as-type]
get ProgressViewIOS(): ProgressViewIOS {
warnOnce(
'progress-view-ios-moved',
'ProgressViewIOS has been extracted from react-native core and will be removed in a future release. ' +
"It can now be installed and imported from '@react-native-community/progress-view' instead of 'react-native'. " +
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
'See https://github.com/react-native-progress-view/progress-view',
);
return require('./Libraries/Components/ProgressViewIOS/ProgressViewIOS');
},
get RefreshControl(): RefreshControl {
return require('./Libraries/Components/RefreshControl/RefreshControl');
},
get SafeAreaView(): SafeAreaView {
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
return require('./Libraries/Components/SafeAreaView/SafeAreaView').default;
},
get ScrollView(): ScrollView {
return require('./Libraries/Components/ScrollView/ScrollView');
},
get SectionList(): SectionList {
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
return require('./Libraries/Lists/SectionList').default;
},
// $FlowFixMe[value-as-type]
get SegmentedControlIOS(): SegmentedControlIOS {
warnOnce(
'segmented-control-ios-moved',
'SegmentedControlIOS has been extracted from react-native core and will be removed in a future release. ' +
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
"It can now be installed and imported from '@react-native-segmented-control/segmented-control' instead of 'react-native'. " +
'See https://github.com/react-native-segmented-control/segmented-control',
);
return require('./Libraries/Components/SegmentedControlIOS/SegmentedControlIOS');
},
get Slider(): Slider {
warnOnce(
'slider-moved',
'Slider has been extracted from react-native core and will be removed in a future release. ' +
"It can now be installed and imported from '@react-native-community/slider' instead of 'react-native'. " +
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
'See https://github.com/callstack/react-native-slider',
);
return require('./Libraries/Components/Slider/Slider');
},
get StatusBar(): StatusBar {
return require('./Libraries/Components/StatusBar/StatusBar');
},
get Switch(): Switch {
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
return require('./Libraries/Components/Switch/Switch').default;
},
get Text(): Text {
return require('./Libraries/Text/Text');
},
get TextInput(): TextInput {
return require('./Libraries/Components/TextInput/TextInput');
},
get Touchable(): Touchable {
return require('./Libraries/Components/Touchable/Touchable');
},
get TouchableHighlight(): TouchableHighlight {
return require('./Libraries/Components/Touchable/TouchableHighlight');
},
get TouchableNativeFeedback(): TouchableNativeFeedback {
return require('./Libraries/Components/Touchable/TouchableNativeFeedback');
},
get TouchableOpacity(): TouchableOpacity {
return require('./Libraries/Components/Touchable/TouchableOpacity');
},
get TouchableWithoutFeedback(): TouchableWithoutFeedback {
return require('./Libraries/Components/Touchable/TouchableWithoutFeedback');
},
get View(): View {
return require('./Libraries/Components/View/View');
},
get VirtualizedList(): VirtualizedList {
return require('./Libraries/Lists/VirtualizedList');
},
get VirtualizedSectionList(): VirtualizedSectionList {
return require('./Libraries/Lists/VirtualizedSectionList');
},
// APIs
get ActionSheetIOS(): ActionSheetIOS {
return require('./Libraries/ActionSheetIOS/ActionSheetIOS');
},
get Alert(): Alert {
return require('./Libraries/Alert/Alert');
},
// [TODO(macOS GH#774)
get AlertMacOS(): AlertMacOS {
warnOnce(
'AlertMacOS-deprecated',
'AlertMacOS has been deprecated and will be removed in a future release. ' +
'Use Alert instead. ' +
'See https://github.com/microsoft/react-native-macos/issues/354',
);
return require('./Libraries/Alert/AlertMacOS');
}, // ]TODO(macOS GH#774)
get Animated(): Animated {
return require('./Libraries/Animated/Animated');
},
get Appearance(): Appearance {
return require('./Libraries/Utilities/Appearance');
},
get AppRegistry(): AppRegistry {
return require('./Libraries/ReactNative/AppRegistry');
},
get AppState(): AppState {
return require('./Libraries/AppState/AppState');
},
// $FlowFixMe[value-as-type]
get AsyncStorage(): AsyncStorage {
warnOnce(
'async-storage-moved',
'AsyncStorage has been extracted from react-native core and will be removed in a future release. ' +
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
"It can now be installed and imported from '@react-native-async-storage/async-storage' instead of 'react-native'. " +
'See https://github.com/react-native-async-storage/async-storage',
);
return require('./Libraries/Storage/AsyncStorage');
},
get BackHandler(): BackHandler {
return require('./Libraries/Utilities/BackHandler');
},
get Clipboard(): Clipboard {
warnOnce(
'clipboard-moved',
'Clipboard has been extracted from react-native core and will be removed in a future release. ' +
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
"It can now be installed and imported from '@react-native-clipboard/clipboard' instead of 'react-native'. " +
'See https://github.com/react-native-clipboard/clipboard',
);
return require('./Libraries/Components/Clipboard/Clipboard');
},
get DeviceInfo(): DeviceInfo {
return require('./Libraries/Utilities/DeviceInfo');
},
get DevSettings(): DevSettings {
return require('./Libraries/Utilities/DevSettings');
},
get Dimensions(): Dimensions {
return require('./Libraries/Utilities/Dimensions');
},
get Easing(): Easing {
return require('./Libraries/Animated/Easing');
},
get findNodeHandle(): $PropertyType<ReactNative, 'findNodeHandle'> {
return require('./Libraries/Renderer/shims/ReactNative').findNodeHandle;
},
get I18nManager(): I18nManager {
return require('./Libraries/ReactNative/I18nManager');
},
get ImagePickerIOS(): ImagePickerIOS {
warnOnce(
'imagePickerIOS-moved',
'ImagePickerIOS has been extracted from react-native core and will be removed in a future release. ' +
"Please upgrade to use either '@react-native-community/react-native-image-picker' or 'expo-image-picker'. " +
"If you cannot upgrade to a different library, please install the deprecated '@react-native-community/image-picker-ios' package. " +
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
'See https://github.com/rnc-archive/react-native-image-picker-ios',
);
return require('./Libraries/Image/ImagePickerIOS');
},
get InteractionManager(): InteractionManager {
return require('./Libraries/Interaction/InteractionManager');
},
get Keyboard(): Keyboard {
return require('./Libraries/Components/Keyboard/Keyboard');
},
get LayoutAnimation(): LayoutAnimation {
return require('./Libraries/LayoutAnimation/LayoutAnimation');
},
get Linking(): Linking {
return require('./Libraries/Linking/Linking');
},
v0.63 sync from upstream (#613) * Upgrade to Metro 0.59 Summary: Upgrades RN to Metro 0.59. Changelog: [Internal] Metro Upgrade Reviewed By: motiz88 Differential Revision: D20533864 fbshipit-source-id: 3c5fb8e37d2363edf0b9a1a8cfbdefba00763415 * Fix mock for TextInput (#28332) Summary: This PR adds the `isFocused` method to the mock of the TextInput component. My understanding some of the latest changes on the TextInput to make it use a forwardRef change the way this method is mock giving an error when trying to use in on a mock. The change suggested here fixes the issue. ## Changelog [JavaScript] [Fixed] - Fix the mock for TextInput to support the `isFocused` method Pull Request resolved: https://github.com/facebook/react-native/pull/28332 Reviewed By: cpojer Differential Revision: D20538044 Pulled By: TheSavior fbshipit-source-id: be734af105ab62ffdf9ed4017bd70845e207f8cd * Properly handle LogBox errors during tests Summary: This diff fixes an issue where errors in LogBox during tests would cause the tests to crash. The crash is due to the NativeExceptionsManager module not being mocked (as all native module need to be in tests). The fix is to properly mock the NativeExceptionManger. This fix exposed an infinite loop issue where failures in LogBox will be logged to the ExceptionManager, which logs to the console, which logs to LogBox, creating a loop. This diff also fixes that look by moving the LogBox internal error check to the top of the monkey patched console methods. Changelog: [Internal] Differential Revision: D20428590 fbshipit-source-id: 7289a480c99ba8dee67772178b7629afb40b330a * Back out "Track animations and flush them" Summary: Original commit changeset: b594d0e6e9b6 D20319824 introduced a problem in LayoutAnimations, which makes surfaced as the problem in T63911344. This diff reverts D20319824. Changelog: [Internal] Reviewed By: lunaleaps Differential Revision: D20541918 fbshipit-source-id: ff72b839f57d39051122920a38b2632cbb5ec362 * Consolidate "dispatchMountItems" reentrancy prevention code, and retry code, in one function Summary: Simplifying the dispatchMountItems reentrance and retry logic. Motivation: cleanup so I can work on dispatching ViewCommands before anything else. Importantly, this gives us the properties that: 1) Only one function is responsible for calling dispatchMountItems 2) Only one function is responsible for deciding if we shouldn't call dispatchMountItems due to reentrance 3) Only one function is responsible for all cleanup 4) Only one function maintains all of the relevant flags (except dispatchPreMountItems... two total now, instead of 4 before) Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20437035 fbshipit-source-id: 5370366790eb25f653bee6c1950e747458374a61 * Only retry ViewCommand mount items if exception is marked as "Retryable" Summary: Instead of just blindly retrying all ViewCommands if they fail - which could be dangerous, since it's arbitrary imperative commands we'd be executing twice, potentially with bad app state - we only retry if the ViewCommand throws a "RetryableMountingLayerException". Changelog: [Internal] Optimization to ViewCommands Reviewed By: mdvacca Differential Revision: D20529985 fbshipit-source-id: 0217b43f4bf92442bcc7ca48c8ae2b9a9e543dc9 * Introduce early dispatch of ViewCommands in FabricUIManager Summary: Earlier this week I introduced a change in the old, non-Fabric renderer (D20378633 D20427803) that (gated behind a feature-flag) executes ViewCommands before all other types of commands, as a perf optimization and (I think) a potential fix for a category of race conditions. I've added more details in comments here. The Fabric renderer uses the same feature-flag that I introduced for the non-Fabric renderer. Changelog: [Internal] Fabric Reviewed By: mdvacca Differential Revision: D20449186 fbshipit-source-id: bb3649f565f32c417a6247369902333989a043aa * Change nightly build from hourly to nightly (daily at 00:00) (#28346) Summary: We initially added the nightly build test to run every hour, in order to more quickly validate it. Now that it has been validated we can run it every night as it is intended to do. cc hramos ## Changelog [General] [Changed] - Change nightly build from hourly to nightly Pull Request resolved: https://github.com/facebook/react-native/pull/28346 Reviewed By: cpojer Differential Revision: D20550143 Pulled By: hramos fbshipit-source-id: 9487c6785684ad6ea7e877290d50a33118090a7f * Add diffing to app bundle size reports (#28284) Summary: Add diffing to app bundle size reports. ## Changelog [Internal] [Changed] - Add diffing to app bundle size reports Pull Request resolved: https://github.com/facebook/react-native/pull/28284 Test Plan: - App bundle size reports should now display a diff where available - Right now, the database contains only one entry for the last known good iOS build - Triggering a new build should not create additional comments Reviewed By: cpojer Differential Revision: D20450158 Pulled By: hramos fbshipit-source-id: 720772275f24d3ff0a49705f4dada2efe2e99bd3 * feat: improve monorepo support by removing redundant PROJECT_ROOT (#28354) Summary: Historically, React Native didn't support a lot of custom project structures apart from the standard flat directory with `ios` and `android` folders. The CLI had to be explicitly started from the project root, otherwise Metro didn't work right. In order to resolve the project root in the most accurate way, React Native assumed that project root is always `../../` from its location in `node_modules` - this is not true when the installation gets hoisted (e.g. in a monorepo). To address that, janicduplessis brought support for custom [`PROJECT_ROOT`](https://github.com/facebook/react-native/commit/9ccde378b6e6379df61f9d968be6346ca6be7ead) that allowed overriding the `../../` in case it wasn't true. Today, CLI is able to automatically resolve the project root, no matter where it's started. It will traverse the tree of the directories upwards and stop as soon as it meets `package.json`. As a result, it doesn't really matter from where we start the CLI anymore as a part of `react-native-xcode.sh`. By replacing the default value of `$REACT_NATIVE_DIR/../../` with `$PWD, that is default for all Xcode scripts, we can make the setup for monorepo easier - nobody will need to set `$PROJECT_ROOT` in order to override the incorrect defaults. By default, all scripts defined in Xcode run from `$PWD` directory, which is the location of the iOS project. In the future, we will be able to remove `cd` entirely. To better understand this PR, let's look a few hypothetical structures as an example: #### Monorepo: > tl;dr works out of the box, no need to mess around with paths ``` - package.json - packages/ - my-app/ - index.js - package.json - ios/ - MyApp.xcodeproj ``` **Before this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $REACT_NATIVE_DIR/../../ node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - Because we change the directory to the root of monorepo, CLI throws an error. All in all, there's no `react-native` dependency at the workspace root. - Some users turn `no hoist` in an act of troubleshooting the errors, which resolves the problem - `react-native` is moved under `my-app/node_modules` which makes this mechanism resolve properly. - Some users find out about `PROJECT_ROOT` and set it to overwrite the default value. For example, setting `export PROJECT_ROOT = "$PWD/../` will set the directory to `my-app`, which has a dependency on `react-native` in a `package.json` and makes the CLI happy. **After this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $PWD node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - The `$PWD` is `packages/my-app/ios/` because that's where the Xcode project is located. CLI will automatically set the root to `../` because that's where it finds `package.json` with `react-native` dependency. It will pass that root to Metro, unless users have set a different one themselves. Thanks to that, all paths to JavaScript files remain working and unaffected. - No need to set `PROJECT_ROOT` anymore. - We don't rely on the location of `node_modules`, which is cleaner and future proof. #### Standard: > tl;dr no changes ``` - ios/ - MyApp.xcodeproj - index.js - package.json ``` **Before this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $REACT_NATIVE_DIR/../../ node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - Everything works fine. Path from `react-native` inside `node_modules` is correct - the project root is set right to `/` **After this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $PWD node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - The root will be set to where Xcode project is located, which is `/ios`. This is the PWD for all Xcode scripts. CLI will look for the `package.json` going upwards from `ios` folder. Will stop at `/`, find out it has `react-native` dependency, load it and its commands and proceed further. ## Changelog [iOS] [Feature] - Better monorepo support when building release apk Pull Request resolved: https://github.com/facebook/react-native/pull/28354 Test Plan: - All projects (standard/monorepo) run without issues. - PROJECT_ROOT is not needed. CC: Titozzz (who wrote monorepo guide), alloy, bartolkaruza Reviewed By: cpojer Differential Revision: D20558005 Pulled By: hramos fbshipit-source-id: 2551120beadcfd4c2f1393ce8a2c2fa6b93c9290 * Fix `test_android`: Remove references to fbsource cell (#28363) Summary: Fixes https://github.com/facebook/react-native/issues/28361. ## Changelog [Internal] [CI] - Fix test_android Pull Request resolved: https://github.com/facebook/react-native/pull/28363 Test Plan: Prior to fix: ``` react-native $ ./scripts/circleci/buck_fetch.sh Guessing 168a69309928ba16065cdb33b1775a4af9f924a6 as the last one used version. Using additional configuration options from /Users/hramos/.buckconfig.d/experiments, /etc/buckconfig.d/fb_chef.ini, /etc/buckconfig.d/fb_chef_override.ini Invalidating internal cached state: Watchman failed to start. This may cause slower builds. Parsing buck files: finished in 1.5 sec Buck wasn't able to parse /Users/hramos/git/react-native/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK: IOError: [Errno 2] No such file or directory: '/Users/hramos/git/react-native/tools/build_defs/platform_defs.bzl' Call stack: File "/Users/hramos/git/react-native/.buckd/resources/168a69309928ba16065cdb33b1775a4af9f924a6/buck_server/buck_parser/profiler.py", line 507, in wrapped return func(*args, **kwargs) File "/Users/hramos/git/react-native/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK", line 1 load("//tools/build_defs:platform_defs.bzl", "ANDROID") File "/Users/hramos/git/react-native/.buckd/resources/168a69309928ba16065cdb33b1775a4af9f924a6/buck_server/buck_parser/profiler.py", line 507, in wrapped return func(*args, **kwargs) This error happened while trying to get dependency '//ReactAndroid/src/main/java/com/facebook/fbreact/specs:FBReactNativeSpec' of target '//ReactAndroid/src/main/java/com/facebook/react/devsupport:devsupport' ``` After fix: ``` react-native $ ./scripts/circleci/buck_fetch.sh + buck fetch ReactAndroid/src/test/java/com/facebook/react/modules Guessing 168a69309928ba16065cdb33b1775a4af9f924a6 as the last one used version. Using additional configuration options from /Users/hramos/.buckconfig.d/experiments, /etc/buckconfig.d/fb_chef.ini, /etc/buckconfig.d/fb_chef_override.ini Invalidating internal cached state: Watchman failed to start. This may cause slower builds. Parsing buck files: finished in 1.1 sec Configuration 'ANDROID_SDK' points to an invalid directory '/opt/android_sdk'. When creating rule //ReactAndroid/src/main/java/com/facebook/hermes/instrumentation:instrumentation. ``` > Note: I don't have the Android SDK configured in this machine. Verified on Circle CI. `test_android` is now green: https://circleci.com/gh/facebook/react-native/140682?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link Reviewed By: cpojer Differential Revision: D20564934 Pulled By: hramos fbshipit-source-id: 5d843b8f113c4db5391ee39addc3ff259d962290 * Fix TextInput left/right padding Summary: This fixes two things: 1) Currently it only respects Start and End padding, and if there's a Theme default, it will override Left/Right padding. Whoops. 2) Currently it doesn't respect when a TextInput starts with padding, but then is removed. This resolves both. It still does not account for RTL support. Changelog: [Internal] Fix AndroidTextInput padding Reviewed By: mdvacca Differential Revision: D20573151 fbshipit-source-id: e89791641b6699e728cde9dbd661a8c21485fbc8 * Validate selection range passed to setTextAndSelection Summary: Changelog: [Internal] # Fabric 1. If `start` and `end` parameters in `setTextAndSelection` are -1, we don't move the cursor. Previously the cursor would be moved to beginning of text input. 2. In view commands, do not validate `eventCount`. It is passed in as undefined from JS because Fabric's text input doesn't use `eventCount`. # Paper 1. If `start` and `end` parameters in `setTextAndSelection` are -1, we don't move the cursor. Previously the cursor would be moved to beginning of text input. Reviewed By: shergin Differential Revision: D20538290 fbshipit-source-id: c7aeddc25f58697254474058ce901df958321f7c * Remove ReactTypes from fbsource and React sync Summary: See https://github.com/facebook/react/pull/18366 This contains a fork of the upstream Flow types. We shouldn't be syncing this since these leads to conflicting types. As a result, these uses have already been codemodded away. Only the imports remained. Changelog: [React Core] - Remove ReactTypes from sync. Reviewed By: gaearon Differential Revision: D20583740 fbshipit-source-id: fc86a934cbdca8ff90fe90282b86ecc945a85e5f * Fix controlled TextInput with child nodes Summary: Changelog: [Internal] # There are three changes in this diff ## _stateRevision is replaced with a BOOL `_stateRevision` was protecting against setting attributed string that is already visible to the user. Previously this was ok because the change was only coming from native, any changes from JS were ignored. Imagine following scenario: 1. User taps key. 2. Update state is called on component initiated by native. 3. New state is created with incremented revision by one. 4. `_stateRevision` gets set to new state's revision + 1. 5. Now JS wants to change something because it just learnt that user tapped the key. 6. New state is created again with incremented revision by one. 7. Update state is called on the component, but the change isn't applied to the text view because `_state->getRevision()` will equal `_stateRevision`. By having a BOOL instead of number, we very explicitly mark the region in which we don't want state changes to be applied to text view. ## Calling [_backedTextInputView setAttributedText] move cursor to the end of text input This is prevented by storing what the current selection is and applying it after `[_backedTextInputView setAttributedText]` is called. This was previously invisible because JS wasn't changing contents of `_backedTextInputView`. ## Storing of previously applied JS attributed string in state This is the mechanism used to detect when value of text input changes come from JavaScript. JavaScript sends text input value changes through props and as children of TextInput. We compare what previously was set from JavaScript to what is currently being send from JavaScript and if they differ, this change is communicated to the component. Previously only first attributed string send from JavaScript was send to the component. # Problem If children are used to set text input's value, then there is a case in which we can't tell what source of truth should be. Let's take following example We have a text field that allows only 4 characters, again this is only a problem if those 4 characters come as children, not as value. This is a controller text input. 1. User types 1234. 2. User types 5th character. 3. JavaScript updates TextInput, saying that the content should stay 1234. 4. In `TextInputShadowNode` `hasJSUpdatedAttributedString` will be set to false, because previous JS value is the same as current JS value. Reviewed By: shergin Differential Revision: D20587681 fbshipit-source-id: 1b8a2efabbfa0fc87cba210570142d162efe61e6 * Daily `arc lint --take BUCKFORMAT` Reviewed By: zertosh Differential Revision: D20593906 fbshipit-source-id: b056947c698508119dc9d4d1bba202295b8f0fda * RN picker - implement background color Summary: add support to the android implementation of the Picker component for setting the background color. Changelog: [Android] [Added] - Support item background color in Dialog Picker Differential Revision: D20566131 fbshipit-source-id: d693b40803fa1051ec955c5728994c820fecd9e9 * Fabric: Modernizing Yoga Dirty flag test. Summary: Now we using TEST_F thing that allows consilidating initialization. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D20578788 fbshipit-source-id: 103bcb8fdeb3dbf297385cfe56415bd646e16791 * Fabric: Changing signature of `ComponentDescriptor::createState` Summary: This is pure syntactic change. Often we don't have a shared pointer to ShadowNodeFamily and only have just a reference. At the same time, `ComponentDescriptor::createState` does not have to accept a shared pointer. So, it's better to accept just a reference. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20578787 fbshipit-source-id: 905277001e096d41e75007575b59ea2ea15fbf4b * Fabric: View Test: Changing state should not dirty Yoga tree (in some most cases) Summary: Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D20578789 fbshipit-source-id: 4336165217bd39fc8065cfaeb96ef7753433d48a * Get ReactiveNative compiled with Clang 10 (#28362) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/28362 Fixed a few compilation errors emitted by Clang 10. Changelog: [iOS] [Fixed] - Get ready for Clang 10 Differential Revision: D20549970 fbshipit-source-id: dc36a85d90d3e43a05f045feb57c6ab6ded67da7 * Guard against null values in object parameters for bridged methods Summary: Handles the case when a value in an object parameter of a turbo module spec is null (even if the type is nullable). For example, given: ``` export interface Spec extends TurboModule { +myFunc: ({| foo: ?string, |}) => void; } ``` and calling `NativeModule.myFunc({foo: null})`, we see an error like: ``` JSON value '<null>' of type NSNull cannot be converted to NSString ``` Guarding against this by converting NSNull's to nils ## Changelog: [iOS] [Fixed] - Fix crash when passing null value in object parameter of bridged method Reviewed By: fkgozali Differential Revision: D20591590 fbshipit-source-id: fdb90f34131427a235f2e3c99147bf1e6a9c6732 * Modify pending deletion tags to be cross manageChildren Summary: Changelog: [Internal] Removing historic layout animations index adjustment (D20323928) broke the Dating Secret Crush screen. Since flushing animations (D20319824) had to be reverted due to issues with Saved + Privacy Shortcuts (https://fburl.com/tasks/eijtmifu) we need to track pending deletions across `manageChildren` operations. Reviewed By: JoshuaGross Differential Revision: D20601079 fbshipit-source-id: c6f116683750e97abe7f988cf361d2a6449e90e6 * Enable label-actions on the react-native repository (#28374) Summary: Enhance our issue management workflow by having the bot respond automatically whenever a label is applied to the issue. ## Changelog [Internal] - CI Pull Request resolved: https://github.com/facebook/react-native/pull/28374 Test Plan: Not tested. If needed, could be applied to a different, test repository. Reviewed By: cpojer Differential Revision: D20606887 Pulled By: hramos fbshipit-source-id: 874d1464527ea76bf51394a7d3e98e4fd8f69345 * Fix Animated Value initialized with undefined in ScrollView (#28349) Summary: When passing an object to contentOffset that doesn't have `y` prop set it causes the following error: ``` Error: AnimatedValue: Attempting to set value to undefined This error is located at: in ScrollView (at src/index.js:638) ... ``` This happens since a runtime check was added to the `AnimatedValue` constructor. (a3aaa471eca58b31597b9a0669f7ade385ccb175) According to flow types the object passed to contentOffset should always contain both x and y props but since it worked before when y is undefined I think its fine to patch the runtime behaviour defensively, especially since the code change is simple. ## Changelog [General] [Fixed] - Fix Animated Value initialized with undefined in ScrollView Pull Request resolved: https://github.com/facebook/react-native/pull/28349 Test Plan: Tested that the crash no longer reproduces when passing an empty object to contentOffset. Reviewed By: cpojer Differential Revision: D20601664 Pulled By: hramos fbshipit-source-id: b098a2dd1e702f995a9a92fa6e4e9a204187dac4 * xplat/js/react-native-github/ReactCommon/fabric/components/textinput/ Summary: Changelog: [Internal] Reviewed By: scottrice Differential Revision: D20619227 fbshipit-source-id: 674337e6ce585a4e96d020f9624b874ba86e2d80 * Seed ssh known hosts with github's public key (#28370) Summary: The [previous attempt](https://github.com/facebook/react-native/pull/28304) to fix the publish step failed, so now reverting to manually configuring things. This PR adds an entry to SSH’s `known_hosts` file using github.com’s public key that I have verified as per [these instructions](https://serverfault.com/a/807363): ``` ~/C/R/react-native [master] » nmap github.com --script ssh-hostkey Nmap scan report for github.com (140.82.118.4) rDNS record for 140.82.118.4: lb-140-82-118-4-ams.github.com PORT STATE SERVICE 22/tcp open ssh | ssh-hostkey: | 1024 ad:1c:08:a4:40:e3:6f:9c:f5:66:26:5d:4b:33:5d:8c (DSA) |_ 2048 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48 (RSA) ``` These fingerprints line up with [the ones posted by GitHub](https://help.github.com/en/github/authenticating-to-github/githubs-ssh-key-fingerprints), so my setup should be good and can be trusted to grab the public key from the right host: ``` ~/C/R/react-native [master] » ssh-keyscan -t rsa -H github.com # github.com:22 SSH-2.0-babeld-d48c3acd |1|If6MU203eXTaaWL678YEfWkVMrw=|kqLeIAyTy8pzpj8x8Ae4Fr8Mtlc= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== ``` ## Changelog [Internal] [Fixed] - Make automated publishing of packages from CI work again Pull Request resolved: https://github.com/facebook/react-native/pull/28370 Test Plan: I used the command being added in this PR in [a failed CI job](https://app.circleci.com/pipelines/github/facebook/react-native/4104/workflows/916127cb-177f-4583-9f90-cae5318041d8/jobs/140810). When I invoked the publish script manually I was not greeted by the blocking prompt and the package was successfully published: https://www.npmjs.com/package/react-native/v/0.0.0-56cf99a96 Reviewed By: cpojer Differential Revision: D20601527 Pulled By: hramos fbshipit-source-id: b1a4405228408cfc4a1b3b44ab88c79522af3a66 * Fix app bundle size diff not always being compared against latest commit (#28368) Summary: - Timestamp of entries in our Firebase instance sometimes get stored as number. This means that we may not always be diffing against the latest master commit. - Size report of Android and iOS gets overwritten depending on which build finishes first. ## Changelog [Internal] [Fixed] - App bundle size diff not always being compared against latest commit [Internal] [Fixed] - Android and iOS app bundle size diff overwrite each other Pull Request resolved: https://github.com/facebook/react-native/pull/28368 Test Plan: - We are now using Firebase's own [firebase.firestore.Timestamp.now](https://firebase.google.com/docs/reference/js/firebase.firestore.Timestamp#now) to ensure that we always get a timestamp in the preferred format. This has been tested locally but can only be verified when merged to master and we start getting new data. In the meantime, I'll manually fix up all the entries in the store. - There should be one app bundle size comment for Android and one for iOS in this PR. Reviewed By: cpojer Differential Revision: D20601620 Pulled By: hramos fbshipit-source-id: 0c3e4b78a74cbd659f1957a6aa74322b016e0646 * Hopefully fix so loading crashes Summary: Changelog: [Android][Internal] Fix potential initializer interruption threading crashes. Reviewed By: mdvacca Differential Revision: D20615755 fbshipit-source-id: 58b706deeb6df1998caff5bf2ae9ec60114313fe * Fix label-actions configuration Summary: Adds back a missing label key, fixes open source issue: https://github.com/facebook/react-native/issues/28378 Changelog: [Internal] [CI] - Fix label-actions config Reviewed By: cpojer Differential Revision: D20625887 fbshipit-source-id: 63c90db249aa9c15369a4b5bcab71cbe75c6d4b8 * Changing Order Of mOverrideColorScheme In Constructor Summary: Changelog: [Android] [Updated] mOverrideColorScheme should be assigned before the first colorSchemeForCurrentConfiguration call, so the initial setting of mColorScheme will reflect the override Reviewed By: zackargyle Differential Revision: D20630173 fbshipit-source-id: a2a2d174d3fc40c14f27dce6a7fa8e67203480c9 * hermes | inspector | Don't include posix headers on non-posix systems Summary: Changelog: [Internal] Hermes inspector includes pthreads, arpa and sys headers on all OSes that would break vanilla Windows builds. This diff adds a check for posix-compliance before inclusion (Note: this ignores all push blocking failures!) Reviewed By: dulinriley Differential Revision: D20564449 fbshipit-source-id: 8e264bc3104065dc4315bb291e8560609fe65184 * Upgrade Prettier from 1.17 to 2.0.2. Summary: This gets us on the latest Prettier 2.x: https://prettier.io/blog/2020/03/21/2.0.0.html Notably, this adds support for TypeScript 3.8, which introduces new syntax, such as `import type`. Reviewed By: zertosh Differential Revision: D20636268 fbshipit-source-id: fca5833d003804333a05ba16325bbbe0e06d6c8a * Back out "Upgrade Prettier from 1.17 to 2.0.2." Differential Revision: D20639755 fbshipit-source-id: 5028563f9cf0527a30b4259daac50cdc03934bfd * Fabric: Additional temporary checks in prop parsing infra Summary: While ViewConfig infra isn't perfect we need to check some value for correctness during prop-parsing. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D20639055 fbshipit-source-id: 193dcd0769bc7777bc8d60c964ede72ebdaa83e4 * Update React package Summary: This just updates the `react` package to the latest stable version. We updated it to experimental internally earlier so this brings the open source version to the latest before the branch cut. This doesn't include any breaking changes. Changelog: [General][Changed] - Update to React 16.13.1 Reviewed By: cpojer Differential Revision: D20642909 fbshipit-source-id: 68a4c74bfe72f1abdb33b0b9071a4f4e8e568318 * Fix sketchy null checks induced by new formatting in Prettier 2.0 Summary: Update code to prepare for Prettier 2.0, which will reformat `a || (b || c)` to `a || b || c`. Changelog: [Internal] prepare for Prettier 2.0 Reviewed By: kassens Differential Revision: D20639483 fbshipit-source-id: c2932b1495884684172ba9291d56c546f51711b8 * RN picker - fix types in AndroidDialogPickerManagerInterface Summary: according to [this crash report](https://our.intern.facebook.com/intern/logview/details/facebook_android_crashes/7ba7056481015482c6166d65cb97e49d/?trace_key=1506fe36a70dd5e50cdc8968f6317f27), `value` was throwing an NPE despite being null-checked. this is because it was an `int` rather than an `Integer`, so the null check wasn't working Changelog: Fix types in AndroidDialogPickerManagerInterface Reviewed By: mdvacca Differential Revision: D20646343 fbshipit-source-id: a27587e0a48f5782bcf5ffddb604018218e65206 * Remove RCTExportModule log spam Summary: The bridge complains if modules aren't exported, which isn't really helpful with lazily loaded modules and turbo modules. I considered only turning this off when TurboModules is enabled, but figured we'd be killing this soon anyways... If anyone feels strongly I can go that approach. Changelog: [iOS][Internal] Remove RCTExportModule log spam Reviewed By: shergin Differential Revision: D20629575 fbshipit-source-id: d32d9fe244c4d06acfee982fca7c7f63da294dc5 * De-jank DevLoadingView Summary: ## Problems Repro steps: 1. Disable Fabric (because CMD + R doesn't work with Fabric right now). 2. Open up Marketplace and hit `CMD + OPT + R` 3. **Observe:** The progress bar doesn't show up right away. It also doesn't actually show progress. https://pxl.cl/140g1 RN Support post: https://fb.workplace.com/groups/rn.support/permalink/3437652016283389/ ## Fixes The first problem is that progress bar doesn't actually show progress. **Fix:** Bundle load progress is updated in `RCTCxxBridge`, where we first require `RCTDevLoadingView`, and then call its `updateProgress` method. Previously, we wouldn't lazily load `RCTDevLoadingView`, it already didn't exist. Lazily loading `RCTDevLoadingView` causes the progress view to show up. Here: https://pxl.cl/140gt If you look at the above video, you'll notice there are two stages to the progress bar: stage 1 displays the actual progress. Stage 2 prompts that we're downloading the JS bundle. As you can see, stage 1 and stage 2 have different background colors, even though both of them are green. **Fix:** I adjusted the JS to match the Native color. Here: https://pxl.cl/140gT We're almost there, but the progress bar is dismissed twice? **Fix:** I dug into the code, and the reason why was because when we hit `CMD + R`, we invalidate the bridge, and immediately re-initialize it. This means that we asynchronously invalidate the old TurboModuleManager, and immediately create a brand new one. Therefore, two `RCTDevLoadingView` modules can (and do) exist at once. So, I moved `RCTDevLoadingView` to be an instance member of `FBReactModule`, to ensure that it doesn't get cleaned up and re-created when TurboModuleManager is deleted and re-created. This finally fixed the progress bar jank: https://pxl.cl/140hn Changelog: [iOS][Fixed] - Remove RCTDevLoadingView jank Reviewed By: rickhanlonii Differential Revision: D20607815 fbshipit-source-id: 05825c67adaf3cfda70be0fa2dc92d413dc8921b * Fix retaining self in block in LogBox impl Summary: Logbox has a retain cycle (see linked task for my deeper investigation). This diff doesn't fix the retain cycle, but it's just good practice to not retain self strongly in blocks. Changelog: [iOS][Internal] Fix retaining self in block in LogBox implementation Reviewed By: shergin Differential Revision: D20630693 fbshipit-source-id: cf399495e9bcd1917932fcc0e9c9d2d2a32bf6f0 * Flow type infoLog Summary: Changelog: [General][Internal] flow type infoLog Reviewed By: zackargyle Differential Revision: D20577939 fbshipit-source-id: eed4401b2ae0a6bf845fdcb54c6abe1fe98fe7c1 * Replace fbsource// with // in xplat/js/ files [1] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: scottrice Differential Revision: D20495655 fbshipit-source-id: a57b72f694c533e2e16dffe74eccb8fdec1f55f5 * Deploy Flow 0.121 to Xplat (#901) Summary: Deploy Flow 0.121 to Xplat bypass-lint allow-large-files Closes https://github.com/facebook/flipper/pull/901 Changelog: [Internal] Reviewed By: panagosg7 Differential Revision: D20570316 fbshipit-source-id: a76983d6f46c8b995ce2dd5cd1e014534790698a * Replace fbsource// with // in xplat/js/ files [3] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D20656211 fbshipit-source-id: deb91b917d349bc500acbb03d734ff621f6e1fc7 * Replace fbsource// with // in xplat/js/ files [4] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: JoshuaGross, shergin Differential Revision: D20656696 fbshipit-source-id: 10f02decb1dc969fd3491ac90d97f09e2bda59e7 * Add Needs: Repro bot action (#28397) Summary: Add automated response for Needs: Repro ## Changelog [Internal] [Added] - Add automated response for Needs: Repro Pull Request resolved: https://github.com/facebook/react-native/pull/28397 Test Plan: Bot should add a comment with the Needs: Repro label. Reviewed By: cpojer Differential Revision: D20665378 Pulled By: hramos fbshipit-source-id: 1c7d878faacf935a640849f74c81f119e5c7e92d * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D20666684 fbshipit-source-id: 32255ac7509e0257693969a7b4b044569af30df7 * ✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392) Summary: Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`. Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job. What was done in this PR: * The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use. * The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument. * The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument * The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument ## Changelog [Internal] [CI] - ✅ Green CI, disabled test infrastructure work Pull Request resolved: https://github.com/facebook/react-native/pull/28392 Test Plan: Verified on Circle CI Reviewed By: cpojer Differential Revision: D20665512 Pulled By: hramos fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726 * Upgrade internal packages to support ESLint >= 6 (#28393) Summary: Fixes https://github.com/facebook/react-native/issues/28293 I've tested it with https://github.com/react-native-community/react-native-template-typescript and it seems to be working as expected - no warnings, supports typescript 3.8. (note: I didn't upgrade the package version as I don't know how the releases work for this package) ## Changelog [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/28393 Reviewed By: hramos Differential Revision: D20647112 Pulled By: cpojer fbshipit-source-id: ca6b67971f625dc8125a58f9220dfcd86250ba94 * Fabric: Fixing a deadlock in RCTSurfacePresenter Summary: This is another attempt to fix an issue very similar to T59424871. The previous attempt was in D19249490. I don't know why we don't see production crashes (stalls) but it happened to me (and not to me) in the debugger. The previous attempt didn't work because we still could have a deadlock because we tried to acquired shared mutex already owned exclusively by the `suspend` method. Here is another approach: Instead of using one shared mutex, now we use two. One is similar to what we had and another that protects `suspend` and `resume`. Besides that, now we pass a Scheduler to functions that use that explicitly. This way we can be more explicit about acquiring mutexes and the overall flow of execution. The idea is: Now an arbitrary code that can be reentrant does not cover with mutexes, so the deadlock is not possible. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20639228 fbshipit-source-id: 98515742f00f2ae94b50b585c9f1f0611e169ebe * Update React Hooks Plugin Summary: Updates `eslint-plugin-react-hooks` to 3.0.0. This introduces a new lint error when you use a Hook inside a class. Changelog: [General][Changed] - Updated the React Hooks ESLint Plugin Reviewed By: cpojer Differential Revision: D20675528 fbshipit-source-id: d0cbe9748fd15df7a4c6de00bd1462610e0a43d6 * Upgrade React DevTools 4.0.6 -> 4.6.0 Summary: Upgrading the embedded version of React DevTools, primarily to pull in [this PR](https://github.com/facebook/react/pull/18397) which will reduce the impact of this package on `node_modules` size. # Update process Following a similar process as D15973709, I began by searching for [all of the references](https://our.intern.facebook.com/intern/biggrep/?corpus=xplat&filename=.json&case=false&view=default&extre=&s=%22react-devtools&engine=apr_strmatch&context=false&filter[uninteresting]=false&filter[intern]=false&filter[test]=false&grep_regex=) to the `react-devtools-core` package and updated all v4 usage to to point to the new 4.6.0 release: 1: Manually update "react-devtools-core" versions: ``` js/package.json js/react-native-github/package.json nuclide/package.json sonar/desktop/app/package.json sonar/desktop/plugins/reactdevtools/package.json vscode/modules/vscode-webview/package.json ``` 2: Setup Yarn proxy: ``` yarn config set proxy http://fwdproxy:8080/ yarn config set https-proxy http://fwdproxy:8080 ``` 3: Run "yarn" in each of the above directories. 4: Run the lockfile shell script: ``` ~/xplat/js/scripts/update-oss-yarn-lockfile.sh ``` 5: Update the generated `MOBILE_JS_NODE_MODULE_DEPS.bzl` by running ``` js1 build buckfiles ``` ## Changelog: [General] [Changed] - Upgrade embedded React DevTools backend from v4.0.6 to v4.6.0. Reviewed By: cpojer, gaearon Differential Revision: D20676091 fbshipit-source-id: 99865bdba9bce45e2a7d582d5fb550cfdbeeca3a * Make ScrollView use ForwardRef Summary: Have ScrollView use forwardRef so that the host component methods like `measure` and `measureLayout` are available without having to call `getNativeScrollRef`. Instead, you can use `<ScrollView ref={myRef} />` and directly call all methods of ScrollView and host components on `myRef`. Previous usage: ``` const myRef = React.createRef<React.ElementRef<typeof ScrollView>>(); <ScrollView ref={myRef} /> const innerViewRef = myRef.current.getNativeScrollRef(); innerViewRef.measure(); ``` New usage: ``` const myRef = React.createRef<React.ElementRef<typeof View>>(); <ScrollView ref={myRef} /> // now, myRef.current can be used directly as the ref myRef.current.measure(); myRef.current.measureLayout(); // Additionally, myRef still has access to ScrollView methods myRef.current.scrollTo(...); ``` Changes: * Added deprecation warnings to ScrollView methods `getNativeScrollRef`, `getScrollableNode`, and `getScrollResponder` * Added the forwardRef call to create `ForwardedScrollView` - this takes in `ref` and passes it into the class ScrollView as `scrollViewRef`. * Forwarded the ref to the native scroll view using `setAndForwardRef`. * Added statics onto `ForwardedScrollView` so that `ScrollView.Context` can still be accessed. * Added type `ScrollViewImperativeMethods`, which lists the public methods of ScrollView. * Converted all public methods of ScrollView to arrow functions. This is because they need to be bound to the forwarded ref. * Bound all public methods of ScrollView to the forwarded ref in the `setAndForwardRef` call. * Flow typed the final output (ForwardedScrollView) as an abstract component that takes in the props of the `ScrollView` class, and has all methods of both the inner host component (`measure`, `measureLayout`, etc) and the public methods (`scrollTo`, etc). Changes to mockScrollView: * Changed mockScrollView to be able to mock the function component instead of a class component * Updated necessary tests Changelog: [General] [Changed] - Make ScrollView use forwardRef Reviewed By: TheSavior Differential Revision: D19304480 fbshipit-source-id: 6c359897526d9d5ac6bc6ab6d5f9d82bfc0d8af4 * Fix issue with onEndReached Summary: onEndReached can be triggered twice when more items are added to the end of the list. This change makes it so that a second call to onEndReached won't happen until the user scrolls down to the new end of the list. Changelog: [General] [Fixed] - Fix double call to onEndReached in VirtualizedList Reviewed By: sahrens Differential Revision: D20066740 fbshipit-source-id: 129d7ae6bfd241eeea18fe0bb12b82be67735874 * Remove console warnings from ScrollView methods Summary: The newly added console warnings in D19304480 are adding a lot of warning noise due to missed infra callsites. Those callsites need to be updated before these warnings can be added. Changelog: [Removed] Remove console warnings from ScrollView methods Reviewed By: rickhanlonii Differential Revision: D20700917 fbshipit-source-id: cb618ee3a291d26e1942e4f91bbc02dee41fb78b * Upgrade react-docgen, jscodeshift and flow-parser Summary: In preparation for upgrading babel, I'm updating some of our source transform tools to the latest versions. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D20675201 fbshipit-source-id: fa4fee2652529c6677087e42cdd1325a8080e46f * Ship State Reconciliation 100% on all platforms Summary: State Reconciliation has been running 50/50 for a while and all metrics look stable. This is necessary for providing a good experience so we should ship to everyone unconditionally. Changelog: [Internal] Fabric diffing reconciliation process improvement Reviewed By: mdvacca Differential Revision: D20715694 fbshipit-source-id: 25b2635ecc29b67e2911679c9db66bc84d37dec1 * Core telemetry tests: update so they pass on my machine Summary: `std::this_thread::sleep_for` is not really precise and will attempt to sleep for "at least" that much time, but may sleep much longer depending on what CPUs are doing and scheduling policies. To get this to pass on my machine, I had to substantially increase the thresholds. Changelog: [Internal] Reviewed By: shergin Differential Revision: D20689571 fbshipit-source-id: f159420d24a95da2b5d95d49ed7882e783291e98 * Optimize diff algorithm to produce fewer remove+insert ("move") paired instructions Summary: An evolution of D20633188 but more performant. There are three optimized paths before the slow path. The first optimized path tries to pair identical nodes from old/new tree, and generate Update mutations, until we hit nodes that are different (indicating either a remove or an insert). This already existed. The next two optimizations, introduced by Tim in his JS pseudocode, were inspired by ReactJS's diffing algorithm. They work in cases where the rest of the nodes are (1) all removals/deletes or (2) all creates+inserts. Finally, if those final two optimized paths can't run, it's because there is a mix of delete+remove, create+insert, and "move" operations, mixed at the beginning, middle, and/or end of the list. This has slightly better average/best-case complexity as the previous implementation. In particularly pathological cases where all nodes are arbitrarily reordered, or reversed, for instance (ABCDE->EDCBA) the algorithm has the same complexity as the previous algorithm (quadratic). For now iOS is pinned to the older differ Changelog: [Internal] Experiment to optimize diffing algorithm in Fabric Reviewed By: shergin Differential Revision: D20684094 fbshipit-source-id: d29fba95a0328156c023e1c87804f23770ee1d91 * Unit test for V2 "minimal instruction" diffing algorithm Summary: This unit test is to verify that the new diffing algorithm generates a "minimal" instruction set, with regards to removes and inserts ("moves"). These unit tests are here to verify the expected behavior in this new algorithm, but these tests may be modified or deleted in the future if we decide we want to change this behavior. Changelog: [Internal] fabric unit test Reviewed By: mdvacca Differential Revision: D20706592 fbshipit-source-id: 5f9991498e0d788ecbf88d938bfe6d3f0f27af40 * Add ES Lint rules for `DynamicColorIOS()`and `ColorAndroid()` (#28398) Summary: The [PlatformColor PR](https://github.com/facebook/react-native/pull/27908) added support for iOS and Android to express platform specific color values. The primary method for an app to specify such colors is via the `PlatformColor()` method that takes string arguments. The `PlatformColor` method returns an opaque Flow type enforcing that apps use the PlatformColor method instead of creating Objects from scratch -- doing so would make it harder to write static analysis tools around Color values in the future. But in addition to `PlatformColor()`, iOS has a `DynamicColorIOS()` method that takes an Object. The Flow type for this Object cannot be opaque, but we still want to enforce that app code doesn't pass variables instead of Object literals or that values in the Objects are variables. To ensure `DynamicColorIOS()` can be statically analyzed this change adds an ESLint rule to enforce that `DynamicColorIOS()` takes an Object literal of a specific shape. A `ColorAndroid()` was also introduced not for practical use but just to test having platform specific methods for more than one platform in the same app. A second ESLint rule is created for `ColorAndroid` as well. ## Changelog [General] [Changed] - Add ES Lint rules for `DynamicColorIOS()`and `ColorAndroid()` Pull Request resolved: https://github.com/facebook/react-native/pull/28398 Test Plan: `yarn lint` passes. Reviewed By: cpojer Differential Revision: D20685383 Pulled By: TheSavior fbshipit-source-id: 9bb37ccc059e74282b119577df0ced63cb9b1f53 * fix: Android gradle config when bundling for release (#28415) Summary: This fix aims to address the issue when bundling an Android app for release and getting the error exhibited in https://github.com/facebook/react-native/issues/28002 which I also encountered myself. The config was changed sometime in November 2019 (as part of https://github.com/facebook/react-native/issues/26940, commit https://github.com/facebook/react-native/commit/a3b08048674e324dbe1f0ca816f35607e9e06a2f) to be very opinionated when it comes to the use of `npx` which Gradle itself cannot find anyway (I have `npx` installed globally and it didn't pick it up). Another issue that the use of `npx` creates is that Gradle should only ever use the currently installed react-native cli rather than a (possibly) higher version which may not always have backward compatibility. The proposed change simply throws a more descriptive error rather than defaulting to a tool which may or may not exist on the machine, be it CI or a development environment. I've also modified the RNTester app to reflect the correct config implementation relative to the RNTester app itself. In real projects, the config inside `android/app/build.gradle` should look similar to the following snippet: ``` project.ext.react = [ cliPath: "$rootDir/../node_modules/react-native/cli.js", entryFile: "index.js" ]; ``` ## Changelog [Android] [Fixed] - Gradle release config Pull Request resolved: https://github.com/facebook/react-native/pull/28415 Test Plan: - [x] Successfully bundled an Android release build with correct config - [x] Works with RNTester app Reviewed By: mdvacca Differential Revision: D20714372 Pulled By: hramos fbshipit-source-id: 4d66139249c6f840582a71a48c64e6a6595f7af0 * Reimplement D19965405: Small improvements in Differentiator/TinyMap Summary: Two things: 1) I reimplement Valentin's idea in D19965405, so that TinyMaps can be iterated over, with a couple of bugfixes (calling front() or back() on an empty vector will crash). 2) I now use TinyMap instead of better::map in the "optimized" diffing algorithm. 3) `erase` now actually removes elements from the vector, but only when more than half of elements have been erased. 4) If you repeatedly erase elements at the beginning of the vector, they will no longer be iterated over. This is a specific optimization for our heaviest TinyMap use-cases. These amount to some small but hopefully somewhat meaningful perf improvements. Changelog: [Internal] Fabric perf Reviewed By: shergin Differential Revision: D20718719 fbshipit-source-id: 91f4b2e2e0f6387ae484e43d5b0095103087baa6 * Remove LayoutInspectingPolicy.includeScrollViewContentOffset Summary: `LayoutInspectingPolicy` has two flags, `includeTransform` and `includeScrollViewContentOffset`. `includeScrollViewContentOffset` seems to be redundant for two reasons. # 1st From looking at callers, they have always the same value. I looked at all call sites, and they are either always both set to true or both set to false. # 2nd The way we include scroll view content offset, is through transformation, so setting `includeTransform` to true and `includeScrollViewContentOffset` to false will include content offset anyway. In order to make both flags work, we would need to introduce further changes to `getRelativeLayoutMetrics`. But since the flag isn't used anyway, I think it is better to get rid of it for now. If we need it in the future, we could re-introduce it. Reviewed By: shergin Differential Revision: D20622256 fbshipit-source-id: fb6156c66b752319ea928239fa723ff90688b0a0 * Add support for translation and rotation to operator * between Rect and Transform Summary: Changelog: [Internal] Until now `Rect operator*(Rect const &rect, Transform const &transform)` supported only scaling. Now it supports translation and rotation as well. Reviewed By: shergin Differential Revision: D20622876 fbshipit-source-id: 1b65393bd3fd6fd9a8941903e0f2681a10097e4a * Include transform property when calling getRelativeLayoutMetrics Summary: Changelog: [Internal] Current implementation of `measure` doesn't take transform into account.. So if you had a view which has width and height 100 and had `Scale(0.5, 0.5, 1)` (this will shrink view by half). Calling `getRelativeLayoutMetrics` would report its size being `{100, 100}`. This applies if view's parent has transformation as well, because transformation is applied to all subviews of the view as well. Reviewed By: mdvacca Differential Revision: D20621590 fbshipit-source-id: 2cf902a0494291c821ecada56f810c5e6620db5a * feat: migrate appveyor to circleci (#28245) Summary: This issue closes https://github.com/facebook/react-native/issues/28241 Migrated Windows test from AppVeyor to CircleCI ## Changelog [Internal] [Changed] - Migrated Windows test from AppVeyor to CircleCI Pull Request resolved: https://github.com/facebook/react-native/pull/28245 Test Plan: For CircleCI to Pass Reviewed By: cpojer Differential Revision: D20689163 Pulled By: hramos fbshipit-source-id: 285c762457ef00f7884ee9157b3f336044c0452f * Remove "Debug with Nuclide" option Summary: This is no longer needed. Reviewed By: cpojer Differential Revision: D20722274 fbshipit-source-id: 5bc3104e90811d724f42aadbf137ab8eff718ca0 * experiment to preload RN bridge after fb4a bookmarks render Summary: Changelog: [Android][Internal] add internal supermodule label Reviewed By: mdvacca Differential Revision: D20434200 fbshipit-source-id: fae50309cdd0df4a4523c2f88d1c8e01a7163575 * Fix CursorDrawable Color Tint for Android 10+ Summary: Accessing this field via reflection is explicitly blacklisted by Google in Android 10 and higher. They have provided a new API to change the color, which I have implemented here. [The old setColorFilter is deprecated](https://developer.android.com/reference/android/graphics/drawable/Drawable#setColorFilter(int,%20android.graphics.PorterDuff.Mode)) so I also updated that method call as well. Changelog: [General] [Fixed] Use new setTextCursorDrawable API for Android 10 Reviewed By: JoshuaGross Differential Revision: D20656068 fbshipit-source-id: 58a92b57c0a892c7c87fc5d735e4ceaa4e987ec7 * Early return on tinting CursorDrawable if no color supplied Summary: There's (potentially) a lot of expensive reflection calls here that, as best I can tell, end up being ignored if the supplied color is null. Better to early return. Changelog: [General] [Internal] Preclude reflection when setting cursor color if color is null Reviewed By: JoshuaGross Differential Revision: D20670594 fbshipit-source-id: 480a988355bbd79008002c4326d4b35035ec2a95 * Partial React Sync for Inspector Summary: Partial sync for React that includes: - https://github.com/facebook/react/pull/18388 - https://github.com/facebook/react/commit/dd7e5e4f5ac2ffac3171ef61daee2cb1edc69635 Created from this branch: https://github.com/facebook/react/compare/master...rickhanlonii:rh-partial-3-24?expand=1 Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20651395 fbshipit-source-id: 67baf7c407f75d9fd01c17f2203a77a38567100e * Enable inspector for Fabric Summary: ## Overview This diff refactors the Inspector, moving logic to look up view data for a touched view inside the renderer as `getInspectorDataForViewAtPoint`. We then implement that same function for Fabric in order to support the inspector in that renderer. Requires https://github.com/facebook/react/pull/18388 ## Motivation Reason one for this refactor is that, previously, the inspector held all of the logic to look up view data for a given x,y touch coordinate. To do this, it would take the React tag and coordinates, look up the native view tag, measure it, and then ask React internals for the Fiber information of that tag. All of this is deeply coupled to React internals, yet the logic is outside of React core in the Inspector. Reason two is that, for Fabric, the logic for getting the view data is different than Paper. In Fabric, we pass the x,y coordinates to native directly, which returns an instance handle. That handle can be used to measure the ShadowNode, or retrieve the Fiber information. By moving the logic into the renderer in React core, we decouple the implementation details of looking up view data for a tapped point and allow ourselves the ability to add and change renderer-specific code for the actual lookup without impacting outsiders like the Inspector. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D20291710 fbshipit-source-id: a125223f2e44a6483120c41dc6146ad75a0e3e68 * chore: update url of warning message from deprecated imports (#28452) Summary: Some of the repository name of Lean Core(https://github.com/facebook/react-native/issues/23313) libraries has been renamed. This PR updates the warning message to display the updated url. ## Changelog [General] [Changed] - Update warning message of deprecated imports Pull Request resolved: https://github.com/facebook/react-native/pull/28452 Test Plan: updated URL can be accessed. Reviewed By: cpojer Differential Revision: D20745184 Pulled By: TheSavior fbshipit-source-id: 2c3ed6a000b45022ca6c4862305aa567c4d18b2e * Add `upgrade-support` link on issue creation (#28411) Summary: This PR adds a https://github.com/react-native-community/upgrade-support link for the user when creating an issue. Changelog: [Internal] Pull Request resolved: https://github.com/facebook/react-native/pull/28411 Reviewed By: cpojer Differential Revision: D20714274 Pulled By: hramos fbshipit-source-id: 4ca42224a50e386b95f21f0fb236a917e1b6b982 * Update PixelRatio 'getFontScale' method description (#28407) Summary: Refs facebook/react-native-website#1776. Despite in-code description `PixelRatio.getFontScale()` is working properly on the iOS (it also reflects the user settings). This PR updates the in-code description to match current behaviour. I have decided to skip in the code information about additional setting in `Accessibility` menu and in `Control Centre`, but if you think it is important just let me know, I can update this PR. ## Changelog [Internal] [Fixed] - Fix PixelRatio getFontScale method description Pull Request resolved: https://github.com/facebook/react-native/pull/28407 Test Plan: N/A Differential Revision: D20750260 Pulled By: shergin fbshipit-source-id: c40ec2fd49cd60e2975351c3a1c453aab0045da4 * Remove allowDisablingImmediateExecutionOfScheduleMountItems feature flag Summary: No longer needed. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20747684 fbshipit-source-id: a8077519b7670d72e23267b1c1423556ec97be3f * RuntimeExecutor helpers that modify the way of the callback is being executed. Summary: Here we implement a bunch of helper methods that allow customizing the behavior of a RuntimeExecutor "on-demand" on the caller side. We will use it in the next diff(s). Changelog: [Internal] Fabric-specific internal change. Reviewed By: PeteTheHeat Differential Revision: D20551411 fbshipit-source-id: 51d3cd02b69753110c0e1155347c6e52eb882c7d * Fabric: Using `executeSynchronouslyOnSameThread_CAN_DEADLOCK` in MainRunLoopEventBeat Summary: We are replacing inline-ed implementation with practically the same one implemented as the helper method. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20551409 fbshipit-source-id: fcc6f497cd240af65fba534051c217fe5746ce82 * Set RootNodeKind trait in ModalHostViewShadowNode Summary: Changelog: [internal] `ModalHostViewShadowNode` didn't have `RootNodeKit` trait, therefore `getRelativeLayoutMetrics` was including nodes in ancestors that it shouldn't have. Reviewed By: shergin Differential Revision: D20735801 fbshipit-source-id: 6b81e3b174c2f82e530abc2bca2da8bebc2270b0 * mention RNTester app in contributor guide (#28042) Summary: motivation is following - the RNTester app is imho the best place to try out any changes that a contributor would make, yet it is not directly mentioned in the contributor guide. This fixes it. ## Changelog [Internal] - Docs Pull Request resolved: https://github.com/facebook/react-native/pull/28042 Test Plan: not necessary Reviewed By: TheSavior Differential Revision: D20401260 Pulled By: hramos fbshipit-source-id: 01c1b7dff56b59909c94b2feb609650f0baba1a9 * Buck: Use Android SDK 29 during build (#28455) Summary: Fixes `test_android` and `test_docker` build failures. Thanks to dulmandakh for identifying the fix. Changelog: [Internal] [Android] [Changed] - Use Android SDK 29 to build during CI tests Pull Request resolved: https://github.com/facebook/react-native/pull/28455 Test Plan: Circle CI shows `test_android` and `test_docker` passing: https://app.circleci.com/jobs/github/facebook/react-native/142273 Reviewed By: sturmen Differential Revision: D20766589 Pulled By: hramos fbshipit-source-id: 8ef8a8ce3a6e7353ae47425accb3bd26cf1608c4 * Assign orderIndex_ in ConcreteViewShadowNode constructor instead of ViewShadowNode's constructor Summary: Changelog: [Internal] `orderIndex_` was only being assigned for `ViewShadowNode`, not for other `ShadowNodes` that are later represented on the screen. Reviewed By: shergin Differential Revision: D20746477 fbshipit-source-id: c04c2cfea14b9141d22bc3d9e9bb4c0c59925754 * Implement nativePerformanceNow to improve Profiler API results (#27885) Summary: When experimenting with React Profiler API (https://reactjs.org/docs/profiler.html), I noticed that durations are integers without a debugger, but they are doubles with higher precision when debugger is attached. After digging into React Profiler code, I found out that it's using `performance.now()` to accumulate execution times of individual units of work. Since this method does not exist in React Native, it falls back to Javascript `Date`, leading to imprecise results. This PR introduces `global.nativePerformanceNow` function which returns precise native time, and a very basic `performance` polyfill with `now` function. This will greatly improve React Profiler API results, which is essential for profiling and benchmark tools. Solves https://github.com/facebook/react-native/issues/27274 ## Changelog [General] [Added] - Implement `nativePerformanceNow` and `performance.now()` Pull Request resolved: https://github.com/facebook/react-native/pull/27885 Test Plan: ``` const initialTime = global.performance.now(); setTimeout(() => { const newTime = global.performance.now(); console.warn('duration', newTime - initialTime); }, 1000); ``` ### Android + Hermes ![Screenshot_1580198068](https://user-images.githubusercontent.com/13116854/73245757-af0d6c80-41b5-11ea-8130-dde14ebd41a3.png) ### Android + JSC ![Screenshot_1580199089](https://user-images.githubusercontent.com/13116854/73246157-92256900-41b6-11ea-87a6-ac222383200c.png) ### iOS ![Simulator Screen Shot - iPhone 8 - 2020-01-28 at 10 06 49](https://user-images.githubusercontent.com/13116854/73245871-f136ae00-41b5-11ea-9e31-b1eff5717e62.png) Reviewed By: ejanzer Differential Revision: D19888289 Pulled By: rickhanlonii fbshipit-source-id: ab8152382da9aee9b4b3c76f096e45d40f55da6c * Save/restore IP when leaving the interpreter Summary: This diff implements the instruction pointer save/restore trick Tzvetan came up with; allowing us to observe and modify the IP from outside the interpreter loop with negligible overhead. From Tzvetan's internal post on the subject: > [Today] the interpreter IP is just a local variable in the interpreter function, so there is no way to get to its value from outside the function. It lives in a register and we don't want to make it a Runtime field since the overhead [of accessing it via memory in the interpeter loop] would kill us. > However, if you really think about it, it only lives in a register while the interpreter function is running. For the rest of the time, it is spilled by the C++ compiler onto the stack. So, precisely when we need it, it is actually stored in memory. The only problem is, we don't know where! Admittedly, that is an annoying problem, but it feels like it should be solvable. > What if, instead of relying on the compiler to spill the IP register, we manually spill it ourselves, to a known location? It works. Example: https://godbolt.org/z/ftSDnp This diff implements this approach across the whole interpreter loop: whenever we call out of the loop we capture/publish the IP and restore it again immediately after the external call returns. This means we can now see the IP outside the interpret loop and even change it. This is effectively "for free" as the compiler now skips spilling/restoring the IP behind the scenes. The immediate benefit of this is knowing the current IP allows us to have more accurate stack-traces during execution. In future this may enabled tricks like changing the IP before returning to the interpreter loop, allowing things outside the interpreter to affect program flow without adding logic to the interpreter loop. Reviewed By: tmikov Differential Revision: D20151091 fbshipit-source-id: 3814382639800208d8985a32ede31ba8f7ff7c80 * Plumb through memory allocation profiler feature to Chrome Inspector Summary: Changelog: Make allocation profiler feature of Chome Inspector work Reviewed By: dulinriley Differential Revision: D20383003 fbshipit-source-id: 8a10c310d5a639a6644763adb53f2f0017057587 * chore: update lint config in template (#28443) Summary: Updating the eslint config and metro-preset used in project template. ## Changelog [General] [Changed] - Upgrade eslint-config and metro-preset in project template Pull Request resolved: https://github.com/facebook/react-native/pull/28443 Test Plan: - Start new project with `npx react-native init TestLint` - upgrade lint and metro-config - run lint and start up emulator on iOS and android Reviewed By: cpojer Differential Revision: D20771048 Pulled By: hramos fbshipit-source-id: a6d387b8687cee348681bcb10d22c7e3de291ed7 * Apply buckformat in preparation for updating buildifier Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D20773287 fbshipit-source-id: 144bb13191312eef246646b99e1dc06304c6d210 * Circle CI Housekeeping: Windows, e2e (#28471) Summary: Circle CI Housekeeping: * Integrate Windows job into `tests` workflow * Add parametrized e2e tests command * Move js e2e tests out of the disabled test quarantine area * Parametrize and split `test_ios` job to reduce total execution time by ~13 minutes **Before:** Longest running iOS job at 39 minutes. | Setup Job Runtime | Job | Job Runtime | Total Runtime | | - | - | - | - | | 01:24 | test_ios | 38:04 | **39:28** | | 01:24 | test_ios_frameworks | 38:02 | 39:26 | ![Screen Shot 2020-03-31 at 12 40 29 PM](https://user-images.githubusercontent.com/165856/78068308-044c3280-734d-11ea-96bf-2e50691a0ef7.png) **After:** Longest running iOS job down to 26 minutes. | Setup Job Runtime | Job | Job Runtime | Total Runtime | | - | - | - | - | | 01:26 | test_ios_unit | 20:48 | 22:14 | | 01:26 | test_ios_unit_frameworks | 22:52 | 24:18 | | 01:26 | test_ios_detox | 24:35 | 39:28 | | 01:26 | test_ios_detox_frameworks | 24:54 | **26:20** | ![Screen Shot 2020-03-31 at 12 39 22 PM](https://user-images.githubusercontent.com/165856/78068294-fe565180-734c-11ea-96da-8836231d7747.png) ## Changelog [Internal] [CI] - CI Housekeeping Pull Request resolved: https://github.com/facebook/react-native/pull/28471 Test Plan: Circle CI Reviewed By: cpojer Differential Revision: D20774521 Pulled By: hramos fbshipit-source-id: 4a2f5a4083cd76dcb51d5ccaf726cd204fca222e * Fix bug in optimized differ Summary: The differ was still producing correct, but not minimal, instruction sets in some cases due to an optimization that was buggy. This affected cases where 2+ nodes were inserted at the beginning of a list. It would trigger the old behavior where all nodes after the first would be removed, deleted, then reinserted. See the test case (which was failing and now passed) and P128190998 (the 3->4 transition) for samples. Changelog: [Internal] Fabric differ Reviewed By: mdvacca Differential Revision: D20785729 fbshipit-source-id: 2fea6a816753066abb358ed7bb51003140cd5fc4 * Use `buildCodeFrameError` in babel-plugin-inline-view-configs Summary: The next version of Babel changes how it prints file names in errors. This diff fixes the test by using `/` as the `cwd` and switches the plagin to use `path.buildCodeFrameError` so errors will be more helpful for users. I renamed the `nodePath` variable to `path` because that's what babel plugins usually do. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D20781805 fbshipit-source-id: cc149dce6389aa9402ce70ea30035c74a6150ea3 * Swap left and right yoga position with start and end in RTL context Summary: Changelog: [Internal] Paper swaps right and left in RTL setting, this logic is in [RCTShadowView.m](https://our.intern.facebook.com/intern/diffusion/FBS/browse/master/xplat/js/react-native-github/React/Views/RCTShadowView.m?commit=cdd504cfbee66ae0659495604c4ff7b5764a1d9e&lines=529-549). For Fabric instead of doing it during yoga props assignment, I swap the left/right with start/end just before we pass yoga nodes to layout calculation. Reviewed By: shergin Differential Revision: D20420040 fbshipit-source-id: b777f2658f56c173743b2034b8b5059e3e0c9840 * Fix inline-view-configs test on Windows. Summary: *facepalm* The file path is platform specific. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D20793023 fbshipit-source-id: 4fbcbf982911ee449a4fa5067cc0c5d81088ce04 * Pass isRTL flag from FabricUIManager Fabric core Summary: Changelog: [Internal] Send `isRTL` flag and `doLeftAndRightSwapInRTL` flags from Java to Fabric Core. Reviewed By: JoshuaGross, mdvacca Differential Revision: D20776005 fbshipit-source-id: 946c239d9a11ebea958b0a6d04f2316b7cd77311 * Promote shadowColor to formsStackingContext property Summary: Changelog: [Internal] View with `ShadowColor` was getting flattened and therefore views didn't have shadow property set. This is fixed by promoting ShadowColor so in case it is set, it forms stacking context. Reviewed By: shergin Differential Revision: D20792201 fbshipit-source-id: 1033ac00e32047ffbb14e61b7c26348c578d132d * Get CallInvokers from the bridge Summary: ## Context For now, assume TurboModules doesn't exist. **What happens when we call an async NativeModule method?** Everytime JS calls an async NativeModule method, we don't immediately execute it. The legacy infra pushes the call into some queue managed by `MessageQueue.js`. This queue is "flushed" or "emptied" by the following events: - **Flushed:** A C++ -> JS call. NativeModule async methods can called with an `onSuccess` and/or `onFail` callback(s). Calling `NativeToJsBridge::invokeCallback` to invoke one of these callbacks is one way for ObjC++/C++/Java to call into JS. Another way is via JSModule method calls, which are initiated by `NativeToJsBridge::callFunction`. - **Flushed:** When `JSIExecutor::flush` is called. Since TurboModules don't exist, this only happens when we call `JSIExecutor::loadApplicationScript`. - **Emptied:** When more than 5 ms have passed, and the queue hasn't been flushed/emptied, on the next async NativeModule method call, we add to the queue. Afterwards, we empty it, and invoke all the NativeModule method calls. **So, what's the difference between flushed and emptied?** > Note: These are two terms I just made up, but the distinction is important. If the queue was "flushed", and it contained at least one NativeModule method call, `JsToNativeBridge` dispatches the `onBatchComplete` event. On Android, the UIManager module is the only module that listens to this event. This `onBatchComplete` event doesn't fire if the queue was "emptied". **Why does any of this matter?** 1. TurboModules exist. 2. We need the TurboModules infra to have `JsToNativeBridge` dispatch `onBatchComplete`, which depends on: - **Problem 1:** The queue being flushed on calls into JS from Java/C++/ObjC++. - **Problem 2:** There being queued up NativeModule async method calls when the queue is flushed. In D14656466, fkgozali fixed Problem 1 by making every C++/Java/Obj -> JS call from TurboModules also execute `JSIExecutor::flush()`. This means that, with TurboModules, we flush the NativeModule async method call queue as often as we do without TurboModules. So far, so good. However, we still have one big problem: As we convert more NativeModules to TurboModules, the average size of the queue of NativeModule method calls will become smaller and smaller, because more NativeModule method calls will be TurboModule method calls. This queue will more often be empty than not. Therefore, we'll end up dispatching the `onBatchComplete` event less often with TurboModules enabled. So, somehow, when we're about to flush the NativeModule method call queue, we need `JsToNativeBridge` to understand that we've executed TurboModule method calls in the batch. These calls would have normally been queued, which would have led the queue size to be non-zero. So if, during a batch, some TurboModule async method calls were executed, `JsToNativeBridge` should dispatch `onBatchComplete`. **So, what does this diff do?** 1. Make `Instance` responsible for creating the JS `CallInvoker`. 2. Make `NativeToJsBridge` responsible for creating the native `CallInvoker`. `Instance` calls into `NativeToJsBridge` to get the native `CallInvoker`. 3. Hook up `CatalystInstanceImpl`, the Android bridge, with the new JS `CallInvoker`, and the new native `CallInvoker`. This fixes `onBatchComplete` on Android. iOS work is pending. Changelog: [Android][Fixed] - Ensure `onBatchComplete` is dispatched correctly with TurboModules Reviewed By: mdvacca Differential Revision: D20717931 fbshipit-source-id: bc3ccbd6c135b7f084edbc6ddb4d1e3c0c7e0875 * Make HermesRuntime::description() always include "HermesRuntime" Summary: If name is passed in as part of RuntimeConfig, that is included in the description, too. Changelog: [Internal] Reviewed By: dulinriley Differential Revision: D20716320 fbshipit-source-id: f2fba6df32f496090dee787d8b7f55a6a4dd8ed8 * Fix Yoga flexshrink with min-width sizing issue Summary: While resolving the flexible items we calculate totalFlexShrinkScaledFactors which uses the flexBasis or initial width of node (Not min-width). At a later stage during distribution of space we are subtracting value from this which also takes care of min-width. For example If node has flexShrink 1 and width 100 and min-width 301 then totalFlexShrinkScaledFactors will become -1*100 = -100 but later we are subtracting -1 * 301 (min-width) = -301 which is ambiguous and causing layout inconsistencies with how web behaves. Fixed this by only using the flexBasis or width for these calculations. Changelog: [Internal][Yoga] Fix layout issue when flexShrink and min-width are used together Reviewed By: pasqualeanatriello Differential Revision: D20219419 fbshipit-source-id: 948fbc06ca541d4ad307c88c8a2df65d157778b1 * More consistent snapshots on windows (#28482) Summary: Get jest tests to be runnable on windows, and match current snapshots ## Changelog [Internal] [Fixed] - More consistent snapshots on windows Pull Request resolved: https://github.com/facebook/react-native/pull/28482 Test Plan: run `yarn test` on a windows machine, and hit the test_windows circleci tests Reviewed By: hramos Differential Revision: D20799002 Pulled By: cpojer fbshipit-source-id: da3db0171c34a43199c7d3dc17b622b37bc91701 * Improve component stack parsing Summary: Update the error log message parsing to fix missing component stacks in console.errors. Changelog: [Internal] Reviewed By: cpojer Differential Revision: D20801985 fbshipit-source-id: ae544200315a8c3c0310e8370bc38b0546734f38 * Implement RCTWarn equivalent on Android Summary: ## Overview This diff is an RFC to port a logging feature from iOS to Android. Changelog: [Internal] ## Motivation On iOS we have the following log functions and behaviors available for logging native warnings and errors: - **Warnings** (`RCTLogWarn`) - Log level 'warn' to console - Display warning in LogBox - **Errors** (`RCTLogError`) - Log level 'error' to console - Display a native RedBox (needs converted to show a LogBox if available) - **Logs** - We also have `RCTLog`, `RCTTrace`, `RCTAdvice`, `RCTInfo`, which just log to the console. In Java, we have: - **Warnings** - **None**, added in this diff - **Errors** (`DevSupportManager.showNewJavaError`) - Log level 'error' to console with `FLog.e` - Display a native RedBox (needs converted to show a LogBox if available - **Logs** - `ReactSoftException` (crashes the app??) - `ReactNoCrashSoftException` (only logs??) - Others? ## Details This diff adds a method to pair with `RCTLogWarn`, `DevSupportManager.showNewJavaWarning`, which will log to the console and show a LogBox warning if LogBox is available. ## Concerns I have a few concerns/questions about the state of logging on Android: - Should/can we move all of the logging to it's own class, like how RCTLog works? - Why does some logging happen on DevSupportManager and some in other classes? - If we moved it all to it's own class, how could we access the reactContext to call the RCTLog JS module Reviewed By: JoshuaGross Differential Revision: D20056394 fbshipit-source-id: 32d57e300685e46da8039fc77cb22b4084acf81a * Remove unused feature flag: useMapNativeAccessor Summary: useMapNativeAccessor isn't being used anywhere. Changelog: [Internal] Removing unused internal feature flags: mUseMapNativeAccessor and mUseArrayNativeAccessor Reviewed By: mdvacca Differential Revision: D20788147 fbshipit-source-id: bf670508326813602cb544f86d3d2164651d3394 * Remove unused Feature Flag: lazilyLoadViewManagers Summary: Remove unused feature flag. This is not used within Facebook and I'm not aware of usage outside of FB. Changelog: [Removed] Removing Android feature flag: lazilyLoadViewManagers Reviewed By: mdvacca Differential Revision: D20788210 fbshipit-source-id: 435316e3de7830d7cb7f14537351883e4fc6eeaa * Remove unused feature flag: enableExtraWebViewLogs Summary: Hard-coded to false everywhere, and write-only. We never read from this. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20788252 fbshipit-source-id: ae117ebc51db7045947b9713602527ff4220833e * Remove unused feature flag: logDroppedViews Summary: Remove unused internal feature flag, logDroppedViews. Changelog: [Internal] Reviewed By: lunaleaps Differential Revision: D20797353 fbshipit-source-id: 1bfea7fcce9e80cdb92cda59a89c7dd817d4a581 * Split loadApplicationScript into initializeRuntime and loadBundle (#27844) Summary: This is the first of three PRs related to enabling multi-bundle support in React Native. More details, motivation and reasoning behind it can be found in RFC [here](https://github.com/react-native-community/discussions-and-proposals/issues/152). Logic responsible for installing globals was pulled out from `loadApplicationScript` to `initializeRuntime` since it should be ran only once, what was left was renamed to `loadBundle`. It's based on dratwas work from [here](https://github.com/callstack/react-native/tree/feat/multibundle/split-load-application), but applied to current `master` to avoid rebasing 3-months old branch and issues that come with that. ## Changelog [Internal] [Changed] - split `loadApplicationScript` into `initializeRuntime` and `loadBundle` to enable multi-bundle support in the future Pull Request resolved: https://github.com/facebook/react-native/pull/27844 Test Plan: Initialized new RN app with CLI, set RN to build from source and verified the still app builds and runs OK using code from this branch. Reviewed By: rickhanlonii Differential Revision: D19888605 Pulled By: ejanzer fbshipit-source-id: 24ace48ffe8978796591fe7c6cf53a61b127cce6 * Back out "Fix controlled TextInput with child nodes" Summary: Changelog: [Internal] Original commit changeset: 1b8a2efabbfa Original diff D20587681 breaks non-controlled text input. Reviewed By: motiz88 Differential Revision: D20815935 fbshipit-source-id: 70577ed1e5701850ff0e30a6592945a31c2a8bec * Fixed crash in JSIExecutor::NativeModuleProxy Summary: JSIExecutor::NativeModuleProxy is an object created by JSIExecutor and essentially representing that in JavaScript world. Before this change, JSIExecutor::NativeModuleProxy had a raw reference to JSIExecutor which (I believe) caused a crash because JSIExecutor can be deallocated before JSIExecutor::NativeModuleProxy. Now, instead of storing a pointer to JSIExecutor, we store a weak pointer to JSINativeModules which we can safely validate before calling on it. Changelog: [Internal] Fixed crash in JSIExecutor Now the configuration looks like this: ``` + - - - - - - - - - - - - - - - - - - - - - Something else | | shared_ptr<jsi::Runtime> runtime --+ | | + - - - - - - - - - - - - - - - - - - - - - | | | +------------------------------------------+ | | | | | JSExecutorFactory | | +--------------------------------+-------------------------------+ | | +-----------------------+ | | | +------------------------------------------+ | | v | | | +------------------------------------------+ | +--------------------------+ | | | | | | | | ModuleRegistry | | v | | | | | +------------------------------------------+ | | +------------------------------------------+ | | HermesRuntimeImpl | | | | | | (jsi::Runtime) |--+ | | +->+------------------------------------------+ | | | | | | | |std::unordered_map<std::string, size_t> | | +------------------------------------------+ | | | | |modulesByName_ | | | | | | | | | | | | | +------------------------------------------+ | | | | +->+------------------------------------------+ | +-----------------------+ | | |std::vector<std::unique_ptr<NativeModule>>| | | | | |modules_ | | | | | | | | v | | +------------------------------------------+ | +------------------------------------------+ | | | | | | | | | JSIExecutor::NativeModuleProxy | | | | | | | | | +------------------------------------------+ | | | +------------------------------------------+ | | | | | | +->+------------------------------------------+ | | | | NativeToJsBridge | |shared_ptr<JSINativeModules> | | | | | | |nativeModules_ | | | | +------------------------------------------+ +------------------------------------------+--+-----+------------------------------------+ | | | | | | +->+------------------------------------------+ | | | | | |unique_ptr<JSExecutor> | | | | | | |m_executor | | | | | | |(`::destroy()` resets it.) | | | | | | +------------------------------------------+--------------------------------+ | | | | +->+------------------------------------------+ | | | | | | |shared_ptr<JsToNativeBridge> | | | | | | | |m_delegate | | | | | | | +------------------------------------------+--+ v | | | | +->+------------------------------------------+ | +------------------------------------------+ | | | | |shared_ptr<MessageQueueThread> | | | | | | | | |m_executorMessageQueueThread | | | HermesExecutor: JSIExecutor: JSExecutor | | | | | +------------------------------------------+ | | | | | | | | +------------------------------------------+ | | | | | | | | | | | +->+------------------------------------------+ | | | | | | |shared_ptr<jsi::Runtime> | | | | | | | |runtime_ | | | | | | | +------------------------------------------+--+ | | | | +->+------------------------------------------+ | | | | | |shared_ptr<JSINativeModules> | | | | | | |nativeModules_ | | | | | | +------------------------------------------+--------+------------------------------------+ | +--------------------------+ +->+------------------------------------------+ | | | | |std::shared_ptr<ExecutorDelegate> | | v | | |delegate_ | | +------------------------------------------+ | | +------------------------------------------+--+ | | | | | | | | JSINativeModules | | | | | | | | | | | +------------------------------------------+ | | | | | | | | | +-->+------------------------------------------+ | +-----------------------------------------------------------------------------------+ | |m_moduleRegistry | | | | |(shared_ptr) | | | | +------------------------------------------+--+ | | | | v | +------------------------------------------+ | | | | | JsToNativeBridge: ExecutorDelegate | | | | | +------------------------------------------+ | | | +->+------------------------------------------+ | |shared_ptr<ModuleRegistry> | | |m_registry | | +------------------------------------------+-----------------------------------------------------------------+ ``` Reviewed By: RSNara Differential Revision: D20817257 fbshipit-source-id: 9ae378dbe880aaabfef7ae783dae2f94ee4b0af5 * Fix crash caused by <Modal> trying to present view controller twice Summary: Changelog: [Internal] `_viewController` was being presented twice causing following exception ``` 'Application tried to present modally an active controller <FBReactRootViewController: 0x7fe741818b80; ``` Reviewed By: shergin Differential Revision: D20820395 fbshipit-source-id: 5c9489011e5f99d8bd37befbd544d2d55a650589 * Loosen up restrictions for internal changelogs (#28486) Summary: Do not nag on PRs that contain internal changelogs (meaning, the change doesn't need to be called out in release notes). ## Changelog [Internal] - This should be acceptable. Pull Request resolved: https://github.com/facebook/react-native/pull/28486 Test Plan: See PR. Reviewed By: cpojer Differential Revision: D20817454 Pulled By: hramos fbshipit-source-id: a7082c4db05ec53ad27349db7e5bce2cfffd6930 * Fix TextInlineViews when UIImplementation processes two roots at the same time Summary: This diff cleans the variable NativeViewHierarchyOptimizer.mTagsWithLayoutVisited right after all the view updates for a rootShadowNode have been processed by the UIImplementation class. This intends to fix the bug reported in the task: T61185028, which root cause seems related to the fact that the variable NativeViewHierarchyOptimizer.mTagsWithLayoutVisited is not cleaned up when updating multiple rootShadowNodes as part of the same batch changelog: [Android][internal] internal bug fix Reviewed By: JoshuaGross Differential Revision: D20812921 fbshipit-source-id: 28067ee29a931d7a9e9c33c90aceb4e3512dac1a * Add a React Feature Flag to control TextInlineView fix Summary: This diff adds a temporary Feature Flag to control a fix in TextInlineView (see previous diffs of the stack) changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D20812920 fbshipit-source-id: 90fece9b29ba173546d96e4d9baf1ccabb3031b2 * Pass native CallInvoker to ObjCTurboModule constructor Summary: This is necessary to integrate TurboModule async method dispatch with the bridge's `onBatchComplete` event. See D20717931 for more details. This diff is similar to D20480971. **Note:** This stack doesn't really make any functional changes, since the native CallInvoker is `nullptr` right now. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809199 fbshipit-source-id: bf465a3a51bdddb8b56d1e696ca510fdf071f9ec * Manual changes required to make ObjCTurboModule accept native CallInvoker Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809200 fbshipit-source-id: d540eec9a3360a031f75d76a6ab9fb15303f8af5 * Codemod all getTurboModuleWithJsInvoker methods to accept a native CallInvoker Summary: To make iOS TurboModules integrate with the bridge's onBatchComplete event, they need to use a native CallInvoker. This call invoker is created by the `NativeToJsBridge`, and ObjCTurboModule will use this native CallInvoker to dispatch TurboModule method calls. This diff makes sure that ObjCTurboModules are created with that native CallInvoker. ## Script ``` var withSpaces = (...args) => args.join('\s*') var regexString = withSpaces( '-', '\(', 'std::shared_ptr', '<', '(?<turboModuleClass>(facebook::react::|react::|::|)TurboModule)', '>', '\)', 'getTurboModuleWithJsInvoker', ':', '\(', 'std::shared_ptr', '<', '(?<callInvokerClass>(facebook::react::|react::|::|)CallInvoker)', '>', '\)', '(?<jsInvokerInstance>[A-Za-z0-9]+)', 'perfLogger', ':', '\(', 'id', '<', 'RCTTurboModulePerformanceLogger', '>', '\)', '(?<perfLoggerInstance>[A-Za-z0-9]+)', '{', 'return', 'std::make_shared', '<', '(?<specName>(facebook::react::|react::|::|)Native[%A-Za-z0-9]+SpecJSI)', '>', '\(', 'self', ',', '\k<jsInvokerInstance>', ',', '\k<perfLoggerInstance>', '\)', ';', '}', ) var replaceString = `- (std::shared_ptr<$<turboModuleClass>>) getTurboModuleWithJsInvoker:(std::shared_ptr<$<callInvokerClass>>)$<jsInvokerInstance> nativeInvoker:(std::shared_ptr<$<callInvokerClass>>)nativeInvoker perfLogger:(id<RCTTurboModulePerformanceLogger>)$<perfLoggerInstance> { return std::make_shared<$<specName>>(self, $<jsInvokerInstance>, nativeInvoker, $<perfLoggerInstance>); }` const exec = require('../lib/exec'); const abspath = require('../lib/abspath'); const relpath = require('../lib/relpath'); const readFile = (filename) => require('fs').readFileSync(filename, 'utf8'); const writeFile = (filename, content) => require('fs').writeFileSync(filename, content); function main() { const tmFiles = exec('cd ~/fbsource && xbgs -n 10000 -l getTurboModuleWithJsInvoker:').split('\n').filter(Boolean); tmFiles .filter((filename) => !filename.includes('microsoft-fork-of-react-native')) .map(abspath) .forEach((filename) => { const source = readFile(filename); const newSource = source.replace(new RegExp(regexString, 'g'), replaceString); if (source == newSource) { console.log(relpath(filename)); } writeFile(filename, newSource); }); } if (!module.parent) { main(); } ``` Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809202 fbshipit-source-id: 5d39b3cacdaa5681b70ce1803351d0432dd74550 * Make RCTTurboModuleManagerDelegate getTurboModule accept native CallInvoker and PerfLogger Summary: Might be worthwhile to just kill this method instead, since we're having all NativeModules provide their TurboModule jsi::HostObjects. But I'll leave that decision to a later time. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809201 fbshipit-source-id: ee73d4b5454a76460832a54f9b864841e5b2b9c0 * eslint-config: add version badge and add homepage for eslint-config (#28506) Summary: Add version badge to README of eslint-config, and add specific url for the homepage so people looking at the npm package can find out where the package is from. ## Changelog [Internal] [Changed] - Add version badge to README of eslint-config Pull Request resolved: https://github.com/facebook/react-native/pull/28506 Test Plan: Not required as the only changes are made in README and homepage prop of package.json Differential Revision: D20837085 Pulled By: cpojer fbshipit-source-id: 820d3b44b069780ec8764c6152d2e7fd5220933c * Rename Instance::getNativeCallinvoker to Instance::getDecoratedNativeCallInvoker Summary: Now, instead of accepting a `std::function` that schedules work, and returning a `CallInvoker`, `Instance::getDecoratedNativeCallInvoker` will accept a `CallInvoker` that schedules work, and return a decorated `CallInvoker`. I think this change will help with readability. It also clarifies that the bridge is adding additional behaviour to the native `CallInvoker`. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20826885 fbshipit-source-id: a2c5681d10a4544ee3d2a0d1f1cbd386ef06d0e6 * Add CallInvoker::invokeSync Summary: We'll be using a native CallInvoker to dispatch sync and async method calls to ObjC NativeModules. This native CallInvoker will hold a reference to the ObjC NativeModule's method queue. **Why is the native CallInvoker required for ObjC NativeModules?** In the case where the ObjC NativeModule neither provides nor requests a method queue, we must create a method queue for it. When we go to invoke a method from JS, for these NativeModules specifically, there is no way to access this method queue. A native CallInvoker is a convenient abstraction that holds on to that method queue. For async calls, we'll just call `CallInvoker::invokeAsync`, and for sync calls, we'll just call `CallInvoker::invokeSync`. **Why do we need sync call support for native `CallInvoker`?** In ObjC, sync NativeModule method calls block the JS thread, then execute synchronously on the NativeModule's method queue, and then unblock the JS thread. This is what'll be implemented by `CallInvoker::invokeSync`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20829955 fbshipit-source-id: efb9d5408a1ade81069a943c865f232d4d10acfe * Export Instance::getDecoratedNativeCallInvoker from RCTCxxBridge Summary: `RCTTurboModuleManager` will create a native `CallInvoker` for each ObjC NativeModule. This `CallInvoker` will be used to dispatch calls from JS to native. Before passing the native `CallInvoker` to the `ObjCTurboModule`, it'll first use `RCTCxxBridge decorateNativeCallInvoker` to get a bridge-aware decorated native `CallInvoker`. That way, the bridge remains informed about async TurboModule method calls that took place since the last time it was flushed. This ensures that we don't end up dispatching `onBatchComplete` any less with TurboModules on than we do with TurboModules off. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20831546 fbshipit-source-id: b2eb4e0097e0dabf8c4bd8fdc4c850a0858af699 * Add Author Feedback label automatically (#28484) Summary: Improve issue triage by automatically adding the "Needs: Author Feedback" label. NOTE: The old label-actions app should be disabled when this PR is merged: https://github.com/apps/label-actions/installations/7445225 ## Changelog [Internal] - Issue Triage Pull Request resolved: https://github.com/facebook/react-native/pull/28484 Test Plan: Verified the same `label-actions.yml` and workflow config on a private repo. Reviewed By: cpojer Differential Revision: D20817443 Pulled By: hramos fbshipit-source-id: 39732dd67509c9fb9cf6ff7306913f5ec088266d * docs: add README and specify file in package.json (#28507) Summary: Adding a README for `react-native-codegen` since the package was published. Also added a `files` prop in package.json so unused file won't be included in the package. ## Changelog [Internal] [Changed] - Add README for react-native-codegen. Pull Request resolved: https://github.com/facebook/react-native/pull/28507 Test Plan: verify js files to function correctly without including files other than `src` Reviewed By: rickhanlonii Differential Revision: D20836113 Pulled By: cpojer fbshipit-source-id: e860f14760e9c1dbe121f5fb95ccf72d4ddb2af1 * Make the link easier to copy. (#28516) Summary: Making a PR from GitHub, I need to copy-paste the link, and it would be easier to just triple-click a line with the URL rather than carefully selecting the URL from the text. <img width="723" alt="Screen Shot 2020-04-03 at 17 33 47" src="https://user-images.githubusercontent.com/100233/78378550-6c12af80-75d1-11ea-93a4-2eae568ce602.png"> ## Changelog [General] [Changed] - Make PR template easier to use with changelog URL. Pull Request resolved: https://github.com/facebook/react-native/pull/28516 Reviewed By: fkgozali Differential Revision: D20842238 Pulled By: hramos fbshipit-source-id: 3fef7a994f36a996bbbc52556600d468a56210a9 * Upgrade tests to Xcode 11.3.1 (#28498) Summary: Upgrade Sandcastle and Circle CI tests to use Xcode 11.3.1 across the board. Pull Request resolved: https://github.com/facebook/react-native/pull/28498 Pull Request resolved: https://github.com/facebook/react-native/pull/28501 Changelog: [Internal] - Use Xcode 11.3.1 in iOS tests Reviewed By: fkgozali Differential Revision: D20821844 fbshipit-source-id: b250ca82bdf2c9fb7faa765d3e2433eb46efd692 * Fixes iOS reload through metro "r" command key (#28477) Summary: This allows the iOS device to be reloaded through the metro command line, besides the fact that whenever packagerServerHost is called, it will only get the IP address once when debugging. ## Changelog [iOS] [Fixed] - Fixed connection of metro reload command to iOS device Pull Request resolved: https://github.com/facebook/react-native/pull/28477 Test Plan: - Build any react-native project in debug mode to an iOS device connected through USB - Press the “r” key on the terminal that is running metro - The device should now reload the project Reviewed By: cpojer Differential Revision: D20818462 Pulled By: TheSavior fbshipit-source-id: 6d9792447d205223dad8fbd955518885427cbba8 * Create method queues for NativeModules that neither provide nor request one Summary: ## Problem: Let `A` be the set of all ObjC NativeModules that neither provide nor reqeust a method queue. The TurboModule system dispatches all method calls to NativeModules in `A` synchronously to the JS thread. Here is the relevant logic: **RCTTurboModule.mm:** Link: https://fburl.com/diffusion/nz9gqje8 ``` jsi::Value performMethodInvocation( // ... ) { // ... dispatch_queue_t methodQueue = NULL; if ([instance_ conformsToProtocol:protocol(RCTBridgeModule)] && [instance_ respondsToSelector:selector(methodQueue)]) { methodQueue = [instance_ performSelector:selector(methodQueue)]; } if (methodQueue == NULL || methodQueue == RCTJSThread) { // This is the default mode of execution: on JS thread. block(); } else if (methodQueue == dispatch_get_main_queue()) { ``` **Why does this end up happening?** 1. NativeModules that request a method queue have `synthesize methodQueue = _methodQueue` in their `implementation` section. This generates a `methodQueue` getter for the NativeModule, and also creates an ivar to back that getter. The TurboModule system generates a `dispatch_queue_t` and uses ObjC's KVC API to write to the ivar. So in the above logic, for NativeModules that provide a method queue, methodQueue will neither be `NULL` nor `RCTJSThread`, so we don't dispatch synchronously to the JS thread. 2. NativeModules that provide a method queue will return something that is not `NULL` or something that is `RCTJSThread`. If they return `NULL`, the infra will throw an error early. If they return `RCTJSThread`, we'll dispatch synchronously to the JS thread, as we should (...wait. For async NativeModule methods that dispatch to `RCTJSThread`, should we dispatch asynchronously to the JS thread, via jsInvoker? **Edit:** Nope: https://fburl.com/diffusion/ivt9b40s.). In all other cases, we dispatch to appropriately to the respective method queue. 3. For NativeModules that neither provide nor request a method queue (i.e: NativeModules in `A`), they don't implement the `methodQueue` selector. Therefore, we dispatch synchronously to the JS thread. ## The fix (Part 1): The first step towards fixing this problem is to generate `dispatch_queue_t`s for NativeModules in `A`. That's what this diff accomplishes. Changelog: [iOS][Fixed] - Create method queue for NativeModules that don't provide nor request one. Reviewed By: fkgozali Differential Revision: D20821054 fbshipit-source-id: 17a73550ad96766c5c7e719e28e1cc879e36465c * Rename duplicate name `<ScrollView>` example on RNTester (#28515) Summary: Tiny change. When searching for `scro` in the RNTester, two `<ScrollView>`s come up, from different example files. One is the "simple" one and the other is the "regular" one. Before: <img width="370" alt="Screen Shot 2020-04-03 at 17 14 01" src="https://user-images.githubusercontent.com/100233/78377338-c6ab0c00-75cf-11ea-9c45-2dcdd6460f6d.png"> After: <img width="369" alt="Screen Shot 2020-04-03 at 17 13 38" src="https://user-images.githubusercontent.com/100233/78377371-cf034700-75cf-11ea-89ea-aa3ff2f3988c.png"> ## Changelog [Internal] [Changed] - Rename the "simple" ScrollView example in RNTester to "ScrollSimpleView". Pull Request resolved: https://github.com/facebook/react-native/pull/28515 Test Plan: - Try to search for `scro` in RNTester. Reviewed By: fkgozali Differential Revision: D20842264 Pulled By: hramos fbshipit-source-id: 3db54a826ae774108e62690e7f154e85b541520f * Fix Fabric SSTs, so they actually run in Fabric instead of Paper, convert ServerSnapshotTestsAppImpl to functional component Summary: Update instrumentation test infra for Fabric tests. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D19961919 fbshipit-source-id: 17264b6308712dddece730effd57832817e148cf * Fixed scrollview inset when RN view is embedded in another view (#27607) Summary: I'm using RNN, which embeds RN view inside native view controllers. On iOS 13, a modal view controller is "floating" and is offset from the top of the screen. This causes the calculation of inset in `KeyboardAvoidingView` incorrect as it mixes local view controller coordinate space, with keyboard's screen coordinate space. ## Changelog [iOS] [Fixed] - Fixed `KeyboardAvoidingView` inset in embedded views (i.e modal view controllers on iOS 13) Pull Request resolved: https://github.com/facebook/react-native/pull/27607 Test Plan: 1. Tested before and after in a simple view controller (should stay the same) 2. Tested before and after in a modal view controller (should be offset before, and fixed after) 3. Repeated no. 2 with each device rotation (upsideDown, landscapeLeft, landscapeRight) Reviewed By: cpojer Differential Revision: D20812231 Pulled By: TheSavior fbshipit-source-id: fbd72739fb7152655028730e284ad26ff4a5da73 * Bump react-native-codegen to 0.0.2 Summary: Changelog: [Internal] Reviewed By: cpojer Differential Revision: D20843514 fbshipit-source-id: c611bf91d311c6ce8a7e469d267a0417b2ee58e5 * Rename ScrollViewSimpleExample Summary: Changelog: [Internal] - Rename ScrollViewSimpleExample in RNTester Reviewed By: fkgozali Differential Revision: D20846977 fbshipit-source-id: 397589cb0a17beaf37a25b91ad8efa4a2bc62358 * Remove console warnings for innerViewNode/Ref Summary: Remove these warnings until the methods in ScrollResponder have been moved into ScrollView, so that unactionable warnings aren't firing. Changelog: [General][Removed] Remove console warnings for innerViewNode/Ref in ScrollView Reviewed By: TheSavior Differential Revision: D20850624 fbshipit-source-id: ce90988e204c3cc3b93536842ec3caa12cf6994e * Make TurboModules dispatch method calls via native CallInvoker Summary: This diff: 1. Has ObjC NativeModules use the native `CallInvoker` to invoke JS -> native sync/async calls. 2. Integrates the native `CallInvoker` for each ObjC NativeModule with the bridge. This way, the bridge is informed of all JS -> native TurboModule method calls, and dispatches `onBatchComplete` appropriately. Changelog: [iOS][Fixed] Integrate ObjC TurboModules async method calls with the bridge Reviewed By: fkgozali Differential Revision: D20831545 fbshipit-source-id: da1cbb4ecef4cae85841ca7ef625ab8e380760cd * add ripple config object to Pressable (#28156) Summary: Motivation is to support ripple radius just like in TouchableNativeFeedback, plus borderless attribute. See https://github.com/facebook/react-native/pull/28009#issuecomment-589489520 In the current form this means user needs to pass an `android_ripple` prop which is an object of this shape: ``` export type RippleConfig = {| color?: ?ColorValue, borderless?: ?boolean, radius?: ?number, |}; ``` Do we want to add methods that would create such config objects - https://facebook.github.io/react-native/docs/touchablenativefeedback#methods ? ## Changelog [Android] [Added] - support borderless and custom ripple radius on Pressable Pull Request resolved: https://github.com/facebook/react-native/pull/28156 Test Plan: Tested locally in RNTester. I noticed that when some content is rendered after the touchables, the ripple effect is "cut off" by the boundaries of the next view. This is not specific to Pressable, it happens to TouchableNativeFeedback too but I just didn't notice it before in https://github.com/facebook/react-native/pull/28009. As it is an issue of its own, I didn't investigate that. ![pressable](https://user-images.githubusercontent.com/1566403/75098762-785f2200-55ba-11ea-8842-e648317610e3.gif) I changed the Touchable example slightly too (I just moved the "custom ripple radius" up to show the "cutting off" issue), so just for completeness: ![touchable](https://user-images.githubusercontent.com/1566403/75098763-81e88a00-55ba-11ea-9528-e0343d1e054b.gif) Reviewed By: yungsters Differential Revision: D20071021 Pulled By: TheSavior fbshipit-source-id: cb553030934205a52dd50a2a8c8a20da6100e23f * Make TurboModule creation thread-safe Summary: NativeModules can be created from any number of threads. In the legacy system, `ModuleHolder`, the class responsible for creating NativeModules, has built-in concurrency control to ensure that NativeModule creation is thread-safe. This diff introduces that thread-safety to the TurboModule infra. Basically, after this diff, if `n` threads race to create a TurboModule x, only the first thread will create x. All other threads will wait until x is created. Changelog: [Android][Fixed] - Make TurboModule creation thread-safe Reviewed By: mdvacca Differential Revision: D20659799 fbshipit-source-id: 2b720fe1ea49e40ae0d6dae50d422f23a6f45520 * Remove unused fields from error dialog Summary: Removed in https://github.com/facebook/react/pull/18487 Changelog: [React Core] Logging changes Reviewed By: gaearon Differential Revision: D20853086 fbshipit-source-id: 4b0002f21269f415769a2ac8305ba5750245f7d1 * Fix crash when enabling Performance Monitor on iOS 13.4 (#28512) Summary: This PR fixes a crash when opening the Performance Monitor on iOS 13.4. Detailed info: https://github.com/facebook/react-native/issues/28414 ## Changelog `[iOS] [Fixed] - Fix crash when enabling Performance Monitor on iOS 13.4` ## How This PR prevents the JavaScriptCore option from being set altogether. This ensures that the performance monitor keeps working, but on iOS 13.4 and higher, it will no longer crash trying to show the GC usage. Pull Request resolved: https://github.com/facebook/react-native/pull/28512 Test Plan: Tested on iOS 13.4 (simulator): ![image](https://user-images.githubusercontent.com/6184593/77903803-c6370c00-7283-11ea-8b71-b6b6546c82f6.png) Tested on iOS 13.1 (simulator) ![image](https://user-images.githubusercontent.com/6184593/77903499-41e48900-7283-11ea-9d14-83f67a3b7b77.png) - Verified that the `setOption` was called, but the Performance Monitor didn't show any GC usage regardless. - Identical PR https://github.com/expo/react-native/pull/21 has been shipped and tested in Expo Client 37 Fixes https://github.com/facebook/react-native/issues/28414 Reviewed By: PeteTheHeat Differential Revision: D20851131 Pulled By: TheSavior fbshipit-source-id: ff96301036e8487db59f95947bbe6841fe230e1e * Modify warning message (#28514) Summary: Modify deprecation warning message for `AccessibilityInfo.fetch` - https://reactnative.dev/docs/accessibilityinfo#isscreenreaderenabled - https://github.com/facebook/react-native/commit/523ab8333800afbfb169c6fd70ab6611fe07cc2a ## Changelog [Internal] [Changed] - Modify deprecation warning message for `AccessibilityInfo.fetch` Pull Request resolved: https://github.com/facebook/react-native/pull/28514 Test Plan: Try using `AccessibilityInfo.fetch` and check log Reviewed By: cpojer Differential Revision: D20850223 Pulled By: TheSavior fbshipit-source-id: e21bb20b7a02d9f2ed6e27e2bfecbac0aebf9e09 * Set _borderLayer.frame when border changes Summary: Changelog: [Internal] Setting `_borderLayer.frame` inside `-[RCTViewComponentView layoutSubviews]` causes unwanted animation because it is not wrapped in `CATransaction`. Moving it to `-[RCTViewComponentView updateLayoutMetrics]` which is called inside `CATransaction`. Reviewed By: shergin Differential Revision: D20836890 fbshipit-source-id: 2048a25fd2edb8109f6275c1186c0adae4b9f504 * Add API for getting sourceURL directly from ReactContext Summary: In bridgeless mode, the CatalystInstance doesn't exist, but we still need to be able to access the sourceURL in SourceCodeModule (which is needed to render the images in LogBox warnings and errors). This diff adds a new API for getting the sourceURL directly from ReactContext, instead of having to call context.getCatalystInstance().getSourceURL(), and updates SourceCodeModule to use it. Changelog: [Internal] Reviewed By: RSNara Differential Revision: D20848700 fbshipit-source-id: 3ecda81a17121178b76bbb3e9b0f27f103c1961a * imp: Remove unused `npx` reference (#28544) Summary: Recently we removed `npx` usage from `react-native-cli` flow. After checking usages in this repo I found unused reference. ## 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] [Removed] - Remove unused `npx` reference Pull Request resolved: https://github.com/facebook/react-native/pull/28544 Test Plan: Tests pass Reviewed By: cpojer Differential Revision: D20873090 Pulled By: hramos fbshipit-source-id: 12e05e9635a83f19439024766817e4599320af98 * Add debug logs to track down T62192299 exception source Summary: Add debug logs to track down T62192299 exception source Changelog: [Internal] Reviewed By: RSNara Differential Revision: D20878063 fbshipit-source-id: 94acd56c45d4b529a695d1b4d2bfd10d8f725e63 * Back out "Fixed scrollview inset when RN view is embedded in another view" Summary: Original commit changeset: fbd72739fb71 Changelog: Back out "[react-native][PR] Fixed scrollview inset when RN view is embedded in another view" Reviewed By: TheSavior Differential Revision: D20878607 fbshipit-source-id: 0d77b9fb08c637f7894c399a219a242e472b0700 * Fail silently in AppStateModule.sendEvent if CatalystInstance is not available Summary: According to our logs, 80% of these warnings are coming from AppStateModule. It's not particularly interesting or surprising that the CatalystInstance would be torn down when there's some app event, so let's stop taking up DB space with a useless message. Reviewed By: ejanzer, mdvacca Differential Revision: D20879426 fbshipit-source-id: b1182461aed4a66d82cb34bbd4b12782af6ed7b3 * Move DebugEnvironment helper to open source Summary: This is an internal only module that we use to detect whether we are in async debugging mode. Changelog: [Internal] Reviewed By: yungsters Differential Revision: D20879780 fbshipit-source-id: 5915f4e1c54a3fda0cf607c77f463120264fdbc4 * Fix Appearance module when using Chrome Debugger Summary: The appearance module uses sync native module methods which doesn't work with the chrome debugger. This broke in 0.62: https://github.com/facebook/react-native/issues/26705 This fix makes the appearance module return 'light' when using the chrome debugger. Changelog: [Fixed] Appearance `getColorScheme` no longer breaks the debugger Reviewed By: yungsters Differential Revision: D20879779 fbshipit-source-id: ad49c66226096433bc9f270e004ad4a6f54fa8c2 * Extend Android ImageViewManager to support analyticsTag prop Summary: This diff extends the Android Image View manager to support the new analyticsTag prop. this prop is going to be used to track performance for images in android changelog: [Android][Added] Add analyticsTag prop into ImageView component Reviewed By: JoshuaGross Differential Revision: D20880602 fbshipit-source-id: e302e8fa83706e6517b228d44a3094a1686830f7 * Extend Image.android to support analyticsTag prop Summary: Quick diff to extend Image.android component to support analytics tag prop changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D20880601 fbshipit-source-id: 99bc11f36ce46953c00480f7c8d628cf6c0a9263 * Create ImageContext object to allow udpating the analyticsTag prop for RN sections Summary: As part of this diff I create the new ImageContext object that will be used to allow the update of the analyticsTag prop for components that contain multiple images in their view hierarchy changelog: [JS][Added] Add ImageContext object, this object can be used to update the Imageview's analyticsTag prop on RN components that contain multiple images in their view hierarchy Reviewed By: JoshuaGross Differential Revision: D20880603 fbshipit-source-id: f2094bfd3ab1c867cf7c107e678a098aab7e94a8 * Ez cleanup in ImageProps Summary: Ez cleanup in ImageProps, this import is not being used anymore changelog: [internal] internal change Reviewed By: JoshuaGross Differential Revision: D20880600 fbshipit-source-id: 7d903b5a6e16c37e61dec661b6bd1f9a6b442cc3 * Exclude all FlipperKit transitive dependencies from iOS Release builds (#28504) Summary: The `:configuration` option from `pod` only affects the specified pod and not its dependencies [1]. Therefore in order to avoid all transitive dependencies being linked in the resulting Release IPA we need to list them in the `Podfile`. Note that this will still build Flipper's pods when doing a Release, but it won't link it in the resulting IPA. [1] https://guides.cocoapods.org/syntax/podfile.html#pod Fixes https://github.com/react-native-community/upgrade-support/issues/28 Related https://github.com/CocoaPods/CocoaPods/issues/9658 ## Changelog * [iOS] [Fixed] - Exclude Flipper from iOS Release builds Pull Request resolved: https://github.com/facebook/react-native/pull/28504 Test Plan: Create a new React Native 0.62 project, run `pod install`, then diff: ``` ProjectName/ios/Pods/Target Support Files/Pods-ProjectName/Pods-ProjectName.debug.xcconfig` ``` and ``` ProjectName/ios/Pods/Target Support Files/Pods-ProjectName/Pods-ProjectName.relaese.xcconfig ``` ![image](https://user-images.githubusercontent.com/855995/78337679-a3fa0280-7591-11ea-8142-6f82cbc6be58.png) Reviewed By: passy Differential Revision: D20894406 Pulled By: priteshrnandgaonkar fbshipit-source-id: 680780f0f5a85fd8423b85a271a499bd12f06d00 * Fix crash in FabricUIManager.onMeasure Summary: Changelog: [Internal] The cause of crash was `NullPointerException`, which happened because of `mReactContextForRootTag.get(rootTag)` returning `null`. This is solved by checking whether it returns `null` before passing it to `I18nUtil`. Reviewed By: mdvacca Differential Revision: D20890623 fbshipit-source-id: c884c6838b83b944a5438375a4c060c1f5b1dc6e * Fix flow types of ImageContext Summary: ez diff to Fix flow types of ImageContext changelog: [internal] internal change to update flow types of ImageContext Reviewed By: TheSavior Differential Revision: D20883647 fbshipit-source-id: 6dba83ab431e56a71f96c39005ebcccf39a7da9a * Avoid passing analyticsTag prop to native if this is set to null Summary: This diff avoids passing the analyticsTag prop to native if this is set to null changelog: [internal] internal optimization Reviewed By: TheSavior Differential Revision: D20904498 fbshipit-source-id: f1ea1e5aa3199ef073668df86ca7cf6e20f70c5b * Rename analyticsTag -> internal_analyticsTag in ImageView component Summary: This diff renames the analyticsTag prop for the intenral_analyticsTag in ImageView component changelog: [internal] Creation of internal_analyticTag prop in ImageView, for now this prop is meant to be used internally. Reviewed By: TheSavior Differential Revision: D20904497 fbshipit-source-id: 2a28f746772ee0f9d657ec71549020c1f3e9d674 * Make Vibration.vibrate compatible with TurboModules (#27951) Summary: This PR fixes a compatibility issue with the Vibration module and TurboModules. The TurboModules spec doesn't allow nullable arguments of type Number, causing the following problem: ![IMG_3758](https://user-images.githubusercontent.com/1247834/73803879-10be6f80-4790-11ea-92d4-a008f0007681.PNG) ## Changelog [iOS] [Fixed] - Make Vibration library compatible with TurboModules. Pull Request resolved: https://github.com/facebook/react-native/pull/27951 Test Plan: Just submitted a PR to my own app to fix the issue [here](https://github.com/rainbow-me/rainbow/pull/340) The problem should be reproducible on RNTester due to this line: https://github.com/facebook/react-native/blob/91f139b94118fe8db29728ea8ad855fc4a13f743/RNTester/js/examples/Vibration/VibrationExample.js#L66 and should be working on this branch. Reviewed By: TheSavior Differential Revision: D19761064 Pulled By: hramos fbshipit-source-id: 84f6b62a2734cc09d450e906b5866d4e9ce61124 * Fix Cocoapods builds Summary: ## Problem For some reason, D20831545 broke the `use_frameworks!` build of RNTester. ## Building RNTester ``` pushd ~/fbsource/xplat/js/react-native-github/RNTester && USE_FRAMEWORKS=1 pod install && open RNTesterPods.xcworkspace && popd; ``` ## Error I built RNTester locally, and the error was this: ``` Undefined symbols for architecture x86_64: "facebook::jsi::HostObject::set(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&, facebook::jsi::Value const&)", referenced from: vtable for facebook::react::ObjCTurboModule in RCTImageEditingManager.o vtable for facebook::react::ObjCTurboModule in RCTImageLoader.o vtable for facebook::react::ObjCTurboModule in RCTImageStoreManager.o "facebook::jsi::HostObject::getPropertyNames(facebook::jsi::Runtime&)", referenced from: vtable for facebook::react::ObjCTurboModule in RCTImageEditingManager.o vtable for facebook::react::ObjCTurboModule in RCTImageLoader.o vtable for facebook::react::ObjCTurboModule in RCTImageStoreManager.o ld: symbol(s) not found for architecture x86_64 ``` ## Fix It looked like libraries that depend on "ReactCommon/turbomodule/core" weren't linking to JSI correctly. So, I modified all such Podspecs to also depend on "React-jsi": ``` arc rfr ' s.dependency "ReactCommon/turbomodule/core", version' ' s.dependency "ReactCommon/turbomodule/core", version\n s.dependency "React-jsi", version' ``` This seemed to do the trick. In buck, we'd fix this problem using exported_dependencies. I skimmed through cocoapods, and couldn't find such a configuration option there. So, I guess this will have to do? Changelog: [iOS][Fixed] - Fix Cocoapods builds of RNTester Reviewed By: fkgozali, hramos Differential Revision: D20905465 fbshipit-source-id: 60218c8274ec165752a428f2a7a9a546607c8fec * Add minimumSize to RCTRootView & RCTRootShadowView Summary: This adds a `minimumSize` property to RCTRootView, and forwards any changes to it's shadow view. This **does not** change any default behaviour, as the default minimum size is `CGSizeZero` before & after this diff. Changelog: [iOS][Internal] Add minimumSize to RCTRootView & RCTRootShadowView Reviewed By: RSNara Differential Revision: D20905456 fbshipit-source-id: a03f880e782891f60ef86b9c898965e05a5e796e * Make RCTNativeAnimatedModule into a TurboModule Summary: D20831545 integrated TurboModules with the bridge's `onBatchComplete` event. This fixed the RCTNativeAnimatedModule jank, so I'm re-converting RCTNativeAnimatedModule into a TurboModule. Changelog: [iOS][Fixed] - Make RCTNativeAnimatedModule TM-compatible Reviewed By: PeteTheHeat Differential Revision: D20850744 fbshipit-source-id: bb85a1bb27963e7d39bf149d0a3d7b71c88175da * upgrade to flow 0.122.0 Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D20919782 fbshipit-source-id: 3d5dc54ea4daafb8a1d96cad6c35a2dab4c24097 * Switch order of onSelectionChange and onChange events send from native Summary: Changelog: [Internal] UIKit uses either `UITextField` or `UITextView` as its UIKit element for `<TextInput>`. `UITextField` is for single line entry, `UITextView` is for multiline entry. There is a problem with order of events when user types a character. In `UITextField` (single line text entry), typing a character first triggers `onChange` event and then `onSelectionChange`. JavaScript depends on this order of events because it uses `mostRecentEventCount` from this even to communicate to native that it is in sync with changes in native. In `UITextView` (multi line text entry), typing a character first triggers `onSelectionChange` and then `onChange`. As JS depends on the correct order of events, this can cause issues. An example would be a TextInput which changes contents based as a result of `onSelectionChange`. Those changes would be ignored as native will throw them away because JavaScript doesn't have the newest version. Reviewed By: JoshuaGross Differential Revision: D20836195 fbshipit-source-id: fbae3b6c0d388fc059ca2541ae980073b8e5f6c7 * Maintain selection and cursor location when setting string on TextInput Summary: Changelog: [Internal] Calling `_backedTextInputView.attributedText = attributedString` causes cursor to be moved to the end of text input. This applies to both, `UITextField` and `UITextView`. This is not desired as when JS sets a new text, we don't want the cursor to be moved to the end of text input. JS has the option to use view commands if it wishes to move cursor somewhere. Reviewed By: JoshuaGross Differential Revision: D20836201 fbshipit-source-id: 9234e54cfbc5fc206f723626988e505275788aae * Implement event count for TextInput Summary: Changelog: [Internal] Implementation of event count for Fabric's Text input. Reviewed By: JoshuaGross Differential Revision: D20800185 fbshipit-source-id: 988692cb2fc786649821cccb06e629b40b9b0479 * Migrate setNativeProps to commands in iOS text input Summary: Changelog: Move from setNativeProps to ViewCommands. Reviewed By: JoshuaGross Differential Revision: D20843018 fbshipit-source-id: 9be9d2bbee01f2e15279e3c3ae785c1a5b163765 * Update default Podfile to not depend on a path (#28572) Summary: Recently, a default Podfile has been modified to not contain all the React Native pods, but use a helper method `use_react_native!`. While this is great, it assumes a hardcoded path of `../node_modules/react-native` to be always the correct location of the React Native. https://github.com/facebook/react-native/blob/d4d8887b5018782eeb3f26efa85125e6bbff73e4/scripts/autolink-ios.rb#L7-L9 Unfortunately, due to the way Ruby works, this completely hides the path away from the users. Before, they could have seen the wrong path explicitly in a Podfile and knew to update it to resolve path-related issues. With the current version in `master`, I can see a lot of issues where developers wonder how to resolve the path issues and how to pass the path itself. https://github.com/facebook/react-native/blob/4118d798265341061105f3a53550db83c66a71cb/template/ios/Podfile#L5-L10 This PR uses React Native CLI configuration (that is already used to link 3rd party dependencies) to explicitly define the correct path to the React Native. As a result, we don't have to change the paths here whether we're running monorepo or not. ## Changelog [IOS] [INTERNAL] - Always provide an explicit path to React Native Pull Request resolved: https://github.com/facebook/react-native/pull/28572 Differential Revision: D20945194 Pulled By: TheSavior fbshipit-source-id: 010f9754f2ed78ef62fd52f4d201f296f5af6d27 * chore: update CLI * fix: do not throw on missing `cliPath`, use the default value (#28625) Summary: The `cliPath` has always been optional value and in fact, even had its default value hardcoded in the React gradle file. In this PR, I am just taking use of it and remove throwing an error, which is going to be a really annoying breaking change. ## Changelog [ANDROID] [INTERNAL] - Don't require `cliPath` Pull Request resolved: https://github.com/facebook/react-native/pull/28625 Test Plan: Run Android project, everything works. Provide custom `cliPath`, it gets respected Reviewed By: cpojer Differential Revision: D21044222 Pulled By: TheSavior fbshipit-source-id: 8029f988d92abb9f64f30e05932c0d407d0c997e * chore: remove Kotlin version from the default template * (eslint-config) update community eslint plugin in eslint config (#28642) Summary: Updating the community eslint-plugin used in the eslint-config to the latest version. expecting new eslint-config version to be released with this change so that it can be included in new project template for 0.63 https://github.com/react-native-community/releases/issues/186 ## 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] - Update community eslint plugin in the eslint config Pull Request resolved: https://github.com/facebook/react-native/pull/28642 Test Plan: yarn lint passes Differential Revision: D21048976 Pulled By: cpojer fbshipit-source-id: 2c3ec0ef450cf357d8c88db7873f4ca1154b2034 * [0.63.0-rc.0] Bump version numbers * Upgrade Hermes dependency to 0.5.0 Summary: Use the latest published release of hermes-engine. Update RN to invoke `hermesc` instead of `hermes`. Changelog: [Android] [Changed] - Upgraded to Hermes 0.5.0 allow-large-files Reviewed By: mhorowitz Differential Revision: D20998564 fbshipit-source-id: 4824e273bcb044029a5a7e9379f168d3da47da50 * Remove the post install step (#28651) Summary: Removes the post install step for Flipper, as the latest version of YogaKit is compatible with swift 5. cc alloy ## 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 --> [Flipper] [Template] - Remove the post install step for Flipper Pull Request resolved: https://github.com/facebook/react-native/pull/28651 Test Plan: Tested a newly created RN app without post install step and it built successfully. Reviewed By: passy Differential Revision: D21064653 Pulled By: priteshrnandgaonkar fbshipit-source-id: da56d0754d918e30a0ebe480c77590f0139d48ac * Allow iOS PlatformColor strings to be ObjC or Swift UIColor selectors (#28703) Summary: Per discussion in https://github.com/react-native-community/releases/issues/186 the iOS `PlatformColor()` function is documented to use the semantic color names provided by the system. The referenced HIG documentation itself links to the `UIColor` documentation for semantic colors names. However, these names differ depending on if you are viewing the new Swift API docs or the Objective C docs. The current Objective C implementation in react-native assumes Objective C UIColor selector names that are suffixed 'Color'. But in Swift, Apple provides a Swift Extension on UIColor that makes aliases without the the 'Color' suffix and then makes the original selectors invalid presumably via `NS_UNAVAILABLE_SWIFT`. Since both selector names are valid depending on if you are using Objective C or Swift, let's make both forms be legal for `PlatformColor()`. In `RCTConvert.m` there is a dictionary of legal selector names. The code already supports the ability to have names be aliases of other selectors via a RCTSelector metadata key. The change adds code to the initialization of the map: it iterates over the keys in the map, which are all ObjC style UIColor selectors, and creates aliases by duplicating the entries, creating key names by stripping off the ObjC "Color" suffix, adds the RCTSelector key referring to the original and then appends these new Swift aliases to the map. ## Changelog [iOS] [Changed] - Allow iOS PlatformColor strings to be ObjC or Swift UIColor selectors Pull Request resolved: https://github.com/facebook/react-native/pull/28703 Test Plan: The PlatformColorExample.js is updated to use the new, shorter Swift selector names. There are still other examples in the same file and in unit tests that exercise the ObjC selector names. <img width="492" alt="PlatformColor" src="https://user-images.githubusercontent.com/30053638/79809089-89ab7d00-8324-11ea-8a9d-120b92edeedf.png"> Reviewed By: shergin Differential Revision: D21147404 Pulled By: TheSavior fbshipit-source-id: 0273ec855e426b3a7ba97a87645859e05bcd4126 * Fix folly::dynamic crash when attaching a debugger to Hermes Summary: folly_futures was compiled with and exported -DFOLLY_MOBILE=1, while folly_json did not. This flag disables fancy F14 data structures for folly::dynamic in favor of a simple std::unordered_map. This caused inlined/templated code from modules depending on folly_futures to disagree with the implementations in folly_json, leading to a crash. The only such libraries were libhermes-inspector and (transitively) libhermes-executor-debug, and these only use folly::dynamic for CDP serialization, which is why the problem was not more apparent. Changelog: [Internal] Fix crash when attaching a Hermes debugger Reviewed By: mhorowitz Differential Revision: D21193307 fbshipit-source-id: 2b795bb6f4f7f991e2adaacec62d62616117322b * Update react.gradle (#28776) Summary: Running `./gradlew assembleRelease` fails as the path to the CLI contains a new line at the end. We don't run this command in `debug` mode, hence it passed the testing. My bad. Fixed, checked in both `debug` with `bundleInDebug: true` and `release`. Fixes https://github.com/facebook/react-native/issues/28700 ## Changelog [INTERNAL] [ANDROID] - Fix `React.gradle` to build Android apps in production Pull Request resolved: https://github.com/facebook/react-native/pull/28776 Test Plan: Running `./gradlew assembleRelease` works Reviewed By: hramos Differential Revision: D21287789 Pulled By: TheSavior fbshipit-source-id: dc3ec8eef7a919b072b562d2bd455e2f704bc083 * Revert D21064653: Remove the post install step Differential Revision: D21064653 Original commit changeset: da56d0754d91 fbshipit-source-id: 1086cfdeca9aa3830370ea115ba7b5f05d3fb124 * Bump @react-native-community/eslint-config in new app template Summary: Changelog: [Changed][General] Update react-native-community/eslint-config to 1.1.0, adding the new color rule Reviewed By: rickhanlonii Differential Revision: D21342153 fbshipit-source-id: ac1367353d4d3e69b6df29dc16f9fcb60cde3519 * [0.63.0-rc.1] Bump version numbers * Upgrade Flipper to 0.37.0 (#28545) Summary: Bump flipper to 0.37 for both iOS and Android [Android] [Changed] - Upgrade Flipper to 0.37.0 [iOS] [Changed] - Upgrade Flipper to 0.37.0 Pull Request resolved: https://github.com/facebook/react-native/pull/28545 Test Plan: RNTester build pass Reviewed By: rickhanlonii Differential Revision: D20930069 Pulled By: hramos fbshipit-source-id: a7cb719da3e51e6a42d27d5e64bc664398d0d3c5 * Enable with CocoaPods `:configuration` (#28796) Summary: ~~⚠️ Depends on https://github.com/facebook/flipper/pull/1086 and a new Flipper release.~~ Fixes https://github.com/facebook/react-native/commit/17f025bc26da13da795845a3f7daee65563420c0#commitcomment-38831234 Currently user’s are being told to add a definition of the `FB_SONARKIT_ENABLED` macro and examples, including those in stock React Native templates, set this for the user by making use of a `post_install` hook in the user’s `Podfile`. This leads to confusion, fragile code [when a user’s project dir structure deviates from vanilla], and is ultimately not necessary as CocoaPods already has dedicated mechanisms to: * specify build settings (through the `xcconfig` property); * and selectively include certain pods only in certain build configurations (e.g. debug). ## 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] [Changed] - Entirely control Flipper being enabled through inclusion in Podfile and optionally limiting to certain build configurations using the `:configuration` directive. Pull Request resolved: https://github.com/facebook/react-native/pull/28796 Test Plan: Tested using the changes of https://github.com/facebook/flipper/pull/1086 in a new app that uses RN `master`. Reviewed By: priteshrnandgaonkar Differential Revision: D21449754 Pulled By: passy fbshipit-source-id: 9ff7c7f4ffc32b364b1edd82b94e0b80c3997625 * Pressable: Rename pressRectOffset to pressRetentionOffset to be consistent with other touchables Summary: Text and the other Touchables have this prop called pressRetentionOffset. Pressable should be consistent with that. Changelog: [Breaking][General]: Pressable: Rename pressRectOffset to pressRetentionOffset to be consistent with other touchables Reviewed By: yungsters Differential Revision: D21552255 fbshipit-source-id: 31e64bad9e48ac98e4934dd2f4c0a7f526de5cb6 * iOS: Fix Animated image crash when CADisplayLink target in RCTWeakProxy is nil Summary: When self is nil, this may crash in RCTUIImageViewAnimated.m. ``` _displayLink = [CADisplayLink displayLinkWithTarget:[RCTWeakProxy weakProxyWithTarget:self] selector:selector(displayDidRefresh:)]; ``` Replace `RCTWeakProxy` with a concrete class `RCTDisplayWeakRefreshable` that has the displayDidRefresh method, that calls the displayDidRefresh method in its weak target. https://github.com/facebook/react-native/pull/28070#issuecomment-619295254 Changelog: [iOS] [Fixed] - Fix Animated image crash when CADisplayLink target in RCTWeakProxy is nil Reviewed By: shergin Differential Revision: D21419385 fbshipit-source-id: da7c3c38f81ea54f633da7f59359e07680ea2faf * Pressable: Add Support for Inspector Overlay Summary: Adds support for the debug overlay (enabled via the Inspector) that the legacy touchable components supported. Changelog: [General][Added] - Added Inspector overlay support for Pressable Reviewed By: TheSavior Differential Revision: D21614412 fbshipit-source-id: b884e04f8dba1bfd35e61de25d33d6d47bc34b03 * Changed iOS LaunchScreen from xib to storyboard (#28239) Summary: > Starting April 30, 2020, all apps submitted to the App Store must use an Xcode storyboard to provide the app’s launch screen and all iPhone apps must support all iPhone screens. Updated iOS Launch screen as per [App Store policy change](https://developer.apple.com/news/?id=03042020b). Community discussion: https://github.com/react-native-community/discussions-and-proposals/issues/209 ## Changelog Changed iOS Launch Screen from a `xib` to `storyboard`. The `LaunchScreen.xib` file has been replaced with `LaunchScreen.storyboard`. Xcode automatically picks up the new Launch Screen no additional change is required. [iOS] [Deleted] - Deleted LaunchScreen.xib [iOS] [Added] - Added LaunchScreen.storyboard Pull Request resolved: https://github.com/facebook/react-native/pull/28239 Test Plan: Build the Xcode project under `template/iOS` and verify that the new launch screen is identical to the previous one. Reviewed By: cpojer Differential Revision: D20408892 Pulled By: hramos fbshipit-source-id: 9c38df58d1304088a23f3d73e0fbd87675804f1a * Fix debugging on android for 0.63 (#29204) Summary: Currently on react native 0.63-rc.0 and 0.63-rc.1 enabling debugging throws an exception. It looks like something may have been missed in unregistering JSDevSupport in this commit c20963e ![crash](https://user-images.githubusercontent.com/14797029/85500252-2acae400-b5b1-11ea-938a-674b55e649b2.gif) This should fix https://github.com/facebook/react-native/issues/28746 and https://github.com/facebook/react-native/issues/29136 ## Changelog [Android] [Fixed] - Fix crash when enabling debug Pull Request resolved: https://github.com/facebook/react-native/pull/29204 Test Plan: To recreate the bug: npx react-native init RN063 --version 0.63.0-rc.1 react-native start react-native run-android Enable debug mode from react native dev menu After this commit, the crash no longer occurs ![non crash](https://user-images.githubusercontent.com/14797029/85500241-269ec680-b5b1-11ea-8cfe-85bfda4dd222.gif) Reviewed By: TheSavior Differential Revision: D22395406 Pulled By: RSNara fbshipit-source-id: 046df77ae1c1de96870fb46f409d59e7d6a68c0d * [0.63.0] Bump version numbers * Add ProGuard rule for hermes (#28571) Summary: This adds a ProGuard for `hermes` rule so it does not have to be added by users manually. https://github.com/facebook/react-native/issues/28270 ## 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 --> [Android] [Added] - ProGuard rule for hermes Pull Request resolved: https://github.com/facebook/react-native/pull/28571 Test Plan: 1. Create a project with/without hermes. 2. Enable proguard. Reviewed By: cpojer Differential Revision: D20947095 Pulled By: hramos fbshipit-source-id: 79b166ad2dd060f20041d9f5cfe2f794c754843d * Fix rounded border drawing when border-radius is smaller than border-width (#28358) Summary: This PR fixes the drawing of the border rounded edges when the border-radius is small than the border-width. The current implementation capped the possible border-radius making it impossible to set smaller border-radii when using thicker borders. After inspection it was found that the rounded-rect calculation is incorrect. ## Changelog `[Android] [Fixed] - Fix rounded border-drawing when border-radius is smaller than border-width` Pull Request resolved: https://github.com/facebook/react-native/pull/28358 Test Plan: **Faulty situation:** As you can see, when the border-radius becomes very low, the border is stuck at a minimum value. Only after setting the border-radius fully to 0 is it again rendered correctly. ![ezgif com-video-to-gif (2)](https://user-images.githubusercontent.com/6184593/77183540-c3435b00-6ace-11ea-950d-29a0ea1757bd.gif) **After the fix:** ![ezgif com-video-to-gif (3)](https://user-images.githubusercontent.com/6184593/77183619-e837ce00-6ace-11ea-93a5-910127d352b7.gif) Differential Revision: D21124739 Pulled By: shergin fbshipit-source-id: cefd1776b77b5b9fb335e95fd7fdd7f345579dc4 * Fix border-stroke drawing after resetting border-radius (#28356) Summary: This PR fixes incorrect drawing of the View borders on Android, after changing the border-radius back to 0 *(and when no background-color is defined)*. This happens because the `drawRoundedBackgroundWithBorders` function in ReactViewBackgroundDrawable changes the style on the Paint object to `STROKE`. This style is however never reverted back to `FILL`. This change ensures that the Paint style is set to `FILL` for the full execution of the `drawRectangularBackgroundWithBorders` function. ## Changelog `[Android] [Fixed] - Fix border-drawing when changing border-radius back to 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28356 Test Plan: **Faulty situation:** ![ezgif com-video-to-gif](https://user-images.githubusercontent.com/6184593/77153163-9759b280-6a99-11ea-82bb-33a1e0a4934c.gif) **After the fix:** ![ezgif com-video-to-gif (1)](https://user-images.githubusercontent.com/6184593/77153825-c91f4900-6a9a-11ea-8e0c-a4280b9e72b8.gif) Differential Revision: D21124741 Pulled By: shergin fbshipit-source-id: 2044f8e8ad59a58df42b64d7ee8c4ad1d3b562f1 * Fixes TextInput shaking when typing Chinese (#28805) Summary: Fixes https://github.com/facebook/react-native/issues/28488. ## Changelog [iOS] [Fixed] - Fixes TextInput shaking when typing Chinese Pull Request resolved: https://github.com/facebook/react-native/pull/28805 Test Plan: Demo see https://github.com/facebook/react-native/issues/28488. Differential Revision: D21376803 Pulled By: shergin fbshipit-source-id: b1fe6cc5f67d42ef98a6c12b8ab9990feac0e2a7 * Set black as default text color for <TextInput/> on iOS (#28708) Summary: This is a follow-up pull request to https://github.com/facebook/react-native/issues/28280 (reviewed by shergin). This pull request tried to solve the problem of the default color in a TextInput in dark mode on iOS being white instead of black. I got suggested to solve the problem not on the level of RCTTextAttributes, but on the level of RCTUITextField. Setting `self.textColor = [UIColor black];` in the constructor did not work, because it gets overwritten by nil in `RCTBaseTextInputView.m`. There I implemented the logic that if NSForegroundColorAttributeName color is nil then the color is being set to black. I think the `defaultTextAttributes` property confuses here, because it ends up being the effective text attributes, e.g. if I unconditionally set the default text color to black, it cannot be changed in React Native anymore. So I put the nil check in. ## Changelog [iOS] [Fixed] - TextInput color has the same default (#000) on iOS whether in light or dark mode Pull Request resolved: https://github.com/facebook/react-native/pull/28708 Test Plan: I have manually tested the following: - The default text color in light mode is black - The default text color in dark mode is black - The color can be changed using the `style.color` attribute - Setting the opacity to 0.5 results in the desired behavior, the whole TextInput becoming half the opacity. – Setting the `style.color` to rgba(0, 0, 0, 0.5) works as intended, creating a half-opaque text color. Differential Revision: D21186579 Pulled By: shergin fbshipit-source-id: ea6405ac6a0243c96677335169b214a2bb9ccc29 * Enable array buffers in JSCRuntime.cpp (#28961) Summary: The JavaScriptCore implementation of JSI [does not currently support array buffers](https://github.com/facebook/react-native/blob/master/ReactCommon/jsi/JSCRuntime.cpp#L925-L943). The comments in the code suggest the JSC version used by React Native does not work with array buffers, but this seems to be out of date since the current version of JSC used by React Native does indeed support array buffers. This change just enables array buffers in JSCRuntime.cpp. NOTE: See https://github.com/react-native-community/discussions-and-proposals/issues/91#issuecomment-632371219 for more background on this change. ## Changelog [General] [Added] - Support for array buffers in the JavaScriptCore implementation of JSI Pull Request resolved: https://github.com/facebook/react-native/pull/28961 Test Plan: To test these changes, I just made some temporary changes to RNTester to use JSI to inject a test function into the JS runtime that reads from and writes to an array buffer, and call that function from the JS of the RNTester app (see https://github.com/ryantrem/react-native/commit/28152ce3f4ae0fa906557415d106399b3f072118). For the JS side of this, specifically look at https://github.com/ryantrem/react-native/blob/28152ce3f4ae0fa906557415d106399b3f072118/RNTester/js/RNTesterApp.android.js#L13-L18 For the native side of this, specifically look at https://github.com/ryantrem/react-native/blob/28152ce3f4ae0fa906557415d106399b3f072118/RNTester/android/app/src/main/cpp/JSITest.cpp#L22-L38 Reviewed By: shergin Differential Revision: D21717995 Pulled By: tmikov fbshipit-source-id: 5788479bb33c24d01aa80fa7f509e0ff9dcefea6 * Fix font variant crash on Android < 4.4 (#29176) Summary: In RN 0.62 support for `fontVariant` was added on Android. Using that prop crashes the app on Android below KitKat (4.3 and below) To reproduce just add any Text with the `fontVariant` styling prop in the app: ```js <Text style={{fontVariant: ['tabular-nums']}}>This will crash</Text> ``` It will crash any device running Android below KitKat with the error: ![image](https://user-images.githubusercontent.com/4534323/85073452-18206b80-b1bb-11ea-8d7e-96f27fa1a320.png) This is caused by `java.utils.Objects` only being available on Android 4.4+ ## Changelog [Android] [Fixed] - Fix font variant crash on Android < 4.4 Pull Request resolved: https://github.com/facebook/react-native/pull/29176 Test Plan: [TextUtils.equals](https://developer.android.com/reference/android/text/TextUtils#equals) was added as soon as API level 1, so no compatibility issue here. Tested on Emulator running Android 4.1, no crash anymore. I've searched for other occurences of `java.utils.Objects` in the project, and this was the only one, so no need to remove other occurences ✅ Reviewed By: JoshuaGross Differential Revision: D22337316 Pulled By: mdvacca fbshipit-source-id: 5507b21b237a725d596d47b5c01e269895b16d4a * Fix LogBox.ignoreAllLogs used with no argument (#29310) Summary: When you call `LogBox.ignoreAllLogs()` it should ignore logs. This fixes a bug that made this equivalent to `LogBox.ignoreAllLogs(false)` ## Changelog [General] [Fixed] - LogBox.ignoreAllLogs() should ignore logs Pull Request resolved: https://github.com/facebook/react-native/pull/29310 Test Plan: Added tests Reviewed By: TheSavior Differential Revision: D22448436 Pulled By: rickhanlonii fbshipit-source-id: 6ba12b9d9c1f29cf3ac503946ac5ca0097425a7a * Pressable: Minimum Press Duration Summary: When a `Pressable` has a configured (or the default) `delayPressIn` and no (or the default) `delayPressOut`, tapping very quickly can lead to intantaneous invocation of `onPressIn` and `onPressOut`. The end result is that users may never experience any intended visual press feedback. This changes `Pressable` to accept (and be preconfigured with a default) **minimum press duration**. The minimum press duration ensures that even if the press is released before `delayPressIn` has elapsed, `onPressOut` will still wait the remaining time up to `minPressDuration` before firing. Note that setting a non-zero `delayPressOut` is insufficient because if a user holds down on a `Pressable` for longer than `delayPressIn`, we still want `onPressOut` to fire immediately when the press is released. Changelog: [General][Changed] - Added `minPressDuration` to `Pressable`. Reviewed By: TheSavior Differential Revision: D21614708 fbshipit-source-id: 502f3d8ad6a40e7762435b6df16809c8798dd92c * chore: bring back script to org shape * [0.63.1] Bump version numbers * Exclude okhttp from flipper dependency (#29260) Summary: This fixes https://github.com/facebook/react-native/issues/28481. As explained in [this comment](https://github.com/facebook/react-native/issues/28481#issuecomment-645546195), the flipper network plugin pulls a more recent version of okhttp (3.14), but only versions of okhttp up to 3.12 works on Android API 21 and less. This prevented being able to run the app in debug mode, it was still working fine in release mode. ## 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 --> [Android] [Fixed] - Fix unable to run in debug mode on Android API < 21 Pull Request resolved: https://github.com/facebook/react-native/pull/29260 Test Plan: Using `yarn react-native run-android` the app would instantly crash with this error in `adb logcat`: ``` E/AndroidRuntime( 5079): java.lang.RuntimeException: Unable to create application com.awesometsproject.MainApplication: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created E/AndroidRuntime( 5079): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4154) E/AndroidRuntime( 5079): at android.app.ActivityThread.access$1300(ActivityThread.java:130) E/AndroidRuntime( 5079): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1255) E/AndroidRuntime( 5079): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 5079): at android.os.Looper.loop(Looper.java:137) E/AndroidRuntime( 5079): at android.app.ActivityThread.main(ActivityThread.java:4745) E/AndroidRuntime( 5079): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 5079): at java.lang.reflect.Method.invoke(Method.java:511) E/AndroidRuntime( 5079): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) E/AndroidRuntime( 5079): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) E/AndroidRuntime( 5079): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 5079): Caused by: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:90) E/AndroidRuntime( 5079): at com.facebook.react.ReactInstanceManager.<init>(ReactInstanceManager.java:238) E/AndroidRuntime( 5079): at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:281) E/AndroidRuntime( 5079): at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:87) E/AndroidRuntime( 5079): at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:39) E/AndroidRuntime( 5079): at com.awesometsproject.MainApplication.onCreate(MainApplication.java:47) E/AndroidRuntime( 5079): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:999) E/AndroidRuntime( 5079): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4151) E/AndroidRuntime( 5079): ... 10 more E/AndroidRuntime( 5079): Caused by: java.lang.reflect.InvocationTargetException E/AndroidRuntime( 5079): at java.lang.reflect.Constructor.constructNative(Native Method) E/AndroidRuntime( 5079): at java.lang.reflect.Constructor.newInstance(Constructor.java:417) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:80) E/AndroidRuntime( 5079): ... 17 more E/AndroidRuntime( 5079): Caused by: java.lang.NoClassDefFoundError: java.util.Objects E/AndroidRuntime( 5079): at okhttp3.CertificatePinner.withCertificateChainCleaner(CertificatePinner.java:231) E/AndroidRuntime( 5079): at okhttp3.OkHttpClient.<init>(OkHttpClient.java:238) E/AndroidRuntime( 5079): at okhttp3.OkHttpClient$Builder.build(OkHttpClient.java:1015) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevServerHelper.<init>(DevServerHelper.java:132) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerImpl.<init>(DevSupportManagerImpl.java:183) E/AndroidRuntime( 5079): ... 20 more W/ActivityManager( 1456): Force finishing activity com.awesometsproject/.MainActivity ``` With this fix, the app launch successfully in debug mode, without having to remove flipper altogether from our config. Reviewed By: passy Differential Revision: D22521109 Pulled By: mdvacca fbshipit-source-id: 3c0263642438bd7c0d09b045e15a933bd8a26734 * Send key when onKeyPress event is fired from TextInput Summary: Changelog: [Internal] In `onKeyPress` event, we were not returning `key` property. This diff adds `key` property to `onKeyPress` event and removes other, redundant properties from `onKeyPress` event. The implementation has been translated from Paper. Reviewed By: shergin Differential Revision: D21250411 fbshipit-source-id: f1e31381667acb9dec02d0b33883df8f8f5b2a4b * Calling Paper TextInput setTextAndSelection view command now dirties layout Summary: Changelog: [Internal] Previously `setTextAndSelection` was not dirtying layout. This would cause an issue where `setTextAndSelection` causes layout change. For example calling setTextAndSelection with empty string on a multiline auto expanding text input. I changed one example in TextInputSharedExamples.js, "Live Re-Write (no spaces allowed) and clear" example is now multiline. This allows to test whether `setTextAndSelection` dirties layout. Enter multiline string to to the example text input and press clear. Observe that the text input shrinks to single line height. Reviewed By: shergin Differential Revision: D21182990 fbshipit-source-id: de8501ea0b97012cf4cdf8d5f658649139f92da6 * Remove setMostRecentEventCount from TextInput view commands Summary: Changelog: [Internal] We don't use view command `setMostRecentEventCount`, let's get rid of it. Reviewed By: JoshuaGross Differential Revision: D21016600 fbshipit-source-id: 6491c063e9d6a89252300cb47c010b248e473f4b * Restore Previous Behavior for StyleSheet Validation of Null/Undefined Styles (#29171) Summary: https://github.com/facebook/react-native/issues/27264 changed stylesheet validation to avoid enumerating properties on the prototype of a style. It introduces a secondary behavior change, where null/undefined styles used to be tolerated but now lead to an exception. This is because `for in undefined` will noop where `for of Object.keys(undefined)` will throw. This scenario of undefined/null styles seems to actually show up in practice and was previously well tolerated. E.g. `Button.js` has code that looks like this: ```jsx const styles = StyleSheet.create({ button: Platform.select({ ios: {}, android: { elevation: 4, // Material design blue from https://material.google.com/style/color.html#color-color-palette backgroundColor: '#2196F3', borderRadius: 2, }, }), ``` For non ios/Android platforms, that creates a style object which looks like: ```js { button: undefined, ... } ``` This previously meant that the component would be unstyled if created, but now means out-of-tree platforms throw if the builtin Button component is required. This change restores the previous `for in` loop but adds a `hasOwnProperty` check to avoid properties on prototypes. ## Changelog [General] [Fixed] - Restore Previous Behavior for StyleSheet Validation of Null/Undefined Styles Pull Request resolved: https://github.com/facebook/react-native/pull/29171 Test Plan: Validated that importing Buttons will no longer cause an exception, and that invalid properties are still caught. Reviewed By: JoshuaGross Differential Revision: D22118379 Pulled By: TheSavior fbshipit-source-id: 650c64b934ccd12a3dc1b75e95debc359925ad73 * Set windowTranslucentNavigation to false (#29399) Summary: This fixes https://github.com/facebook/react-native/issues/29397. Without this, apps that specify `android:windowTranslucentNavigation` draw the `LogBox` buttons underneath the soft navigation bar, making the buttons unpressable. Before | After :-------------------------:|:-------------------------: <img src="http://ashoat.com/AndroidTranslucentNavigationLogBox.png" width="300" /> | <img src="http://ashoat.com/AndroidTranslucentNavigationLogBoxFixed.png" width="300" /> ## Changelog [Android] [Fixed] - Set LogBox windowTranslucentNavigation to false Pull Request resolved: https://github.com/facebook/react-native/pull/29399 Test Plan: I tested this change on the [repo](https://github.com/Ashoat/LogBoxTest) I set up to reproduce the issue. I set it up to [build `ReactAndroid` from source](https://github.com/Ashoat/LogBoxTest/commit/3a2cdab8777ac381cd3be5a84a5bf3250751ac11) and then edited `node_modules/react-native/ReactAndroid/src/main/res/devsupport/values/styles.xml` directly. Reviewed By: rickhanlonii Differential Revision: D22602970 Pulled By: mdvacca fbshipit-source-id: 8c2adc149aa0157825075022f00bb695956d3121 * Fix image cannot show in iOS 14 (#29420) Summary: This PR is to fix https://github.com/facebook/react-native/issues/29279, which image cannot show in iOS 14 As https://github.com/facebook/react-native/issues/29279#issuecomment-658244428 mention, this issue can be fixed by calling ` [super displayLayer:layer];` it it is still image, to let `UIImageView` handle still image rendering ## Changelog [iOS] [Fixed] - Fix image cannot show in iOS 14 Pull Request resolved: https://github.com/facebook/react-native/pull/29420 Test Plan: Image can be shown in iOS 14 build with Xcode 12 beta, using ```js <Image source={require('./images/some_local_image.jpg')}/> ``` It may also need to test gif image is render correctly ```js <Image source={{uri: 'https://some_remote_gif_image.gif'}}/> ``` Reviewed By: p-sun Differential Revision: D22619448 Pulled By: shergin fbshipit-source-id: f4d0ad83af945a6b8099d4eaea5a5f1933c7bfd2 * [0.63.2] Bump version numbers * botched merge changes 1 * more hermes changes needed from upstream, botched merge? * [RCTPicker] Guard UIKit only API on macOS * [RCTSegmentedControl] Make UIKit agnostic * [RCTDisplayWeakRefreshable] Make platform agnostic * [RCTImageLoader] Make platform agnostic * [RCTDevLoadingView] Make platform agnostic * botched merge changes 2 * [RCTPushNotificationManager] Guard for macOS * v0.63 TODO * [RCTBaseTextInputViewManager] Make platform agnostic * [RCTBaseTextInputView] Make platform agnostic * [RNTester-macOS] Fix * [RCT-Folly] Fix build * [PlatformColorValueTypes] Add macOS shim * [package] Update CLI to no longer require config This makes a previous change more explicit: https://github.com/microsoft/react-native-macos/pull/602 * Fix iOS build failures. * Get RNTester to launch * [CODEOWNERS] Add myself * [flow] Remove deprecated rule in newer Flow https://github.com/facebook/flow/commit/759970c1b6dc0a25171d9969e34eaf5dae70f130 * [flow] Get iOS checks green * [PlatformColor] Duplicate iOS code for macOS This is a naive version of this change, there should likely be some code sharing happening between iOS and macOS. * [test] Make green with macOS fork changes * [test] Get macOS test bundle to build * [Color] Rename alternating colors to match to assumptions * [PlatformExample] Fix examples on macOS * [transform] Use iOS implementation for macOS * [circle] Fix config * [ci] Update metro config as per upstream * [ci] Ignore metro config in e2e tests * Revert "[ci] Ignore metro config in e2e tests" This reverts commit 25f7006bc9ba76b1e002b721954a823b3d710c5c. * Revert "[ci] Update metro config as per upstream" This reverts commit b47ca570be00394bbd92b349eab02083787301e7. * [ci] Only disable custom metro config in e2e test * [ci] Ignore metro config in e2e tests * [ci] Switch to experimental CocoaPods CDN * Revert "[ci] Switch to experimental CocoaPods CDN" This reverts commit 44a92f7f08397406429672b14930d44b6aa06b5e. * [ci] Skip Android tests in Apple PR on master * [rnm-init] Fix pod reference * [rnm-init] Update minimum iOS deployment target Co-authored-by: Christoph Nakazawa <cpojer@fb.com> Co-authored-by: Sergio Estevao <sergioestevao@gmail.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: Sam Mathias Weggersen <sawegger@microsoft.com> Co-authored-by: Tommy Nguyen <tonguye@microsoft.com> Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Héctor Ramos <hector@hectorramos.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Sebastian Markbage <sema@fb.com> Co-authored-by: generatedunixname89002005287564 <generatedunixname89002005287564@fb.com> Co-authored-by: Eddie Dugan <ejd@fb.com> Co-authored-by: Valentin Shergin <shergin@fb.com> Co-authored-by: Max Ovtsin <maxovtsin@fb.com> Co-authored-by: Alexander Kawrykow <akawry@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Spencer Ahrens <sahrens@fb.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Jack Wang <shoubowang@fb.com> Co-authored-by: Oleg Bogdanov <boguscoder@fb.com> Co-authored-by: Michael Bolin <mbolin@fb.com> Co-authored-by: Dan Abramov <gaearon@fb.com> Co-authored-by: Peter Argany <petetheheat@fb.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: George Zahariev <gkz@fb.com> Co-authored-by: Jason Safaiyeh <safaiyeh@protonmail.com> Co-authored-by: Pedro Barbiero <pedrobarbiero@gmail.com> Co-authored-by: Brian Vaughn <bvaughn@fb.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Martin Sherburn <mns@fb.com> Co-authored-by: Tom Underhill <tomun@microsoft.com> Co-authored-by: Ventsislav Dimitrov <4097884+vdmtrv@users.noreply.github.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: Lucas Bento <lucas.bsilva@outlook.com> Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com> Co-authored-by: Vojtech Novak <vonovak@gmail.com> Co-authored-by: Emilis Baliukonis <emilisb@wix.com> Co-authored-by: Jacob Bower <jbower@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: Marc Horowitz <mhorowitz@fb.com> Co-authored-by: Sidharth Guglani <sidharthguglani@fb.com> Co-authored-by: Andrew Coates (REDMOND) <acoates@microsoft.com> Co-authored-by: maciej simka <mcj.simka@gmail.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Pavlos Vinieratos <pvinis@gmail.com> Co-authored-by: Cristiano Santos <cristianomnsantos@gmail.com> Co-authored-by: Daniel Cohen Gindi <Danielgindi@gmail.com> Co-authored-by: Eli White <eliwhite@fb.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: jiggag <jiggag90@gmail.com> Co-authored-by: Emily Janzer <janzer@fb.com> Co-authored-by: Kacper Wiszczuk <kacperwiszczuk@gmail.com> Co-authored-by: Xiaoyu Yin <xyin@fb.com> Co-authored-by: Javier Cuevas <javi@diacode.com> Co-authored-by: Bruno Barbieri <brunobar79@gmail.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Will Holen <willholen@fb.com> Co-authored-by: Pritesh Nandgaonkar <prit91@fb.com> Co-authored-by: sunnylqm <sunnylqm@qq.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Tim Yung <yungsters@fb.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: Devon Deonarine <hello@devondeonarine.ca> Co-authored-by: Radek Czemerys <radko93@gmail.com> Co-authored-by: Hein Rutjes <IjzerenHein@users.noreply.github.com> Co-authored-by: zhongwuzw <zhongwuzw@qq.com> Co-authored-by: Jonny Burger <jonathanburger11@gmail.com> Co-authored-by: Ryan Tremblay <ryan.tremblay@microsoft.com> Co-authored-by: almouro <contact@almouro.com> Co-authored-by: Rick Hanlon <rickhanlonii@gmail.com> Co-authored-by: Matthieu Harlé <bonjour@matthieuharle.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Ashoat Tevosyan <ashoat@gmail.com> Co-authored-by: Tom Cheung <cheungch@gmail.com>
2020-09-30 19:38:06 +03:00
get LogBox(): LogBox {
return require('./Libraries/LogBox/LogBox');
},
get NativeDialogManagerAndroid(): NativeDialogManagerAndroid {
return require('./Libraries/NativeModules/specs/NativeDialogManagerAndroid')
.default;
},
get NativeEventEmitter(): NativeEventEmitter {
return require('./Libraries/EventEmitter/NativeEventEmitter').default;
},
Expose RCTNetworking as a public 'Networking' API (#25718) Summary: This PR introduces the `EventSource` web standard as a first-class networking feature in React Native. In the discussion we had in February at https://github.com/react-native-community/discussions-and-proposals/issues/99, cpojer indicated that the RN maintainers would be willing to accept a PR to offer this functionality. The linked discussion goes into detail about why this change must happen in React Native Core as opposed to a community library, but the tl;dr is that `XmlHttpRequest` doesn't let you do streaming in a resource-efficient way, since it holds onto the entire response buffer until the request is complete. When processing a stream that might last for a long time, that's not ideal since there might be a lot of data in that buffer that is now useless to maintain. For more information about EventSource and server-sent events, check out these links: * [EventSource on MDN](https://developer.mozilla.org/en-US/docs/Web/API/EventSource) * [Using server-sent events on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events) * [WHATWG spec for server-sent events](https://html.spec.whatwg.org/multipage/server-sent-events.html) I've tried as best as I can to satisfy the linked specification so that this is as standard as possible. One of the projects I maintain has an ideal use case for this feature. The SDK for MongoDB Stitch (a backend-as-a-service for the MongoDB database) has the ability to open a "change stream" to watch for changes that happen on a database. However, in our JavaScript SDK, this feature depends on `EventSource`, because the backend service implements the one-way streaming protocol with server-sent events. We know there is demand for this feature because users have requested it: https://github.com/mongodb/stitch-js-sdk/issues/209. If this PR will be accepted, I am happy to update the `Networking` documentation at https://facebook.github.io/react-native/docs/network ## Changelog [JavaScript] [Added] Implements the `EventSource` web standard in `Libraries/Networking` [JavaScript] [Added] Exposes the `EventSource` implementation in `Libraries/Core/setUpXHR.js` Pull Request resolved: https://github.com/facebook/react-native/pull/25718 Test Plan: To test the `EventSource` implementation, I added a comprehensive set of unit tests that cover the basic functionality, as well as edge cases that are laid out in the spec. See `EventSource-test.js` for the cases that the tests handles. For convenience, I've also included the test descriptions as produced by the `jest` test output here. ``` PASS Libraries/Network/__tests__/EventSource-test.js EventSource ✓ should pass along the correct request parameters (527ms) ✓ should transition readyState correctly for successful requests (4ms) ✓ should call onerror function when server responds with an HTTP error (2ms) ✓ should call onerror on non event-stream responses (1ms) ✓ should call onerror function when request times out (1ms) ✓ should call onerror if connection cannot be established (1ms) ✓ should call onopen function when stream is opened (1ms) ✓ should follow HTTP redirects (2ms) ✓ should call onmessage when receiving an unnamed event (2ms) ✓ should handle events with multiple lines of data (1ms) ✓ should call appropriate handler when receiving a named event (1ms) ✓ should receive multiple events (1ms) ✓ should handle messages sent in separate chunks (1ms) ✓ should forward server-sent errors ✓ should ignore comment lines (1ms) ✓ should properly set lastEventId based on server message (1ms) ✓ should properly set reconnect interval based on server message ✓ should handle messages with non-ASCII characters (1ms) ✓ should properly pass along withCredentials option (3ms) ✓ should properly pass along extra headers (1ms) ✓ should properly pass along configured lastEventId (2ms) ✓ should reconnect gracefully and properly pass lastEventId (9ms) ✓ should stop attempting to reconnect after five failed attempts (2ms) ``` As a manual E2E test, I also added streaming support to the Stitch React Native SDK, and tested it with my React Native EventSource implementation, and confirmed that our `EventSource`-based streaming implementation worked with this `EventSource` implementation. * Source code for E2E app test: https://gist.github.com/adamchel/6db456c1a851ed7dd20b54f6db3a6759 * PR for streaming support on our React Native SDK: https://github.com/mongodb/stitch-js-sdk/pull/294 * Very brief video demonstrating E2E functionality: https://youtu.be/-OoIpkAxmcw Differential Revision: D17283890 Pulled By: cpojer fbshipit-source-id: 0e9e079bdb2d795dd0b6fa8a9a9fa1e840245a51
2019-09-11 13:22:09 +03:00
get Networking(): Networking {
return require('./Libraries/Network/RCTNetworking');
Expose RCTNetworking as a public 'Networking' API (#25718) Summary: This PR introduces the `EventSource` web standard as a first-class networking feature in React Native. In the discussion we had in February at https://github.com/react-native-community/discussions-and-proposals/issues/99, cpojer indicated that the RN maintainers would be willing to accept a PR to offer this functionality. The linked discussion goes into detail about why this change must happen in React Native Core as opposed to a community library, but the tl;dr is that `XmlHttpRequest` doesn't let you do streaming in a resource-efficient way, since it holds onto the entire response buffer until the request is complete. When processing a stream that might last for a long time, that's not ideal since there might be a lot of data in that buffer that is now useless to maintain. For more information about EventSource and server-sent events, check out these links: * [EventSource on MDN](https://developer.mozilla.org/en-US/docs/Web/API/EventSource) * [Using server-sent events on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events) * [WHATWG spec for server-sent events](https://html.spec.whatwg.org/multipage/server-sent-events.html) I've tried as best as I can to satisfy the linked specification so that this is as standard as possible. One of the projects I maintain has an ideal use case for this feature. The SDK for MongoDB Stitch (a backend-as-a-service for the MongoDB database) has the ability to open a "change stream" to watch for changes that happen on a database. However, in our JavaScript SDK, this feature depends on `EventSource`, because the backend service implements the one-way streaming protocol with server-sent events. We know there is demand for this feature because users have requested it: https://github.com/mongodb/stitch-js-sdk/issues/209. If this PR will be accepted, I am happy to update the `Networking` documentation at https://facebook.github.io/react-native/docs/network ## Changelog [JavaScript] [Added] Implements the `EventSource` web standard in `Libraries/Networking` [JavaScript] [Added] Exposes the `EventSource` implementation in `Libraries/Core/setUpXHR.js` Pull Request resolved: https://github.com/facebook/react-native/pull/25718 Test Plan: To test the `EventSource` implementation, I added a comprehensive set of unit tests that cover the basic functionality, as well as edge cases that are laid out in the spec. See `EventSource-test.js` for the cases that the tests handles. For convenience, I've also included the test descriptions as produced by the `jest` test output here. ``` PASS Libraries/Network/__tests__/EventSource-test.js EventSource ✓ should pass along the correct request parameters (527ms) ✓ should transition readyState correctly for successful requests (4ms) ✓ should call onerror function when server responds with an HTTP error (2ms) ✓ should call onerror on non event-stream responses (1ms) ✓ should call onerror function when request times out (1ms) ✓ should call onerror if connection cannot be established (1ms) ✓ should call onopen function when stream is opened (1ms) ✓ should follow HTTP redirects (2ms) ✓ should call onmessage when receiving an unnamed event (2ms) ✓ should handle events with multiple lines of data (1ms) ✓ should call appropriate handler when receiving a named event (1ms) ✓ should receive multiple events (1ms) ✓ should handle messages sent in separate chunks (1ms) ✓ should forward server-sent errors ✓ should ignore comment lines (1ms) ✓ should properly set lastEventId based on server message (1ms) ✓ should properly set reconnect interval based on server message ✓ should handle messages with non-ASCII characters (1ms) ✓ should properly pass along withCredentials option (3ms) ✓ should properly pass along extra headers (1ms) ✓ should properly pass along configured lastEventId (2ms) ✓ should reconnect gracefully and properly pass lastEventId (9ms) ✓ should stop attempting to reconnect after five failed attempts (2ms) ``` As a manual E2E test, I also added streaming support to the Stitch React Native SDK, and tested it with my React Native EventSource implementation, and confirmed that our `EventSource`-based streaming implementation worked with this `EventSource` implementation. * Source code for E2E app test: https://gist.github.com/adamchel/6db456c1a851ed7dd20b54f6db3a6759 * PR for streaming support on our React Native SDK: https://github.com/mongodb/stitch-js-sdk/pull/294 * Very brief video demonstrating E2E functionality: https://youtu.be/-OoIpkAxmcw Differential Revision: D17283890 Pulled By: cpojer fbshipit-source-id: 0e9e079bdb2d795dd0b6fa8a9a9fa1e840245a51
2019-09-11 13:22:09 +03:00
},
get PanResponder(): PanResponder {
return require('./Libraries/Interaction/PanResponder');
},
get PermissionsAndroid(): PermissionsAndroid {
return require('./Libraries/PermissionsAndroid/PermissionsAndroid');
},
get PixelRatio(): PixelRatio {
return require('./Libraries/Utilities/PixelRatio');
},
get PushNotificationIOS(): PushNotificationIOS {
warnOnce(
'pushNotificationIOS-moved',
'PushNotificationIOS has been extracted from react-native core and will be removed in a future release. ' +
"It can now be installed and imported from '@react-native-community/push-notification-ios' instead of 'react-native'. " +
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
'See https://github.com/react-native-push-notification-ios/push-notification-ios',
);
return require('./Libraries/PushNotificationIOS/PushNotificationIOS');
},
get Settings(): Settings {
return require('./Libraries/Settings/Settings');
},
get Share(): Share {
return require('./Libraries/Share/Share');
},
get StyleSheet(): StyleSheet {
return require('./Libraries/StyleSheet/StyleSheet');
},
get Systrace(): Systrace {
return require('./Libraries/Performance/Systrace');
},
// $FlowFixMe[value-as-type]
get ToastAndroid(): ToastAndroid {
return require('./Libraries/Components/ToastAndroid/ToastAndroid');
},
get TurboModuleRegistry(): TurboModuleRegistry {
return require('./Libraries/TurboModule/TurboModuleRegistry');
},
get UIManager(): UIManager {
return require('./Libraries/ReactNative/UIManager');
},
get unstable_batchedUpdates(): $PropertyType<
ReactNative,
'unstable_batchedUpdates',
> {
return require('./Libraries/Renderer/shims/ReactNative')
.unstable_batchedUpdates;
},
get useColorScheme(): useColorScheme {
return require('./Libraries/Utilities/useColorScheme').default;
},
get useWindowDimensions(): useWindowDimensions {
return require('./Libraries/Utilities/useWindowDimensions').default;
},
get UTFSequence(): UTFSequence {
return require('./Libraries/UTFSequence');
},
get Vibration(): Vibration {
return require('./Libraries/Vibration/Vibration');
},
get YellowBox(): YellowBox {
v0.63 sync from upstream (#613) * Upgrade to Metro 0.59 Summary: Upgrades RN to Metro 0.59. Changelog: [Internal] Metro Upgrade Reviewed By: motiz88 Differential Revision: D20533864 fbshipit-source-id: 3c5fb8e37d2363edf0b9a1a8cfbdefba00763415 * Fix mock for TextInput (#28332) Summary: This PR adds the `isFocused` method to the mock of the TextInput component. My understanding some of the latest changes on the TextInput to make it use a forwardRef change the way this method is mock giving an error when trying to use in on a mock. The change suggested here fixes the issue. ## Changelog [JavaScript] [Fixed] - Fix the mock for TextInput to support the `isFocused` method Pull Request resolved: https://github.com/facebook/react-native/pull/28332 Reviewed By: cpojer Differential Revision: D20538044 Pulled By: TheSavior fbshipit-source-id: be734af105ab62ffdf9ed4017bd70845e207f8cd * Properly handle LogBox errors during tests Summary: This diff fixes an issue where errors in LogBox during tests would cause the tests to crash. The crash is due to the NativeExceptionsManager module not being mocked (as all native module need to be in tests). The fix is to properly mock the NativeExceptionManger. This fix exposed an infinite loop issue where failures in LogBox will be logged to the ExceptionManager, which logs to the console, which logs to LogBox, creating a loop. This diff also fixes that look by moving the LogBox internal error check to the top of the monkey patched console methods. Changelog: [Internal] Differential Revision: D20428590 fbshipit-source-id: 7289a480c99ba8dee67772178b7629afb40b330a * Back out "Track animations and flush them" Summary: Original commit changeset: b594d0e6e9b6 D20319824 introduced a problem in LayoutAnimations, which makes surfaced as the problem in T63911344. This diff reverts D20319824. Changelog: [Internal] Reviewed By: lunaleaps Differential Revision: D20541918 fbshipit-source-id: ff72b839f57d39051122920a38b2632cbb5ec362 * Consolidate "dispatchMountItems" reentrancy prevention code, and retry code, in one function Summary: Simplifying the dispatchMountItems reentrance and retry logic. Motivation: cleanup so I can work on dispatching ViewCommands before anything else. Importantly, this gives us the properties that: 1) Only one function is responsible for calling dispatchMountItems 2) Only one function is responsible for deciding if we shouldn't call dispatchMountItems due to reentrance 3) Only one function is responsible for all cleanup 4) Only one function maintains all of the relevant flags (except dispatchPreMountItems... two total now, instead of 4 before) Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20437035 fbshipit-source-id: 5370366790eb25f653bee6c1950e747458374a61 * Only retry ViewCommand mount items if exception is marked as "Retryable" Summary: Instead of just blindly retrying all ViewCommands if they fail - which could be dangerous, since it's arbitrary imperative commands we'd be executing twice, potentially with bad app state - we only retry if the ViewCommand throws a "RetryableMountingLayerException". Changelog: [Internal] Optimization to ViewCommands Reviewed By: mdvacca Differential Revision: D20529985 fbshipit-source-id: 0217b43f4bf92442bcc7ca48c8ae2b9a9e543dc9 * Introduce early dispatch of ViewCommands in FabricUIManager Summary: Earlier this week I introduced a change in the old, non-Fabric renderer (D20378633 D20427803) that (gated behind a feature-flag) executes ViewCommands before all other types of commands, as a perf optimization and (I think) a potential fix for a category of race conditions. I've added more details in comments here. The Fabric renderer uses the same feature-flag that I introduced for the non-Fabric renderer. Changelog: [Internal] Fabric Reviewed By: mdvacca Differential Revision: D20449186 fbshipit-source-id: bb3649f565f32c417a6247369902333989a043aa * Change nightly build from hourly to nightly (daily at 00:00) (#28346) Summary: We initially added the nightly build test to run every hour, in order to more quickly validate it. Now that it has been validated we can run it every night as it is intended to do. cc hramos ## Changelog [General] [Changed] - Change nightly build from hourly to nightly Pull Request resolved: https://github.com/facebook/react-native/pull/28346 Reviewed By: cpojer Differential Revision: D20550143 Pulled By: hramos fbshipit-source-id: 9487c6785684ad6ea7e877290d50a33118090a7f * Add diffing to app bundle size reports (#28284) Summary: Add diffing to app bundle size reports. ## Changelog [Internal] [Changed] - Add diffing to app bundle size reports Pull Request resolved: https://github.com/facebook/react-native/pull/28284 Test Plan: - App bundle size reports should now display a diff where available - Right now, the database contains only one entry for the last known good iOS build - Triggering a new build should not create additional comments Reviewed By: cpojer Differential Revision: D20450158 Pulled By: hramos fbshipit-source-id: 720772275f24d3ff0a49705f4dada2efe2e99bd3 * feat: improve monorepo support by removing redundant PROJECT_ROOT (#28354) Summary: Historically, React Native didn't support a lot of custom project structures apart from the standard flat directory with `ios` and `android` folders. The CLI had to be explicitly started from the project root, otherwise Metro didn't work right. In order to resolve the project root in the most accurate way, React Native assumed that project root is always `../../` from its location in `node_modules` - this is not true when the installation gets hoisted (e.g. in a monorepo). To address that, janicduplessis brought support for custom [`PROJECT_ROOT`](https://github.com/facebook/react-native/commit/9ccde378b6e6379df61f9d968be6346ca6be7ead) that allowed overriding the `../../` in case it wasn't true. Today, CLI is able to automatically resolve the project root, no matter where it's started. It will traverse the tree of the directories upwards and stop as soon as it meets `package.json`. As a result, it doesn't really matter from where we start the CLI anymore as a part of `react-native-xcode.sh`. By replacing the default value of `$REACT_NATIVE_DIR/../../` with `$PWD, that is default for all Xcode scripts, we can make the setup for monorepo easier - nobody will need to set `$PROJECT_ROOT` in order to override the incorrect defaults. By default, all scripts defined in Xcode run from `$PWD` directory, which is the location of the iOS project. In the future, we will be able to remove `cd` entirely. To better understand this PR, let's look a few hypothetical structures as an example: #### Monorepo: > tl;dr works out of the box, no need to mess around with paths ``` - package.json - packages/ - my-app/ - index.js - package.json - ios/ - MyApp.xcodeproj ``` **Before this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $REACT_NATIVE_DIR/../../ node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - Because we change the directory to the root of monorepo, CLI throws an error. All in all, there's no `react-native` dependency at the workspace root. - Some users turn `no hoist` in an act of troubleshooting the errors, which resolves the problem - `react-native` is moved under `my-app/node_modules` which makes this mechanism resolve properly. - Some users find out about `PROJECT_ROOT` and set it to overwrite the default value. For example, setting `export PROJECT_ROOT = "$PWD/../` will set the directory to `my-app`, which has a dependency on `react-native` in a `package.json` and makes the CLI happy. **After this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $PWD node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - The `$PWD` is `packages/my-app/ios/` because that's where the Xcode project is located. CLI will automatically set the root to `../` because that's where it finds `package.json` with `react-native` dependency. It will pass that root to Metro, unless users have set a different one themselves. Thanks to that, all paths to JavaScript files remain working and unaffected. - No need to set `PROJECT_ROOT` anymore. - We don't rely on the location of `node_modules`, which is cleaner and future proof. #### Standard: > tl;dr no changes ``` - ios/ - MyApp.xcodeproj - index.js - package.json ``` **Before this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $REACT_NATIVE_DIR/../../ node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - Everything works fine. Path from `react-native` inside `node_modules` is correct - the project root is set right to `/` **After this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $PWD node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - The root will be set to where Xcode project is located, which is `/ios`. This is the PWD for all Xcode scripts. CLI will look for the `package.json` going upwards from `ios` folder. Will stop at `/`, find out it has `react-native` dependency, load it and its commands and proceed further. ## Changelog [iOS] [Feature] - Better monorepo support when building release apk Pull Request resolved: https://github.com/facebook/react-native/pull/28354 Test Plan: - All projects (standard/monorepo) run without issues. - PROJECT_ROOT is not needed. CC: Titozzz (who wrote monorepo guide), alloy, bartolkaruza Reviewed By: cpojer Differential Revision: D20558005 Pulled By: hramos fbshipit-source-id: 2551120beadcfd4c2f1393ce8a2c2fa6b93c9290 * Fix `test_android`: Remove references to fbsource cell (#28363) Summary: Fixes https://github.com/facebook/react-native/issues/28361. ## Changelog [Internal] [CI] - Fix test_android Pull Request resolved: https://github.com/facebook/react-native/pull/28363 Test Plan: Prior to fix: ``` react-native $ ./scripts/circleci/buck_fetch.sh Guessing 168a69309928ba16065cdb33b1775a4af9f924a6 as the last one used version. Using additional configuration options from /Users/hramos/.buckconfig.d/experiments, /etc/buckconfig.d/fb_chef.ini, /etc/buckconfig.d/fb_chef_override.ini Invalidating internal cached state: Watchman failed to start. This may cause slower builds. Parsing buck files: finished in 1.5 sec Buck wasn't able to parse /Users/hramos/git/react-native/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK: IOError: [Errno 2] No such file or directory: '/Users/hramos/git/react-native/tools/build_defs/platform_defs.bzl' Call stack: File "/Users/hramos/git/react-native/.buckd/resources/168a69309928ba16065cdb33b1775a4af9f924a6/buck_server/buck_parser/profiler.py", line 507, in wrapped return func(*args, **kwargs) File "/Users/hramos/git/react-native/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK", line 1 load("//tools/build_defs:platform_defs.bzl", "ANDROID") File "/Users/hramos/git/react-native/.buckd/resources/168a69309928ba16065cdb33b1775a4af9f924a6/buck_server/buck_parser/profiler.py", line 507, in wrapped return func(*args, **kwargs) This error happened while trying to get dependency '//ReactAndroid/src/main/java/com/facebook/fbreact/specs:FBReactNativeSpec' of target '//ReactAndroid/src/main/java/com/facebook/react/devsupport:devsupport' ``` After fix: ``` react-native $ ./scripts/circleci/buck_fetch.sh + buck fetch ReactAndroid/src/test/java/com/facebook/react/modules Guessing 168a69309928ba16065cdb33b1775a4af9f924a6 as the last one used version. Using additional configuration options from /Users/hramos/.buckconfig.d/experiments, /etc/buckconfig.d/fb_chef.ini, /etc/buckconfig.d/fb_chef_override.ini Invalidating internal cached state: Watchman failed to start. This may cause slower builds. Parsing buck files: finished in 1.1 sec Configuration 'ANDROID_SDK' points to an invalid directory '/opt/android_sdk'. When creating rule //ReactAndroid/src/main/java/com/facebook/hermes/instrumentation:instrumentation. ``` > Note: I don't have the Android SDK configured in this machine. Verified on Circle CI. `test_android` is now green: https://circleci.com/gh/facebook/react-native/140682?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link Reviewed By: cpojer Differential Revision: D20564934 Pulled By: hramos fbshipit-source-id: 5d843b8f113c4db5391ee39addc3ff259d962290 * Fix TextInput left/right padding Summary: This fixes two things: 1) Currently it only respects Start and End padding, and if there's a Theme default, it will override Left/Right padding. Whoops. 2) Currently it doesn't respect when a TextInput starts with padding, but then is removed. This resolves both. It still does not account for RTL support. Changelog: [Internal] Fix AndroidTextInput padding Reviewed By: mdvacca Differential Revision: D20573151 fbshipit-source-id: e89791641b6699e728cde9dbd661a8c21485fbc8 * Validate selection range passed to setTextAndSelection Summary: Changelog: [Internal] # Fabric 1. If `start` and `end` parameters in `setTextAndSelection` are -1, we don't move the cursor. Previously the cursor would be moved to beginning of text input. 2. In view commands, do not validate `eventCount`. It is passed in as undefined from JS because Fabric's text input doesn't use `eventCount`. # Paper 1. If `start` and `end` parameters in `setTextAndSelection` are -1, we don't move the cursor. Previously the cursor would be moved to beginning of text input. Reviewed By: shergin Differential Revision: D20538290 fbshipit-source-id: c7aeddc25f58697254474058ce901df958321f7c * Remove ReactTypes from fbsource and React sync Summary: See https://github.com/facebook/react/pull/18366 This contains a fork of the upstream Flow types. We shouldn't be syncing this since these leads to conflicting types. As a result, these uses have already been codemodded away. Only the imports remained. Changelog: [React Core] - Remove ReactTypes from sync. Reviewed By: gaearon Differential Revision: D20583740 fbshipit-source-id: fc86a934cbdca8ff90fe90282b86ecc945a85e5f * Fix controlled TextInput with child nodes Summary: Changelog: [Internal] # There are three changes in this diff ## _stateRevision is replaced with a BOOL `_stateRevision` was protecting against setting attributed string that is already visible to the user. Previously this was ok because the change was only coming from native, any changes from JS were ignored. Imagine following scenario: 1. User taps key. 2. Update state is called on component initiated by native. 3. New state is created with incremented revision by one. 4. `_stateRevision` gets set to new state's revision + 1. 5. Now JS wants to change something because it just learnt that user tapped the key. 6. New state is created again with incremented revision by one. 7. Update state is called on the component, but the change isn't applied to the text view because `_state->getRevision()` will equal `_stateRevision`. By having a BOOL instead of number, we very explicitly mark the region in which we don't want state changes to be applied to text view. ## Calling [_backedTextInputView setAttributedText] move cursor to the end of text input This is prevented by storing what the current selection is and applying it after `[_backedTextInputView setAttributedText]` is called. This was previously invisible because JS wasn't changing contents of `_backedTextInputView`. ## Storing of previously applied JS attributed string in state This is the mechanism used to detect when value of text input changes come from JavaScript. JavaScript sends text input value changes through props and as children of TextInput. We compare what previously was set from JavaScript to what is currently being send from JavaScript and if they differ, this change is communicated to the component. Previously only first attributed string send from JavaScript was send to the component. # Problem If children are used to set text input's value, then there is a case in which we can't tell what source of truth should be. Let's take following example We have a text field that allows only 4 characters, again this is only a problem if those 4 characters come as children, not as value. This is a controller text input. 1. User types 1234. 2. User types 5th character. 3. JavaScript updates TextInput, saying that the content should stay 1234. 4. In `TextInputShadowNode` `hasJSUpdatedAttributedString` will be set to false, because previous JS value is the same as current JS value. Reviewed By: shergin Differential Revision: D20587681 fbshipit-source-id: 1b8a2efabbfa0fc87cba210570142d162efe61e6 * Daily `arc lint --take BUCKFORMAT` Reviewed By: zertosh Differential Revision: D20593906 fbshipit-source-id: b056947c698508119dc9d4d1bba202295b8f0fda * RN picker - implement background color Summary: add support to the android implementation of the Picker component for setting the background color. Changelog: [Android] [Added] - Support item background color in Dialog Picker Differential Revision: D20566131 fbshipit-source-id: d693b40803fa1051ec955c5728994c820fecd9e9 * Fabric: Modernizing Yoga Dirty flag test. Summary: Now we using TEST_F thing that allows consilidating initialization. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D20578788 fbshipit-source-id: 103bcb8fdeb3dbf297385cfe56415bd646e16791 * Fabric: Changing signature of `ComponentDescriptor::createState` Summary: This is pure syntactic change. Often we don't have a shared pointer to ShadowNodeFamily and only have just a reference. At the same time, `ComponentDescriptor::createState` does not have to accept a shared pointer. So, it's better to accept just a reference. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20578787 fbshipit-source-id: 905277001e096d41e75007575b59ea2ea15fbf4b * Fabric: View Test: Changing state should not dirty Yoga tree (in some most cases) Summary: Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D20578789 fbshipit-source-id: 4336165217bd39fc8065cfaeb96ef7753433d48a * Get ReactiveNative compiled with Clang 10 (#28362) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/28362 Fixed a few compilation errors emitted by Clang 10. Changelog: [iOS] [Fixed] - Get ready for Clang 10 Differential Revision: D20549970 fbshipit-source-id: dc36a85d90d3e43a05f045feb57c6ab6ded67da7 * Guard against null values in object parameters for bridged methods Summary: Handles the case when a value in an object parameter of a turbo module spec is null (even if the type is nullable). For example, given: ``` export interface Spec extends TurboModule { +myFunc: ({| foo: ?string, |}) => void; } ``` and calling `NativeModule.myFunc({foo: null})`, we see an error like: ``` JSON value '<null>' of type NSNull cannot be converted to NSString ``` Guarding against this by converting NSNull's to nils ## Changelog: [iOS] [Fixed] - Fix crash when passing null value in object parameter of bridged method Reviewed By: fkgozali Differential Revision: D20591590 fbshipit-source-id: fdb90f34131427a235f2e3c99147bf1e6a9c6732 * Modify pending deletion tags to be cross manageChildren Summary: Changelog: [Internal] Removing historic layout animations index adjustment (D20323928) broke the Dating Secret Crush screen. Since flushing animations (D20319824) had to be reverted due to issues with Saved + Privacy Shortcuts (https://fburl.com/tasks/eijtmifu) we need to track pending deletions across `manageChildren` operations. Reviewed By: JoshuaGross Differential Revision: D20601079 fbshipit-source-id: c6f116683750e97abe7f988cf361d2a6449e90e6 * Enable label-actions on the react-native repository (#28374) Summary: Enhance our issue management workflow by having the bot respond automatically whenever a label is applied to the issue. ## Changelog [Internal] - CI Pull Request resolved: https://github.com/facebook/react-native/pull/28374 Test Plan: Not tested. If needed, could be applied to a different, test repository. Reviewed By: cpojer Differential Revision: D20606887 Pulled By: hramos fbshipit-source-id: 874d1464527ea76bf51394a7d3e98e4fd8f69345 * Fix Animated Value initialized with undefined in ScrollView (#28349) Summary: When passing an object to contentOffset that doesn't have `y` prop set it causes the following error: ``` Error: AnimatedValue: Attempting to set value to undefined This error is located at: in ScrollView (at src/index.js:638) ... ``` This happens since a runtime check was added to the `AnimatedValue` constructor. (a3aaa471eca58b31597b9a0669f7ade385ccb175) According to flow types the object passed to contentOffset should always contain both x and y props but since it worked before when y is undefined I think its fine to patch the runtime behaviour defensively, especially since the code change is simple. ## Changelog [General] [Fixed] - Fix Animated Value initialized with undefined in ScrollView Pull Request resolved: https://github.com/facebook/react-native/pull/28349 Test Plan: Tested that the crash no longer reproduces when passing an empty object to contentOffset. Reviewed By: cpojer Differential Revision: D20601664 Pulled By: hramos fbshipit-source-id: b098a2dd1e702f995a9a92fa6e4e9a204187dac4 * xplat/js/react-native-github/ReactCommon/fabric/components/textinput/ Summary: Changelog: [Internal] Reviewed By: scottrice Differential Revision: D20619227 fbshipit-source-id: 674337e6ce585a4e96d020f9624b874ba86e2d80 * Seed ssh known hosts with github's public key (#28370) Summary: The [previous attempt](https://github.com/facebook/react-native/pull/28304) to fix the publish step failed, so now reverting to manually configuring things. This PR adds an entry to SSH’s `known_hosts` file using github.com’s public key that I have verified as per [these instructions](https://serverfault.com/a/807363): ``` ~/C/R/react-native [master] » nmap github.com --script ssh-hostkey Nmap scan report for github.com (140.82.118.4) rDNS record for 140.82.118.4: lb-140-82-118-4-ams.github.com PORT STATE SERVICE 22/tcp open ssh | ssh-hostkey: | 1024 ad:1c:08:a4:40:e3:6f:9c:f5:66:26:5d:4b:33:5d:8c (DSA) |_ 2048 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48 (RSA) ``` These fingerprints line up with [the ones posted by GitHub](https://help.github.com/en/github/authenticating-to-github/githubs-ssh-key-fingerprints), so my setup should be good and can be trusted to grab the public key from the right host: ``` ~/C/R/react-native [master] » ssh-keyscan -t rsa -H github.com # github.com:22 SSH-2.0-babeld-d48c3acd |1|If6MU203eXTaaWL678YEfWkVMrw=|kqLeIAyTy8pzpj8x8Ae4Fr8Mtlc= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== ``` ## Changelog [Internal] [Fixed] - Make automated publishing of packages from CI work again Pull Request resolved: https://github.com/facebook/react-native/pull/28370 Test Plan: I used the command being added in this PR in [a failed CI job](https://app.circleci.com/pipelines/github/facebook/react-native/4104/workflows/916127cb-177f-4583-9f90-cae5318041d8/jobs/140810). When I invoked the publish script manually I was not greeted by the blocking prompt and the package was successfully published: https://www.npmjs.com/package/react-native/v/0.0.0-56cf99a96 Reviewed By: cpojer Differential Revision: D20601527 Pulled By: hramos fbshipit-source-id: b1a4405228408cfc4a1b3b44ab88c79522af3a66 * Fix app bundle size diff not always being compared against latest commit (#28368) Summary: - Timestamp of entries in our Firebase instance sometimes get stored as number. This means that we may not always be diffing against the latest master commit. - Size report of Android and iOS gets overwritten depending on which build finishes first. ## Changelog [Internal] [Fixed] - App bundle size diff not always being compared against latest commit [Internal] [Fixed] - Android and iOS app bundle size diff overwrite each other Pull Request resolved: https://github.com/facebook/react-native/pull/28368 Test Plan: - We are now using Firebase's own [firebase.firestore.Timestamp.now](https://firebase.google.com/docs/reference/js/firebase.firestore.Timestamp#now) to ensure that we always get a timestamp in the preferred format. This has been tested locally but can only be verified when merged to master and we start getting new data. In the meantime, I'll manually fix up all the entries in the store. - There should be one app bundle size comment for Android and one for iOS in this PR. Reviewed By: cpojer Differential Revision: D20601620 Pulled By: hramos fbshipit-source-id: 0c3e4b78a74cbd659f1957a6aa74322b016e0646 * Hopefully fix so loading crashes Summary: Changelog: [Android][Internal] Fix potential initializer interruption threading crashes. Reviewed By: mdvacca Differential Revision: D20615755 fbshipit-source-id: 58b706deeb6df1998caff5bf2ae9ec60114313fe * Fix label-actions configuration Summary: Adds back a missing label key, fixes open source issue: https://github.com/facebook/react-native/issues/28378 Changelog: [Internal] [CI] - Fix label-actions config Reviewed By: cpojer Differential Revision: D20625887 fbshipit-source-id: 63c90db249aa9c15369a4b5bcab71cbe75c6d4b8 * Changing Order Of mOverrideColorScheme In Constructor Summary: Changelog: [Android] [Updated] mOverrideColorScheme should be assigned before the first colorSchemeForCurrentConfiguration call, so the initial setting of mColorScheme will reflect the override Reviewed By: zackargyle Differential Revision: D20630173 fbshipit-source-id: a2a2d174d3fc40c14f27dce6a7fa8e67203480c9 * hermes | inspector | Don't include posix headers on non-posix systems Summary: Changelog: [Internal] Hermes inspector includes pthreads, arpa and sys headers on all OSes that would break vanilla Windows builds. This diff adds a check for posix-compliance before inclusion (Note: this ignores all push blocking failures!) Reviewed By: dulinriley Differential Revision: D20564449 fbshipit-source-id: 8e264bc3104065dc4315bb291e8560609fe65184 * Upgrade Prettier from 1.17 to 2.0.2. Summary: This gets us on the latest Prettier 2.x: https://prettier.io/blog/2020/03/21/2.0.0.html Notably, this adds support for TypeScript 3.8, which introduces new syntax, such as `import type`. Reviewed By: zertosh Differential Revision: D20636268 fbshipit-source-id: fca5833d003804333a05ba16325bbbe0e06d6c8a * Back out "Upgrade Prettier from 1.17 to 2.0.2." Differential Revision: D20639755 fbshipit-source-id: 5028563f9cf0527a30b4259daac50cdc03934bfd * Fabric: Additional temporary checks in prop parsing infra Summary: While ViewConfig infra isn't perfect we need to check some value for correctness during prop-parsing. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D20639055 fbshipit-source-id: 193dcd0769bc7777bc8d60c964ede72ebdaa83e4 * Update React package Summary: This just updates the `react` package to the latest stable version. We updated it to experimental internally earlier so this brings the open source version to the latest before the branch cut. This doesn't include any breaking changes. Changelog: [General][Changed] - Update to React 16.13.1 Reviewed By: cpojer Differential Revision: D20642909 fbshipit-source-id: 68a4c74bfe72f1abdb33b0b9071a4f4e8e568318 * Fix sketchy null checks induced by new formatting in Prettier 2.0 Summary: Update code to prepare for Prettier 2.0, which will reformat `a || (b || c)` to `a || b || c`. Changelog: [Internal] prepare for Prettier 2.0 Reviewed By: kassens Differential Revision: D20639483 fbshipit-source-id: c2932b1495884684172ba9291d56c546f51711b8 * RN picker - fix types in AndroidDialogPickerManagerInterface Summary: according to [this crash report](https://our.intern.facebook.com/intern/logview/details/facebook_android_crashes/7ba7056481015482c6166d65cb97e49d/?trace_key=1506fe36a70dd5e50cdc8968f6317f27), `value` was throwing an NPE despite being null-checked. this is because it was an `int` rather than an `Integer`, so the null check wasn't working Changelog: Fix types in AndroidDialogPickerManagerInterface Reviewed By: mdvacca Differential Revision: D20646343 fbshipit-source-id: a27587e0a48f5782bcf5ffddb604018218e65206 * Remove RCTExportModule log spam Summary: The bridge complains if modules aren't exported, which isn't really helpful with lazily loaded modules and turbo modules. I considered only turning this off when TurboModules is enabled, but figured we'd be killing this soon anyways... If anyone feels strongly I can go that approach. Changelog: [iOS][Internal] Remove RCTExportModule log spam Reviewed By: shergin Differential Revision: D20629575 fbshipit-source-id: d32d9fe244c4d06acfee982fca7c7f63da294dc5 * De-jank DevLoadingView Summary: ## Problems Repro steps: 1. Disable Fabric (because CMD + R doesn't work with Fabric right now). 2. Open up Marketplace and hit `CMD + OPT + R` 3. **Observe:** The progress bar doesn't show up right away. It also doesn't actually show progress. https://pxl.cl/140g1 RN Support post: https://fb.workplace.com/groups/rn.support/permalink/3437652016283389/ ## Fixes The first problem is that progress bar doesn't actually show progress. **Fix:** Bundle load progress is updated in `RCTCxxBridge`, where we first require `RCTDevLoadingView`, and then call its `updateProgress` method. Previously, we wouldn't lazily load `RCTDevLoadingView`, it already didn't exist. Lazily loading `RCTDevLoadingView` causes the progress view to show up. Here: https://pxl.cl/140gt If you look at the above video, you'll notice there are two stages to the progress bar: stage 1 displays the actual progress. Stage 2 prompts that we're downloading the JS bundle. As you can see, stage 1 and stage 2 have different background colors, even though both of them are green. **Fix:** I adjusted the JS to match the Native color. Here: https://pxl.cl/140gT We're almost there, but the progress bar is dismissed twice? **Fix:** I dug into the code, and the reason why was because when we hit `CMD + R`, we invalidate the bridge, and immediately re-initialize it. This means that we asynchronously invalidate the old TurboModuleManager, and immediately create a brand new one. Therefore, two `RCTDevLoadingView` modules can (and do) exist at once. So, I moved `RCTDevLoadingView` to be an instance member of `FBReactModule`, to ensure that it doesn't get cleaned up and re-created when TurboModuleManager is deleted and re-created. This finally fixed the progress bar jank: https://pxl.cl/140hn Changelog: [iOS][Fixed] - Remove RCTDevLoadingView jank Reviewed By: rickhanlonii Differential Revision: D20607815 fbshipit-source-id: 05825c67adaf3cfda70be0fa2dc92d413dc8921b * Fix retaining self in block in LogBox impl Summary: Logbox has a retain cycle (see linked task for my deeper investigation). This diff doesn't fix the retain cycle, but it's just good practice to not retain self strongly in blocks. Changelog: [iOS][Internal] Fix retaining self in block in LogBox implementation Reviewed By: shergin Differential Revision: D20630693 fbshipit-source-id: cf399495e9bcd1917932fcc0e9c9d2d2a32bf6f0 * Flow type infoLog Summary: Changelog: [General][Internal] flow type infoLog Reviewed By: zackargyle Differential Revision: D20577939 fbshipit-source-id: eed4401b2ae0a6bf845fdcb54c6abe1fe98fe7c1 * Replace fbsource// with // in xplat/js/ files [1] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: scottrice Differential Revision: D20495655 fbshipit-source-id: a57b72f694c533e2e16dffe74eccb8fdec1f55f5 * Deploy Flow 0.121 to Xplat (#901) Summary: Deploy Flow 0.121 to Xplat bypass-lint allow-large-files Closes https://github.com/facebook/flipper/pull/901 Changelog: [Internal] Reviewed By: panagosg7 Differential Revision: D20570316 fbshipit-source-id: a76983d6f46c8b995ce2dd5cd1e014534790698a * Replace fbsource// with // in xplat/js/ files [3] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D20656211 fbshipit-source-id: deb91b917d349bc500acbb03d734ff621f6e1fc7 * Replace fbsource// with // in xplat/js/ files [4] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: JoshuaGross, shergin Differential Revision: D20656696 fbshipit-source-id: 10f02decb1dc969fd3491ac90d97f09e2bda59e7 * Add Needs: Repro bot action (#28397) Summary: Add automated response for Needs: Repro ## Changelog [Internal] [Added] - Add automated response for Needs: Repro Pull Request resolved: https://github.com/facebook/react-native/pull/28397 Test Plan: Bot should add a comment with the Needs: Repro label. Reviewed By: cpojer Differential Revision: D20665378 Pulled By: hramos fbshipit-source-id: 1c7d878faacf935a640849f74c81f119e5c7e92d * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D20666684 fbshipit-source-id: 32255ac7509e0257693969a7b4b044569af30df7 * ✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392) Summary: Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`. Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job. What was done in this PR: * The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use. * The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument. * The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument * The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument ## Changelog [Internal] [CI] - ✅ Green CI, disabled test infrastructure work Pull Request resolved: https://github.com/facebook/react-native/pull/28392 Test Plan: Verified on Circle CI Reviewed By: cpojer Differential Revision: D20665512 Pulled By: hramos fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726 * Upgrade internal packages to support ESLint >= 6 (#28393) Summary: Fixes https://github.com/facebook/react-native/issues/28293 I've tested it with https://github.com/react-native-community/react-native-template-typescript and it seems to be working as expected - no warnings, supports typescript 3.8. (note: I didn't upgrade the package version as I don't know how the releases work for this package) ## Changelog [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/28393 Reviewed By: hramos Differential Revision: D20647112 Pulled By: cpojer fbshipit-source-id: ca6b67971f625dc8125a58f9220dfcd86250ba94 * Fabric: Fixing a deadlock in RCTSurfacePresenter Summary: This is another attempt to fix an issue very similar to T59424871. The previous attempt was in D19249490. I don't know why we don't see production crashes (stalls) but it happened to me (and not to me) in the debugger. The previous attempt didn't work because we still could have a deadlock because we tried to acquired shared mutex already owned exclusively by the `suspend` method. Here is another approach: Instead of using one shared mutex, now we use two. One is similar to what we had and another that protects `suspend` and `resume`. Besides that, now we pass a Scheduler to functions that use that explicitly. This way we can be more explicit about acquiring mutexes and the overall flow of execution. The idea is: Now an arbitrary code that can be reentrant does not cover with mutexes, so the deadlock is not possible. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20639228 fbshipit-source-id: 98515742f00f2ae94b50b585c9f1f0611e169ebe * Update React Hooks Plugin Summary: Updates `eslint-plugin-react-hooks` to 3.0.0. This introduces a new lint error when you use a Hook inside a class. Changelog: [General][Changed] - Updated the React Hooks ESLint Plugin Reviewed By: cpojer Differential Revision: D20675528 fbshipit-source-id: d0cbe9748fd15df7a4c6de00bd1462610e0a43d6 * Upgrade React DevTools 4.0.6 -> 4.6.0 Summary: Upgrading the embedded version of React DevTools, primarily to pull in [this PR](https://github.com/facebook/react/pull/18397) which will reduce the impact of this package on `node_modules` size. # Update process Following a similar process as D15973709, I began by searching for [all of the references](https://our.intern.facebook.com/intern/biggrep/?corpus=xplat&filename=.json&case=false&view=default&extre=&s=%22react-devtools&engine=apr_strmatch&context=false&filter[uninteresting]=false&filter[intern]=false&filter[test]=false&grep_regex=) to the `react-devtools-core` package and updated all v4 usage to to point to the new 4.6.0 release: 1: Manually update "react-devtools-core" versions: ``` js/package.json js/react-native-github/package.json nuclide/package.json sonar/desktop/app/package.json sonar/desktop/plugins/reactdevtools/package.json vscode/modules/vscode-webview/package.json ``` 2: Setup Yarn proxy: ``` yarn config set proxy http://fwdproxy:8080/ yarn config set https-proxy http://fwdproxy:8080 ``` 3: Run "yarn" in each of the above directories. 4: Run the lockfile shell script: ``` ~/xplat/js/scripts/update-oss-yarn-lockfile.sh ``` 5: Update the generated `MOBILE_JS_NODE_MODULE_DEPS.bzl` by running ``` js1 build buckfiles ``` ## Changelog: [General] [Changed] - Upgrade embedded React DevTools backend from v4.0.6 to v4.6.0. Reviewed By: cpojer, gaearon Differential Revision: D20676091 fbshipit-source-id: 99865bdba9bce45e2a7d582d5fb550cfdbeeca3a * Make ScrollView use ForwardRef Summary: Have ScrollView use forwardRef so that the host component methods like `measure` and `measureLayout` are available without having to call `getNativeScrollRef`. Instead, you can use `<ScrollView ref={myRef} />` and directly call all methods of ScrollView and host components on `myRef`. Previous usage: ``` const myRef = React.createRef<React.ElementRef<typeof ScrollView>>(); <ScrollView ref={myRef} /> const innerViewRef = myRef.current.getNativeScrollRef(); innerViewRef.measure(); ``` New usage: ``` const myRef = React.createRef<React.ElementRef<typeof View>>(); <ScrollView ref={myRef} /> // now, myRef.current can be used directly as the ref myRef.current.measure(); myRef.current.measureLayout(); // Additionally, myRef still has access to ScrollView methods myRef.current.scrollTo(...); ``` Changes: * Added deprecation warnings to ScrollView methods `getNativeScrollRef`, `getScrollableNode`, and `getScrollResponder` * Added the forwardRef call to create `ForwardedScrollView` - this takes in `ref` and passes it into the class ScrollView as `scrollViewRef`. * Forwarded the ref to the native scroll view using `setAndForwardRef`. * Added statics onto `ForwardedScrollView` so that `ScrollView.Context` can still be accessed. * Added type `ScrollViewImperativeMethods`, which lists the public methods of ScrollView. * Converted all public methods of ScrollView to arrow functions. This is because they need to be bound to the forwarded ref. * Bound all public methods of ScrollView to the forwarded ref in the `setAndForwardRef` call. * Flow typed the final output (ForwardedScrollView) as an abstract component that takes in the props of the `ScrollView` class, and has all methods of both the inner host component (`measure`, `measureLayout`, etc) and the public methods (`scrollTo`, etc). Changes to mockScrollView: * Changed mockScrollView to be able to mock the function component instead of a class component * Updated necessary tests Changelog: [General] [Changed] - Make ScrollView use forwardRef Reviewed By: TheSavior Differential Revision: D19304480 fbshipit-source-id: 6c359897526d9d5ac6bc6ab6d5f9d82bfc0d8af4 * Fix issue with onEndReached Summary: onEndReached can be triggered twice when more items are added to the end of the list. This change makes it so that a second call to onEndReached won't happen until the user scrolls down to the new end of the list. Changelog: [General] [Fixed] - Fix double call to onEndReached in VirtualizedList Reviewed By: sahrens Differential Revision: D20066740 fbshipit-source-id: 129d7ae6bfd241eeea18fe0bb12b82be67735874 * Remove console warnings from ScrollView methods Summary: The newly added console warnings in D19304480 are adding a lot of warning noise due to missed infra callsites. Those callsites need to be updated before these warnings can be added. Changelog: [Removed] Remove console warnings from ScrollView methods Reviewed By: rickhanlonii Differential Revision: D20700917 fbshipit-source-id: cb618ee3a291d26e1942e4f91bbc02dee41fb78b * Upgrade react-docgen, jscodeshift and flow-parser Summary: In preparation for upgrading babel, I'm updating some of our source transform tools to the latest versions. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D20675201 fbshipit-source-id: fa4fee2652529c6677087e42cdd1325a8080e46f * Ship State Reconciliation 100% on all platforms Summary: State Reconciliation has been running 50/50 for a while and all metrics look stable. This is necessary for providing a good experience so we should ship to everyone unconditionally. Changelog: [Internal] Fabric diffing reconciliation process improvement Reviewed By: mdvacca Differential Revision: D20715694 fbshipit-source-id: 25b2635ecc29b67e2911679c9db66bc84d37dec1 * Core telemetry tests: update so they pass on my machine Summary: `std::this_thread::sleep_for` is not really precise and will attempt to sleep for "at least" that much time, but may sleep much longer depending on what CPUs are doing and scheduling policies. To get this to pass on my machine, I had to substantially increase the thresholds. Changelog: [Internal] Reviewed By: shergin Differential Revision: D20689571 fbshipit-source-id: f159420d24a95da2b5d95d49ed7882e783291e98 * Optimize diff algorithm to produce fewer remove+insert ("move") paired instructions Summary: An evolution of D20633188 but more performant. There are three optimized paths before the slow path. The first optimized path tries to pair identical nodes from old/new tree, and generate Update mutations, until we hit nodes that are different (indicating either a remove or an insert). This already existed. The next two optimizations, introduced by Tim in his JS pseudocode, were inspired by ReactJS's diffing algorithm. They work in cases where the rest of the nodes are (1) all removals/deletes or (2) all creates+inserts. Finally, if those final two optimized paths can't run, it's because there is a mix of delete+remove, create+insert, and "move" operations, mixed at the beginning, middle, and/or end of the list. This has slightly better average/best-case complexity as the previous implementation. In particularly pathological cases where all nodes are arbitrarily reordered, or reversed, for instance (ABCDE->EDCBA) the algorithm has the same complexity as the previous algorithm (quadratic). For now iOS is pinned to the older differ Changelog: [Internal] Experiment to optimize diffing algorithm in Fabric Reviewed By: shergin Differential Revision: D20684094 fbshipit-source-id: d29fba95a0328156c023e1c87804f23770ee1d91 * Unit test for V2 "minimal instruction" diffing algorithm Summary: This unit test is to verify that the new diffing algorithm generates a "minimal" instruction set, with regards to removes and inserts ("moves"). These unit tests are here to verify the expected behavior in this new algorithm, but these tests may be modified or deleted in the future if we decide we want to change this behavior. Changelog: [Internal] fabric unit test Reviewed By: mdvacca Differential Revision: D20706592 fbshipit-source-id: 5f9991498e0d788ecbf88d938bfe6d3f0f27af40 * Add ES Lint rules for `DynamicColorIOS()`and `ColorAndroid()` (#28398) Summary: The [PlatformColor PR](https://github.com/facebook/react-native/pull/27908) added support for iOS and Android to express platform specific color values. The primary method for an app to specify such colors is via the `PlatformColor()` method that takes string arguments. The `PlatformColor` method returns an opaque Flow type enforcing that apps use the PlatformColor method instead of creating Objects from scratch -- doing so would make it harder to write static analysis tools around Color values in the future. But in addition to `PlatformColor()`, iOS has a `DynamicColorIOS()` method that takes an Object. The Flow type for this Object cannot be opaque, but we still want to enforce that app code doesn't pass variables instead of Object literals or that values in the Objects are variables. To ensure `DynamicColorIOS()` can be statically analyzed this change adds an ESLint rule to enforce that `DynamicColorIOS()` takes an Object literal of a specific shape. A `ColorAndroid()` was also introduced not for practical use but just to test having platform specific methods for more than one platform in the same app. A second ESLint rule is created for `ColorAndroid` as well. ## Changelog [General] [Changed] - Add ES Lint rules for `DynamicColorIOS()`and `ColorAndroid()` Pull Request resolved: https://github.com/facebook/react-native/pull/28398 Test Plan: `yarn lint` passes. Reviewed By: cpojer Differential Revision: D20685383 Pulled By: TheSavior fbshipit-source-id: 9bb37ccc059e74282b119577df0ced63cb9b1f53 * fix: Android gradle config when bundling for release (#28415) Summary: This fix aims to address the issue when bundling an Android app for release and getting the error exhibited in https://github.com/facebook/react-native/issues/28002 which I also encountered myself. The config was changed sometime in November 2019 (as part of https://github.com/facebook/react-native/issues/26940, commit https://github.com/facebook/react-native/commit/a3b08048674e324dbe1f0ca816f35607e9e06a2f) to be very opinionated when it comes to the use of `npx` which Gradle itself cannot find anyway (I have `npx` installed globally and it didn't pick it up). Another issue that the use of `npx` creates is that Gradle should only ever use the currently installed react-native cli rather than a (possibly) higher version which may not always have backward compatibility. The proposed change simply throws a more descriptive error rather than defaulting to a tool which may or may not exist on the machine, be it CI or a development environment. I've also modified the RNTester app to reflect the correct config implementation relative to the RNTester app itself. In real projects, the config inside `android/app/build.gradle` should look similar to the following snippet: ``` project.ext.react = [ cliPath: "$rootDir/../node_modules/react-native/cli.js", entryFile: "index.js" ]; ``` ## Changelog [Android] [Fixed] - Gradle release config Pull Request resolved: https://github.com/facebook/react-native/pull/28415 Test Plan: - [x] Successfully bundled an Android release build with correct config - [x] Works with RNTester app Reviewed By: mdvacca Differential Revision: D20714372 Pulled By: hramos fbshipit-source-id: 4d66139249c6f840582a71a48c64e6a6595f7af0 * Reimplement D19965405: Small improvements in Differentiator/TinyMap Summary: Two things: 1) I reimplement Valentin's idea in D19965405, so that TinyMaps can be iterated over, with a couple of bugfixes (calling front() or back() on an empty vector will crash). 2) I now use TinyMap instead of better::map in the "optimized" diffing algorithm. 3) `erase` now actually removes elements from the vector, but only when more than half of elements have been erased. 4) If you repeatedly erase elements at the beginning of the vector, they will no longer be iterated over. This is a specific optimization for our heaviest TinyMap use-cases. These amount to some small but hopefully somewhat meaningful perf improvements. Changelog: [Internal] Fabric perf Reviewed By: shergin Differential Revision: D20718719 fbshipit-source-id: 91f4b2e2e0f6387ae484e43d5b0095103087baa6 * Remove LayoutInspectingPolicy.includeScrollViewContentOffset Summary: `LayoutInspectingPolicy` has two flags, `includeTransform` and `includeScrollViewContentOffset`. `includeScrollViewContentOffset` seems to be redundant for two reasons. # 1st From looking at callers, they have always the same value. I looked at all call sites, and they are either always both set to true or both set to false. # 2nd The way we include scroll view content offset, is through transformation, so setting `includeTransform` to true and `includeScrollViewContentOffset` to false will include content offset anyway. In order to make both flags work, we would need to introduce further changes to `getRelativeLayoutMetrics`. But since the flag isn't used anyway, I think it is better to get rid of it for now. If we need it in the future, we could re-introduce it. Reviewed By: shergin Differential Revision: D20622256 fbshipit-source-id: fb6156c66b752319ea928239fa723ff90688b0a0 * Add support for translation and rotation to operator * between Rect and Transform Summary: Changelog: [Internal] Until now `Rect operator*(Rect const &rect, Transform const &transform)` supported only scaling. Now it supports translation and rotation as well. Reviewed By: shergin Differential Revision: D20622876 fbshipit-source-id: 1b65393bd3fd6fd9a8941903e0f2681a10097e4a * Include transform property when calling getRelativeLayoutMetrics Summary: Changelog: [Internal] Current implementation of `measure` doesn't take transform into account.. So if you had a view which has width and height 100 and had `Scale(0.5, 0.5, 1)` (this will shrink view by half). Calling `getRelativeLayoutMetrics` would report its size being `{100, 100}`. This applies if view's parent has transformation as well, because transformation is applied to all subviews of the view as well. Reviewed By: mdvacca Differential Revision: D20621590 fbshipit-source-id: 2cf902a0494291c821ecada56f810c5e6620db5a * feat: migrate appveyor to circleci (#28245) Summary: This issue closes https://github.com/facebook/react-native/issues/28241 Migrated Windows test from AppVeyor to CircleCI ## Changelog [Internal] [Changed] - Migrated Windows test from AppVeyor to CircleCI Pull Request resolved: https://github.com/facebook/react-native/pull/28245 Test Plan: For CircleCI to Pass Reviewed By: cpojer Differential Revision: D20689163 Pulled By: hramos fbshipit-source-id: 285c762457ef00f7884ee9157b3f336044c0452f * Remove "Debug with Nuclide" option Summary: This is no longer needed. Reviewed By: cpojer Differential Revision: D20722274 fbshipit-source-id: 5bc3104e90811d724f42aadbf137ab8eff718ca0 * experiment to preload RN bridge after fb4a bookmarks render Summary: Changelog: [Android][Internal] add internal supermodule label Reviewed By: mdvacca Differential Revision: D20434200 fbshipit-source-id: fae50309cdd0df4a4523c2f88d1c8e01a7163575 * Fix CursorDrawable Color Tint for Android 10+ Summary: Accessing this field via reflection is explicitly blacklisted by Google in Android 10 and higher. They have provided a new API to change the color, which I have implemented here. [The old setColorFilter is deprecated](https://developer.android.com/reference/android/graphics/drawable/Drawable#setColorFilter(int,%20android.graphics.PorterDuff.Mode)) so I also updated that method call as well. Changelog: [General] [Fixed] Use new setTextCursorDrawable API for Android 10 Reviewed By: JoshuaGross Differential Revision: D20656068 fbshipit-source-id: 58a92b57c0a892c7c87fc5d735e4ceaa4e987ec7 * Early return on tinting CursorDrawable if no color supplied Summary: There's (potentially) a lot of expensive reflection calls here that, as best I can tell, end up being ignored if the supplied color is null. Better to early return. Changelog: [General] [Internal] Preclude reflection when setting cursor color if color is null Reviewed By: JoshuaGross Differential Revision: D20670594 fbshipit-source-id: 480a988355bbd79008002c4326d4b35035ec2a95 * Partial React Sync for Inspector Summary: Partial sync for React that includes: - https://github.com/facebook/react/pull/18388 - https://github.com/facebook/react/commit/dd7e5e4f5ac2ffac3171ef61daee2cb1edc69635 Created from this branch: https://github.com/facebook/react/compare/master...rickhanlonii:rh-partial-3-24?expand=1 Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20651395 fbshipit-source-id: 67baf7c407f75d9fd01c17f2203a77a38567100e * Enable inspector for Fabric Summary: ## Overview This diff refactors the Inspector, moving logic to look up view data for a touched view inside the renderer as `getInspectorDataForViewAtPoint`. We then implement that same function for Fabric in order to support the inspector in that renderer. Requires https://github.com/facebook/react/pull/18388 ## Motivation Reason one for this refactor is that, previously, the inspector held all of the logic to look up view data for a given x,y touch coordinate. To do this, it would take the React tag and coordinates, look up the native view tag, measure it, and then ask React internals for the Fiber information of that tag. All of this is deeply coupled to React internals, yet the logic is outside of React core in the Inspector. Reason two is that, for Fabric, the logic for getting the view data is different than Paper. In Fabric, we pass the x,y coordinates to native directly, which returns an instance handle. That handle can be used to measure the ShadowNode, or retrieve the Fiber information. By moving the logic into the renderer in React core, we decouple the implementation details of looking up view data for a tapped point and allow ourselves the ability to add and change renderer-specific code for the actual lookup without impacting outsiders like the Inspector. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D20291710 fbshipit-source-id: a125223f2e44a6483120c41dc6146ad75a0e3e68 * chore: update url of warning message from deprecated imports (#28452) Summary: Some of the repository name of Lean Core(https://github.com/facebook/react-native/issues/23313) libraries has been renamed. This PR updates the warning message to display the updated url. ## Changelog [General] [Changed] - Update warning message of deprecated imports Pull Request resolved: https://github.com/facebook/react-native/pull/28452 Test Plan: updated URL can be accessed. Reviewed By: cpojer Differential Revision: D20745184 Pulled By: TheSavior fbshipit-source-id: 2c3ed6a000b45022ca6c4862305aa567c4d18b2e * Add `upgrade-support` link on issue creation (#28411) Summary: This PR adds a https://github.com/react-native-community/upgrade-support link for the user when creating an issue. Changelog: [Internal] Pull Request resolved: https://github.com/facebook/react-native/pull/28411 Reviewed By: cpojer Differential Revision: D20714274 Pulled By: hramos fbshipit-source-id: 4ca42224a50e386b95f21f0fb236a917e1b6b982 * Update PixelRatio 'getFontScale' method description (#28407) Summary: Refs facebook/react-native-website#1776. Despite in-code description `PixelRatio.getFontScale()` is working properly on the iOS (it also reflects the user settings). This PR updates the in-code description to match current behaviour. I have decided to skip in the code information about additional setting in `Accessibility` menu and in `Control Centre`, but if you think it is important just let me know, I can update this PR. ## Changelog [Internal] [Fixed] - Fix PixelRatio getFontScale method description Pull Request resolved: https://github.com/facebook/react-native/pull/28407 Test Plan: N/A Differential Revision: D20750260 Pulled By: shergin fbshipit-source-id: c40ec2fd49cd60e2975351c3a1c453aab0045da4 * Remove allowDisablingImmediateExecutionOfScheduleMountItems feature flag Summary: No longer needed. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20747684 fbshipit-source-id: a8077519b7670d72e23267b1c1423556ec97be3f * RuntimeExecutor helpers that modify the way of the callback is being executed. Summary: Here we implement a bunch of helper methods that allow customizing the behavior of a RuntimeExecutor "on-demand" on the caller side. We will use it in the next diff(s). Changelog: [Internal] Fabric-specific internal change. Reviewed By: PeteTheHeat Differential Revision: D20551411 fbshipit-source-id: 51d3cd02b69753110c0e1155347c6e52eb882c7d * Fabric: Using `executeSynchronouslyOnSameThread_CAN_DEADLOCK` in MainRunLoopEventBeat Summary: We are replacing inline-ed implementation with practically the same one implemented as the helper method. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20551409 fbshipit-source-id: fcc6f497cd240af65fba534051c217fe5746ce82 * Set RootNodeKind trait in ModalHostViewShadowNode Summary: Changelog: [internal] `ModalHostViewShadowNode` didn't have `RootNodeKit` trait, therefore `getRelativeLayoutMetrics` was including nodes in ancestors that it shouldn't have. Reviewed By: shergin Differential Revision: D20735801 fbshipit-source-id: 6b81e3b174c2f82e530abc2bca2da8bebc2270b0 * mention RNTester app in contributor guide (#28042) Summary: motivation is following - the RNTester app is imho the best place to try out any changes that a contributor would make, yet it is not directly mentioned in the contributor guide. This fixes it. ## Changelog [Internal] - Docs Pull Request resolved: https://github.com/facebook/react-native/pull/28042 Test Plan: not necessary Reviewed By: TheSavior Differential Revision: D20401260 Pulled By: hramos fbshipit-source-id: 01c1b7dff56b59909c94b2feb609650f0baba1a9 * Buck: Use Android SDK 29 during build (#28455) Summary: Fixes `test_android` and `test_docker` build failures. Thanks to dulmandakh for identifying the fix. Changelog: [Internal] [Android] [Changed] - Use Android SDK 29 to build during CI tests Pull Request resolved: https://github.com/facebook/react-native/pull/28455 Test Plan: Circle CI shows `test_android` and `test_docker` passing: https://app.circleci.com/jobs/github/facebook/react-native/142273 Reviewed By: sturmen Differential Revision: D20766589 Pulled By: hramos fbshipit-source-id: 8ef8a8ce3a6e7353ae47425accb3bd26cf1608c4 * Assign orderIndex_ in ConcreteViewShadowNode constructor instead of ViewShadowNode's constructor Summary: Changelog: [Internal] `orderIndex_` was only being assigned for `ViewShadowNode`, not for other `ShadowNodes` that are later represented on the screen. Reviewed By: shergin Differential Revision: D20746477 fbshipit-source-id: c04c2cfea14b9141d22bc3d9e9bb4c0c59925754 * Implement nativePerformanceNow to improve Profiler API results (#27885) Summary: When experimenting with React Profiler API (https://reactjs.org/docs/profiler.html), I noticed that durations are integers without a debugger, but they are doubles with higher precision when debugger is attached. After digging into React Profiler code, I found out that it's using `performance.now()` to accumulate execution times of individual units of work. Since this method does not exist in React Native, it falls back to Javascript `Date`, leading to imprecise results. This PR introduces `global.nativePerformanceNow` function which returns precise native time, and a very basic `performance` polyfill with `now` function. This will greatly improve React Profiler API results, which is essential for profiling and benchmark tools. Solves https://github.com/facebook/react-native/issues/27274 ## Changelog [General] [Added] - Implement `nativePerformanceNow` and `performance.now()` Pull Request resolved: https://github.com/facebook/react-native/pull/27885 Test Plan: ``` const initialTime = global.performance.now(); setTimeout(() => { const newTime = global.performance.now(); console.warn('duration', newTime - initialTime); }, 1000); ``` ### Android + Hermes ![Screenshot_1580198068](https://user-images.githubusercontent.com/13116854/73245757-af0d6c80-41b5-11ea-8130-dde14ebd41a3.png) ### Android + JSC ![Screenshot_1580199089](https://user-images.githubusercontent.com/13116854/73246157-92256900-41b6-11ea-87a6-ac222383200c.png) ### iOS ![Simulator Screen Shot - iPhone 8 - 2020-01-28 at 10 06 49](https://user-images.githubusercontent.com/13116854/73245871-f136ae00-41b5-11ea-9e31-b1eff5717e62.png) Reviewed By: ejanzer Differential Revision: D19888289 Pulled By: rickhanlonii fbshipit-source-id: ab8152382da9aee9b4b3c76f096e45d40f55da6c * Save/restore IP when leaving the interpreter Summary: This diff implements the instruction pointer save/restore trick Tzvetan came up with; allowing us to observe and modify the IP from outside the interpreter loop with negligible overhead. From Tzvetan's internal post on the subject: > [Today] the interpreter IP is just a local variable in the interpreter function, so there is no way to get to its value from outside the function. It lives in a register and we don't want to make it a Runtime field since the overhead [of accessing it via memory in the interpeter loop] would kill us. > However, if you really think about it, it only lives in a register while the interpreter function is running. For the rest of the time, it is spilled by the C++ compiler onto the stack. So, precisely when we need it, it is actually stored in memory. The only problem is, we don't know where! Admittedly, that is an annoying problem, but it feels like it should be solvable. > What if, instead of relying on the compiler to spill the IP register, we manually spill it ourselves, to a known location? It works. Example: https://godbolt.org/z/ftSDnp This diff implements this approach across the whole interpreter loop: whenever we call out of the loop we capture/publish the IP and restore it again immediately after the external call returns. This means we can now see the IP outside the interpret loop and even change it. This is effectively "for free" as the compiler now skips spilling/restoring the IP behind the scenes. The immediate benefit of this is knowing the current IP allows us to have more accurate stack-traces during execution. In future this may enabled tricks like changing the IP before returning to the interpreter loop, allowing things outside the interpreter to affect program flow without adding logic to the interpreter loop. Reviewed By: tmikov Differential Revision: D20151091 fbshipit-source-id: 3814382639800208d8985a32ede31ba8f7ff7c80 * Plumb through memory allocation profiler feature to Chrome Inspector Summary: Changelog: Make allocation profiler feature of Chome Inspector work Reviewed By: dulinriley Differential Revision: D20383003 fbshipit-source-id: 8a10c310d5a639a6644763adb53f2f0017057587 * chore: update lint config in template (#28443) Summary: Updating the eslint config and metro-preset used in project template. ## Changelog [General] [Changed] - Upgrade eslint-config and metro-preset in project template Pull Request resolved: https://github.com/facebook/react-native/pull/28443 Test Plan: - Start new project with `npx react-native init TestLint` - upgrade lint and metro-config - run lint and start up emulator on iOS and android Reviewed By: cpojer Differential Revision: D20771048 Pulled By: hramos fbshipit-source-id: a6d387b8687cee348681bcb10d22c7e3de291ed7 * Apply buckformat in preparation for updating buildifier Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D20773287 fbshipit-source-id: 144bb13191312eef246646b99e1dc06304c6d210 * Circle CI Housekeeping: Windows, e2e (#28471) Summary: Circle CI Housekeeping: * Integrate Windows job into `tests` workflow * Add parametrized e2e tests command * Move js e2e tests out of the disabled test quarantine area * Parametrize and split `test_ios` job to reduce total execution time by ~13 minutes **Before:** Longest running iOS job at 39 minutes. | Setup Job Runtime | Job | Job Runtime | Total Runtime | | - | - | - | - | | 01:24 | test_ios | 38:04 | **39:28** | | 01:24 | test_ios_frameworks | 38:02 | 39:26 | ![Screen Shot 2020-03-31 at 12 40 29 PM](https://user-images.githubusercontent.com/165856/78068308-044c3280-734d-11ea-96bf-2e50691a0ef7.png) **After:** Longest running iOS job down to 26 minutes. | Setup Job Runtime | Job | Job Runtime | Total Runtime | | - | - | - | - | | 01:26 | test_ios_unit | 20:48 | 22:14 | | 01:26 | test_ios_unit_frameworks | 22:52 | 24:18 | | 01:26 | test_ios_detox | 24:35 | 39:28 | | 01:26 | test_ios_detox_frameworks | 24:54 | **26:20** | ![Screen Shot 2020-03-31 at 12 39 22 PM](https://user-images.githubusercontent.com/165856/78068294-fe565180-734c-11ea-96da-8836231d7747.png) ## Changelog [Internal] [CI] - CI Housekeeping Pull Request resolved: https://github.com/facebook/react-native/pull/28471 Test Plan: Circle CI Reviewed By: cpojer Differential Revision: D20774521 Pulled By: hramos fbshipit-source-id: 4a2f5a4083cd76dcb51d5ccaf726cd204fca222e * Fix bug in optimized differ Summary: The differ was still producing correct, but not minimal, instruction sets in some cases due to an optimization that was buggy. This affected cases where 2+ nodes were inserted at the beginning of a list. It would trigger the old behavior where all nodes after the first would be removed, deleted, then reinserted. See the test case (which was failing and now passed) and P128190998 (the 3->4 transition) for samples. Changelog: [Internal] Fabric differ Reviewed By: mdvacca Differential Revision: D20785729 fbshipit-source-id: 2fea6a816753066abb358ed7bb51003140cd5fc4 * Use `buildCodeFrameError` in babel-plugin-inline-view-configs Summary: The next version of Babel changes how it prints file names in errors. This diff fixes the test by using `/` as the `cwd` and switches the plagin to use `path.buildCodeFrameError` so errors will be more helpful for users. I renamed the `nodePath` variable to `path` because that's what babel plugins usually do. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D20781805 fbshipit-source-id: cc149dce6389aa9402ce70ea30035c74a6150ea3 * Swap left and right yoga position with start and end in RTL context Summary: Changelog: [Internal] Paper swaps right and left in RTL setting, this logic is in [RCTShadowView.m](https://our.intern.facebook.com/intern/diffusion/FBS/browse/master/xplat/js/react-native-github/React/Views/RCTShadowView.m?commit=cdd504cfbee66ae0659495604c4ff7b5764a1d9e&lines=529-549). For Fabric instead of doing it during yoga props assignment, I swap the left/right with start/end just before we pass yoga nodes to layout calculation. Reviewed By: shergin Differential Revision: D20420040 fbshipit-source-id: b777f2658f56c173743b2034b8b5059e3e0c9840 * Fix inline-view-configs test on Windows. Summary: *facepalm* The file path is platform specific. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D20793023 fbshipit-source-id: 4fbcbf982911ee449a4fa5067cc0c5d81088ce04 * Pass isRTL flag from FabricUIManager Fabric core Summary: Changelog: [Internal] Send `isRTL` flag and `doLeftAndRightSwapInRTL` flags from Java to Fabric Core. Reviewed By: JoshuaGross, mdvacca Differential Revision: D20776005 fbshipit-source-id: 946c239d9a11ebea958b0a6d04f2316b7cd77311 * Promote shadowColor to formsStackingContext property Summary: Changelog: [Internal] View with `ShadowColor` was getting flattened and therefore views didn't have shadow property set. This is fixed by promoting ShadowColor so in case it is set, it forms stacking context. Reviewed By: shergin Differential Revision: D20792201 fbshipit-source-id: 1033ac00e32047ffbb14e61b7c26348c578d132d * Get CallInvokers from the bridge Summary: ## Context For now, assume TurboModules doesn't exist. **What happens when we call an async NativeModule method?** Everytime JS calls an async NativeModule method, we don't immediately execute it. The legacy infra pushes the call into some queue managed by `MessageQueue.js`. This queue is "flushed" or "emptied" by the following events: - **Flushed:** A C++ -> JS call. NativeModule async methods can called with an `onSuccess` and/or `onFail` callback(s). Calling `NativeToJsBridge::invokeCallback` to invoke one of these callbacks is one way for ObjC++/C++/Java to call into JS. Another way is via JSModule method calls, which are initiated by `NativeToJsBridge::callFunction`. - **Flushed:** When `JSIExecutor::flush` is called. Since TurboModules don't exist, this only happens when we call `JSIExecutor::loadApplicationScript`. - **Emptied:** When more than 5 ms have passed, and the queue hasn't been flushed/emptied, on the next async NativeModule method call, we add to the queue. Afterwards, we empty it, and invoke all the NativeModule method calls. **So, what's the difference between flushed and emptied?** > Note: These are two terms I just made up, but the distinction is important. If the queue was "flushed", and it contained at least one NativeModule method call, `JsToNativeBridge` dispatches the `onBatchComplete` event. On Android, the UIManager module is the only module that listens to this event. This `onBatchComplete` event doesn't fire if the queue was "emptied". **Why does any of this matter?** 1. TurboModules exist. 2. We need the TurboModules infra to have `JsToNativeBridge` dispatch `onBatchComplete`, which depends on: - **Problem 1:** The queue being flushed on calls into JS from Java/C++/ObjC++. - **Problem 2:** There being queued up NativeModule async method calls when the queue is flushed. In D14656466, fkgozali fixed Problem 1 by making every C++/Java/Obj -> JS call from TurboModules also execute `JSIExecutor::flush()`. This means that, with TurboModules, we flush the NativeModule async method call queue as often as we do without TurboModules. So far, so good. However, we still have one big problem: As we convert more NativeModules to TurboModules, the average size of the queue of NativeModule method calls will become smaller and smaller, because more NativeModule method calls will be TurboModule method calls. This queue will more often be empty than not. Therefore, we'll end up dispatching the `onBatchComplete` event less often with TurboModules enabled. So, somehow, when we're about to flush the NativeModule method call queue, we need `JsToNativeBridge` to understand that we've executed TurboModule method calls in the batch. These calls would have normally been queued, which would have led the queue size to be non-zero. So if, during a batch, some TurboModule async method calls were executed, `JsToNativeBridge` should dispatch `onBatchComplete`. **So, what does this diff do?** 1. Make `Instance` responsible for creating the JS `CallInvoker`. 2. Make `NativeToJsBridge` responsible for creating the native `CallInvoker`. `Instance` calls into `NativeToJsBridge` to get the native `CallInvoker`. 3. Hook up `CatalystInstanceImpl`, the Android bridge, with the new JS `CallInvoker`, and the new native `CallInvoker`. This fixes `onBatchComplete` on Android. iOS work is pending. Changelog: [Android][Fixed] - Ensure `onBatchComplete` is dispatched correctly with TurboModules Reviewed By: mdvacca Differential Revision: D20717931 fbshipit-source-id: bc3ccbd6c135b7f084edbc6ddb4d1e3c0c7e0875 * Make HermesRuntime::description() always include "HermesRuntime" Summary: If name is passed in as part of RuntimeConfig, that is included in the description, too. Changelog: [Internal] Reviewed By: dulinriley Differential Revision: D20716320 fbshipit-source-id: f2fba6df32f496090dee787d8b7f55a6a4dd8ed8 * Fix Yoga flexshrink with min-width sizing issue Summary: While resolving the flexible items we calculate totalFlexShrinkScaledFactors which uses the flexBasis or initial width of node (Not min-width). At a later stage during distribution of space we are subtracting value from this which also takes care of min-width. For example If node has flexShrink 1 and width 100 and min-width 301 then totalFlexShrinkScaledFactors will become -1*100 = -100 but later we are subtracting -1 * 301 (min-width) = -301 which is ambiguous and causing layout inconsistencies with how web behaves. Fixed this by only using the flexBasis or width for these calculations. Changelog: [Internal][Yoga] Fix layout issue when flexShrink and min-width are used together Reviewed By: pasqualeanatriello Differential Revision: D20219419 fbshipit-source-id: 948fbc06ca541d4ad307c88c8a2df65d157778b1 * More consistent snapshots on windows (#28482) Summary: Get jest tests to be runnable on windows, and match current snapshots ## Changelog [Internal] [Fixed] - More consistent snapshots on windows Pull Request resolved: https://github.com/facebook/react-native/pull/28482 Test Plan: run `yarn test` on a windows machine, and hit the test_windows circleci tests Reviewed By: hramos Differential Revision: D20799002 Pulled By: cpojer fbshipit-source-id: da3db0171c34a43199c7d3dc17b622b37bc91701 * Improve component stack parsing Summary: Update the error log message parsing to fix missing component stacks in console.errors. Changelog: [Internal] Reviewed By: cpojer Differential Revision: D20801985 fbshipit-source-id: ae544200315a8c3c0310e8370bc38b0546734f38 * Implement RCTWarn equivalent on Android Summary: ## Overview This diff is an RFC to port a logging feature from iOS to Android. Changelog: [Internal] ## Motivation On iOS we have the following log functions and behaviors available for logging native warnings and errors: - **Warnings** (`RCTLogWarn`) - Log level 'warn' to console - Display warning in LogBox - **Errors** (`RCTLogError`) - Log level 'error' to console - Display a native RedBox (needs converted to show a LogBox if available) - **Logs** - We also have `RCTLog`, `RCTTrace`, `RCTAdvice`, `RCTInfo`, which just log to the console. In Java, we have: - **Warnings** - **None**, added in this diff - **Errors** (`DevSupportManager.showNewJavaError`) - Log level 'error' to console with `FLog.e` - Display a native RedBox (needs converted to show a LogBox if available - **Logs** - `ReactSoftException` (crashes the app??) - `ReactNoCrashSoftException` (only logs??) - Others? ## Details This diff adds a method to pair with `RCTLogWarn`, `DevSupportManager.showNewJavaWarning`, which will log to the console and show a LogBox warning if LogBox is available. ## Concerns I have a few concerns/questions about the state of logging on Android: - Should/can we move all of the logging to it's own class, like how RCTLog works? - Why does some logging happen on DevSupportManager and some in other classes? - If we moved it all to it's own class, how could we access the reactContext to call the RCTLog JS module Reviewed By: JoshuaGross Differential Revision: D20056394 fbshipit-source-id: 32d57e300685e46da8039fc77cb22b4084acf81a * Remove unused feature flag: useMapNativeAccessor Summary: useMapNativeAccessor isn't being used anywhere. Changelog: [Internal] Removing unused internal feature flags: mUseMapNativeAccessor and mUseArrayNativeAccessor Reviewed By: mdvacca Differential Revision: D20788147 fbshipit-source-id: bf670508326813602cb544f86d3d2164651d3394 * Remove unused Feature Flag: lazilyLoadViewManagers Summary: Remove unused feature flag. This is not used within Facebook and I'm not aware of usage outside of FB. Changelog: [Removed] Removing Android feature flag: lazilyLoadViewManagers Reviewed By: mdvacca Differential Revision: D20788210 fbshipit-source-id: 435316e3de7830d7cb7f14537351883e4fc6eeaa * Remove unused feature flag: enableExtraWebViewLogs Summary: Hard-coded to false everywhere, and write-only. We never read from this. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20788252 fbshipit-source-id: ae117ebc51db7045947b9713602527ff4220833e * Remove unused feature flag: logDroppedViews Summary: Remove unused internal feature flag, logDroppedViews. Changelog: [Internal] Reviewed By: lunaleaps Differential Revision: D20797353 fbshipit-source-id: 1bfea7fcce9e80cdb92cda59a89c7dd817d4a581 * Split loadApplicationScript into initializeRuntime and loadBundle (#27844) Summary: This is the first of three PRs related to enabling multi-bundle support in React Native. More details, motivation and reasoning behind it can be found in RFC [here](https://github.com/react-native-community/discussions-and-proposals/issues/152). Logic responsible for installing globals was pulled out from `loadApplicationScript` to `initializeRuntime` since it should be ran only once, what was left was renamed to `loadBundle`. It's based on dratwas work from [here](https://github.com/callstack/react-native/tree/feat/multibundle/split-load-application), but applied to current `master` to avoid rebasing 3-months old branch and issues that come with that. ## Changelog [Internal] [Changed] - split `loadApplicationScript` into `initializeRuntime` and `loadBundle` to enable multi-bundle support in the future Pull Request resolved: https://github.com/facebook/react-native/pull/27844 Test Plan: Initialized new RN app with CLI, set RN to build from source and verified the still app builds and runs OK using code from this branch. Reviewed By: rickhanlonii Differential Revision: D19888605 Pulled By: ejanzer fbshipit-source-id: 24ace48ffe8978796591fe7c6cf53a61b127cce6 * Back out "Fix controlled TextInput with child nodes" Summary: Changelog: [Internal] Original commit changeset: 1b8a2efabbfa Original diff D20587681 breaks non-controlled text input. Reviewed By: motiz88 Differential Revision: D20815935 fbshipit-source-id: 70577ed1e5701850ff0e30a6592945a31c2a8bec * Fixed crash in JSIExecutor::NativeModuleProxy Summary: JSIExecutor::NativeModuleProxy is an object created by JSIExecutor and essentially representing that in JavaScript world. Before this change, JSIExecutor::NativeModuleProxy had a raw reference to JSIExecutor which (I believe) caused a crash because JSIExecutor can be deallocated before JSIExecutor::NativeModuleProxy. Now, instead of storing a pointer to JSIExecutor, we store a weak pointer to JSINativeModules which we can safely validate before calling on it. Changelog: [Internal] Fixed crash in JSIExecutor Now the configuration looks like this: ``` + - - - - - - - - - - - - - - - - - - - - - Something else | | shared_ptr<jsi::Runtime> runtime --+ | | + - - - - - - - - - - - - - - - - - - - - - | | | +------------------------------------------+ | | | | | JSExecutorFactory | | +--------------------------------+-------------------------------+ | | +-----------------------+ | | | +------------------------------------------+ | | v | | | +------------------------------------------+ | +--------------------------+ | | | | | | | | ModuleRegistry | | v | | | | | +------------------------------------------+ | | +------------------------------------------+ | | HermesRuntimeImpl | | | | | | (jsi::Runtime) |--+ | | +->+------------------------------------------+ | | | | | | | |std::unordered_map<std::string, size_t> | | +------------------------------------------+ | | | | |modulesByName_ | | | | | | | | | | | | | +------------------------------------------+ | | | | +->+------------------------------------------+ | +-----------------------+ | | |std::vector<std::unique_ptr<NativeModule>>| | | | | |modules_ | | | | | | | | v | | +------------------------------------------+ | +------------------------------------------+ | | | | | | | | | JSIExecutor::NativeModuleProxy | | | | | | | | | +------------------------------------------+ | | | +------------------------------------------+ | | | | | | +->+------------------------------------------+ | | | | NativeToJsBridge | |shared_ptr<JSINativeModules> | | | | | | |nativeModules_ | | | | +------------------------------------------+ +------------------------------------------+--+-----+------------------------------------+ | | | | | | +->+------------------------------------------+ | | | | | |unique_ptr<JSExecutor> | | | | | | |m_executor | | | | | | |(`::destroy()` resets it.) | | | | | | +------------------------------------------+--------------------------------+ | | | | +->+------------------------------------------+ | | | | | | |shared_ptr<JsToNativeBridge> | | | | | | | |m_delegate | | | | | | | +------------------------------------------+--+ v | | | | +->+------------------------------------------+ | +------------------------------------------+ | | | | |shared_ptr<MessageQueueThread> | | | | | | | | |m_executorMessageQueueThread | | | HermesExecutor: JSIExecutor: JSExecutor | | | | | +------------------------------------------+ | | | | | | | | +------------------------------------------+ | | | | | | | | | | | +->+------------------------------------------+ | | | | | | |shared_ptr<jsi::Runtime> | | | | | | | |runtime_ | | | | | | | +------------------------------------------+--+ | | | | +->+------------------------------------------+ | | | | | |shared_ptr<JSINativeModules> | | | | | | |nativeModules_ | | | | | | +------------------------------------------+--------+------------------------------------+ | +--------------------------+ +->+------------------------------------------+ | | | | |std::shared_ptr<ExecutorDelegate> | | v | | |delegate_ | | +------------------------------------------+ | | +------------------------------------------+--+ | | | | | | | | JSINativeModules | | | | | | | | | | | +------------------------------------------+ | | | | | | | | | +-->+------------------------------------------+ | +-----------------------------------------------------------------------------------+ | |m_moduleRegistry | | | | |(shared_ptr) | | | | +------------------------------------------+--+ | | | | v | +------------------------------------------+ | | | | | JsToNativeBridge: ExecutorDelegate | | | | | +------------------------------------------+ | | | +->+------------------------------------------+ | |shared_ptr<ModuleRegistry> | | |m_registry | | +------------------------------------------+-----------------------------------------------------------------+ ``` Reviewed By: RSNara Differential Revision: D20817257 fbshipit-source-id: 9ae378dbe880aaabfef7ae783dae2f94ee4b0af5 * Fix crash caused by <Modal> trying to present view controller twice Summary: Changelog: [Internal] `_viewController` was being presented twice causing following exception ``` 'Application tried to present modally an active controller <FBReactRootViewController: 0x7fe741818b80; ``` Reviewed By: shergin Differential Revision: D20820395 fbshipit-source-id: 5c9489011e5f99d8bd37befbd544d2d55a650589 * Loosen up restrictions for internal changelogs (#28486) Summary: Do not nag on PRs that contain internal changelogs (meaning, the change doesn't need to be called out in release notes). ## Changelog [Internal] - This should be acceptable. Pull Request resolved: https://github.com/facebook/react-native/pull/28486 Test Plan: See PR. Reviewed By: cpojer Differential Revision: D20817454 Pulled By: hramos fbshipit-source-id: a7082c4db05ec53ad27349db7e5bce2cfffd6930 * Fix TextInlineViews when UIImplementation processes two roots at the same time Summary: This diff cleans the variable NativeViewHierarchyOptimizer.mTagsWithLayoutVisited right after all the view updates for a rootShadowNode have been processed by the UIImplementation class. This intends to fix the bug reported in the task: T61185028, which root cause seems related to the fact that the variable NativeViewHierarchyOptimizer.mTagsWithLayoutVisited is not cleaned up when updating multiple rootShadowNodes as part of the same batch changelog: [Android][internal] internal bug fix Reviewed By: JoshuaGross Differential Revision: D20812921 fbshipit-source-id: 28067ee29a931d7a9e9c33c90aceb4e3512dac1a * Add a React Feature Flag to control TextInlineView fix Summary: This diff adds a temporary Feature Flag to control a fix in TextInlineView (see previous diffs of the stack) changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D20812920 fbshipit-source-id: 90fece9b29ba173546d96e4d9baf1ccabb3031b2 * Pass native CallInvoker to ObjCTurboModule constructor Summary: This is necessary to integrate TurboModule async method dispatch with the bridge's `onBatchComplete` event. See D20717931 for more details. This diff is similar to D20480971. **Note:** This stack doesn't really make any functional changes, since the native CallInvoker is `nullptr` right now. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809199 fbshipit-source-id: bf465a3a51bdddb8b56d1e696ca510fdf071f9ec * Manual changes required to make ObjCTurboModule accept native CallInvoker Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809200 fbshipit-source-id: d540eec9a3360a031f75d76a6ab9fb15303f8af5 * Codemod all getTurboModuleWithJsInvoker methods to accept a native CallInvoker Summary: To make iOS TurboModules integrate with the bridge's onBatchComplete event, they need to use a native CallInvoker. This call invoker is created by the `NativeToJsBridge`, and ObjCTurboModule will use this native CallInvoker to dispatch TurboModule method calls. This diff makes sure that ObjCTurboModules are created with that native CallInvoker. ## Script ``` var withSpaces = (...args) => args.join('\s*') var regexString = withSpaces( '-', '\(', 'std::shared_ptr', '<', '(?<turboModuleClass>(facebook::react::|react::|::|)TurboModule)', '>', '\)', 'getTurboModuleWithJsInvoker', ':', '\(', 'std::shared_ptr', '<', '(?<callInvokerClass>(facebook::react::|react::|::|)CallInvoker)', '>', '\)', '(?<jsInvokerInstance>[A-Za-z0-9]+)', 'perfLogger', ':', '\(', 'id', '<', 'RCTTurboModulePerformanceLogger', '>', '\)', '(?<perfLoggerInstance>[A-Za-z0-9]+)', '{', 'return', 'std::make_shared', '<', '(?<specName>(facebook::react::|react::|::|)Native[%A-Za-z0-9]+SpecJSI)', '>', '\(', 'self', ',', '\k<jsInvokerInstance>', ',', '\k<perfLoggerInstance>', '\)', ';', '}', ) var replaceString = `- (std::shared_ptr<$<turboModuleClass>>) getTurboModuleWithJsInvoker:(std::shared_ptr<$<callInvokerClass>>)$<jsInvokerInstance> nativeInvoker:(std::shared_ptr<$<callInvokerClass>>)nativeInvoker perfLogger:(id<RCTTurboModulePerformanceLogger>)$<perfLoggerInstance> { return std::make_shared<$<specName>>(self, $<jsInvokerInstance>, nativeInvoker, $<perfLoggerInstance>); }` const exec = require('../lib/exec'); const abspath = require('../lib/abspath'); const relpath = require('../lib/relpath'); const readFile = (filename) => require('fs').readFileSync(filename, 'utf8'); const writeFile = (filename, content) => require('fs').writeFileSync(filename, content); function main() { const tmFiles = exec('cd ~/fbsource && xbgs -n 10000 -l getTurboModuleWithJsInvoker:').split('\n').filter(Boolean); tmFiles .filter((filename) => !filename.includes('microsoft-fork-of-react-native')) .map(abspath) .forEach((filename) => { const source = readFile(filename); const newSource = source.replace(new RegExp(regexString, 'g'), replaceString); if (source == newSource) { console.log(relpath(filename)); } writeFile(filename, newSource); }); } if (!module.parent) { main(); } ``` Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809202 fbshipit-source-id: 5d39b3cacdaa5681b70ce1803351d0432dd74550 * Make RCTTurboModuleManagerDelegate getTurboModule accept native CallInvoker and PerfLogger Summary: Might be worthwhile to just kill this method instead, since we're having all NativeModules provide their TurboModule jsi::HostObjects. But I'll leave that decision to a later time. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809201 fbshipit-source-id: ee73d4b5454a76460832a54f9b864841e5b2b9c0 * eslint-config: add version badge and add homepage for eslint-config (#28506) Summary: Add version badge to README of eslint-config, and add specific url for the homepage so people looking at the npm package can find out where the package is from. ## Changelog [Internal] [Changed] - Add version badge to README of eslint-config Pull Request resolved: https://github.com/facebook/react-native/pull/28506 Test Plan: Not required as the only changes are made in README and homepage prop of package.json Differential Revision: D20837085 Pulled By: cpojer fbshipit-source-id: 820d3b44b069780ec8764c6152d2e7fd5220933c * Rename Instance::getNativeCallinvoker to Instance::getDecoratedNativeCallInvoker Summary: Now, instead of accepting a `std::function` that schedules work, and returning a `CallInvoker`, `Instance::getDecoratedNativeCallInvoker` will accept a `CallInvoker` that schedules work, and return a decorated `CallInvoker`. I think this change will help with readability. It also clarifies that the bridge is adding additional behaviour to the native `CallInvoker`. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20826885 fbshipit-source-id: a2c5681d10a4544ee3d2a0d1f1cbd386ef06d0e6 * Add CallInvoker::invokeSync Summary: We'll be using a native CallInvoker to dispatch sync and async method calls to ObjC NativeModules. This native CallInvoker will hold a reference to the ObjC NativeModule's method queue. **Why is the native CallInvoker required for ObjC NativeModules?** In the case where the ObjC NativeModule neither provides nor requests a method queue, we must create a method queue for it. When we go to invoke a method from JS, for these NativeModules specifically, there is no way to access this method queue. A native CallInvoker is a convenient abstraction that holds on to that method queue. For async calls, we'll just call `CallInvoker::invokeAsync`, and for sync calls, we'll just call `CallInvoker::invokeSync`. **Why do we need sync call support for native `CallInvoker`?** In ObjC, sync NativeModule method calls block the JS thread, then execute synchronously on the NativeModule's method queue, and then unblock the JS thread. This is what'll be implemented by `CallInvoker::invokeSync`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20829955 fbshipit-source-id: efb9d5408a1ade81069a943c865f232d4d10acfe * Export Instance::getDecoratedNativeCallInvoker from RCTCxxBridge Summary: `RCTTurboModuleManager` will create a native `CallInvoker` for each ObjC NativeModule. This `CallInvoker` will be used to dispatch calls from JS to native. Before passing the native `CallInvoker` to the `ObjCTurboModule`, it'll first use `RCTCxxBridge decorateNativeCallInvoker` to get a bridge-aware decorated native `CallInvoker`. That way, the bridge remains informed about async TurboModule method calls that took place since the last time it was flushed. This ensures that we don't end up dispatching `onBatchComplete` any less with TurboModules on than we do with TurboModules off. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20831546 fbshipit-source-id: b2eb4e0097e0dabf8c4bd8fdc4c850a0858af699 * Add Author Feedback label automatically (#28484) Summary: Improve issue triage by automatically adding the "Needs: Author Feedback" label. NOTE: The old label-actions app should be disabled when this PR is merged: https://github.com/apps/label-actions/installations/7445225 ## Changelog [Internal] - Issue Triage Pull Request resolved: https://github.com/facebook/react-native/pull/28484 Test Plan: Verified the same `label-actions.yml` and workflow config on a private repo. Reviewed By: cpojer Differential Revision: D20817443 Pulled By: hramos fbshipit-source-id: 39732dd67509c9fb9cf6ff7306913f5ec088266d * docs: add README and specify file in package.json (#28507) Summary: Adding a README for `react-native-codegen` since the package was published. Also added a `files` prop in package.json so unused file won't be included in the package. ## Changelog [Internal] [Changed] - Add README for react-native-codegen. Pull Request resolved: https://github.com/facebook/react-native/pull/28507 Test Plan: verify js files to function correctly without including files other than `src` Reviewed By: rickhanlonii Differential Revision: D20836113 Pulled By: cpojer fbshipit-source-id: e860f14760e9c1dbe121f5fb95ccf72d4ddb2af1 * Make the link easier to copy. (#28516) Summary: Making a PR from GitHub, I need to copy-paste the link, and it would be easier to just triple-click a line with the URL rather than carefully selecting the URL from the text. <img width="723" alt="Screen Shot 2020-04-03 at 17 33 47" src="https://user-images.githubusercontent.com/100233/78378550-6c12af80-75d1-11ea-93a4-2eae568ce602.png"> ## Changelog [General] [Changed] - Make PR template easier to use with changelog URL. Pull Request resolved: https://github.com/facebook/react-native/pull/28516 Reviewed By: fkgozali Differential Revision: D20842238 Pulled By: hramos fbshipit-source-id: 3fef7a994f36a996bbbc52556600d468a56210a9 * Upgrade tests to Xcode 11.3.1 (#28498) Summary: Upgrade Sandcastle and Circle CI tests to use Xcode 11.3.1 across the board. Pull Request resolved: https://github.com/facebook/react-native/pull/28498 Pull Request resolved: https://github.com/facebook/react-native/pull/28501 Changelog: [Internal] - Use Xcode 11.3.1 in iOS tests Reviewed By: fkgozali Differential Revision: D20821844 fbshipit-source-id: b250ca82bdf2c9fb7faa765d3e2433eb46efd692 * Fixes iOS reload through metro "r" command key (#28477) Summary: This allows the iOS device to be reloaded through the metro command line, besides the fact that whenever packagerServerHost is called, it will only get the IP address once when debugging. ## Changelog [iOS] [Fixed] - Fixed connection of metro reload command to iOS device Pull Request resolved: https://github.com/facebook/react-native/pull/28477 Test Plan: - Build any react-native project in debug mode to an iOS device connected through USB - Press the “r” key on the terminal that is running metro - The device should now reload the project Reviewed By: cpojer Differential Revision: D20818462 Pulled By: TheSavior fbshipit-source-id: 6d9792447d205223dad8fbd955518885427cbba8 * Create method queues for NativeModules that neither provide nor request one Summary: ## Problem: Let `A` be the set of all ObjC NativeModules that neither provide nor reqeust a method queue. The TurboModule system dispatches all method calls to NativeModules in `A` synchronously to the JS thread. Here is the relevant logic: **RCTTurboModule.mm:** Link: https://fburl.com/diffusion/nz9gqje8 ``` jsi::Value performMethodInvocation( // ... ) { // ... dispatch_queue_t methodQueue = NULL; if ([instance_ conformsToProtocol:protocol(RCTBridgeModule)] && [instance_ respondsToSelector:selector(methodQueue)]) { methodQueue = [instance_ performSelector:selector(methodQueue)]; } if (methodQueue == NULL || methodQueue == RCTJSThread) { // This is the default mode of execution: on JS thread. block(); } else if (methodQueue == dispatch_get_main_queue()) { ``` **Why does this end up happening?** 1. NativeModules that request a method queue have `synthesize methodQueue = _methodQueue` in their `implementation` section. This generates a `methodQueue` getter for the NativeModule, and also creates an ivar to back that getter. The TurboModule system generates a `dispatch_queue_t` and uses ObjC's KVC API to write to the ivar. So in the above logic, for NativeModules that provide a method queue, methodQueue will neither be `NULL` nor `RCTJSThread`, so we don't dispatch synchronously to the JS thread. 2. NativeModules that provide a method queue will return something that is not `NULL` or something that is `RCTJSThread`. If they return `NULL`, the infra will throw an error early. If they return `RCTJSThread`, we'll dispatch synchronously to the JS thread, as we should (...wait. For async NativeModule methods that dispatch to `RCTJSThread`, should we dispatch asynchronously to the JS thread, via jsInvoker? **Edit:** Nope: https://fburl.com/diffusion/ivt9b40s.). In all other cases, we dispatch to appropriately to the respective method queue. 3. For NativeModules that neither provide nor request a method queue (i.e: NativeModules in `A`), they don't implement the `methodQueue` selector. Therefore, we dispatch synchronously to the JS thread. ## The fix (Part 1): The first step towards fixing this problem is to generate `dispatch_queue_t`s for NativeModules in `A`. That's what this diff accomplishes. Changelog: [iOS][Fixed] - Create method queue for NativeModules that don't provide nor request one. Reviewed By: fkgozali Differential Revision: D20821054 fbshipit-source-id: 17a73550ad96766c5c7e719e28e1cc879e36465c * Rename duplicate name `<ScrollView>` example on RNTester (#28515) Summary: Tiny change. When searching for `scro` in the RNTester, two `<ScrollView>`s come up, from different example files. One is the "simple" one and the other is the "regular" one. Before: <img width="370" alt="Screen Shot 2020-04-03 at 17 14 01" src="https://user-images.githubusercontent.com/100233/78377338-c6ab0c00-75cf-11ea-9c45-2dcdd6460f6d.png"> After: <img width="369" alt="Screen Shot 2020-04-03 at 17 13 38" src="https://user-images.githubusercontent.com/100233/78377371-cf034700-75cf-11ea-89ea-aa3ff2f3988c.png"> ## Changelog [Internal] [Changed] - Rename the "simple" ScrollView example in RNTester to "ScrollSimpleView". Pull Request resolved: https://github.com/facebook/react-native/pull/28515 Test Plan: - Try to search for `scro` in RNTester. Reviewed By: fkgozali Differential Revision: D20842264 Pulled By: hramos fbshipit-source-id: 3db54a826ae774108e62690e7f154e85b541520f * Fix Fabric SSTs, so they actually run in Fabric instead of Paper, convert ServerSnapshotTestsAppImpl to functional component Summary: Update instrumentation test infra for Fabric tests. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D19961919 fbshipit-source-id: 17264b6308712dddece730effd57832817e148cf * Fixed scrollview inset when RN view is embedded in another view (#27607) Summary: I'm using RNN, which embeds RN view inside native view controllers. On iOS 13, a modal view controller is "floating" and is offset from the top of the screen. This causes the calculation of inset in `KeyboardAvoidingView` incorrect as it mixes local view controller coordinate space, with keyboard's screen coordinate space. ## Changelog [iOS] [Fixed] - Fixed `KeyboardAvoidingView` inset in embedded views (i.e modal view controllers on iOS 13) Pull Request resolved: https://github.com/facebook/react-native/pull/27607 Test Plan: 1. Tested before and after in a simple view controller (should stay the same) 2. Tested before and after in a modal view controller (should be offset before, and fixed after) 3. Repeated no. 2 with each device rotation (upsideDown, landscapeLeft, landscapeRight) Reviewed By: cpojer Differential Revision: D20812231 Pulled By: TheSavior fbshipit-source-id: fbd72739fb7152655028730e284ad26ff4a5da73 * Bump react-native-codegen to 0.0.2 Summary: Changelog: [Internal] Reviewed By: cpojer Differential Revision: D20843514 fbshipit-source-id: c611bf91d311c6ce8a7e469d267a0417b2ee58e5 * Rename ScrollViewSimpleExample Summary: Changelog: [Internal] - Rename ScrollViewSimpleExample in RNTester Reviewed By: fkgozali Differential Revision: D20846977 fbshipit-source-id: 397589cb0a17beaf37a25b91ad8efa4a2bc62358 * Remove console warnings for innerViewNode/Ref Summary: Remove these warnings until the methods in ScrollResponder have been moved into ScrollView, so that unactionable warnings aren't firing. Changelog: [General][Removed] Remove console warnings for innerViewNode/Ref in ScrollView Reviewed By: TheSavior Differential Revision: D20850624 fbshipit-source-id: ce90988e204c3cc3b93536842ec3caa12cf6994e * Make TurboModules dispatch method calls via native CallInvoker Summary: This diff: 1. Has ObjC NativeModules use the native `CallInvoker` to invoke JS -> native sync/async calls. 2. Integrates the native `CallInvoker` for each ObjC NativeModule with the bridge. This way, the bridge is informed of all JS -> native TurboModule method calls, and dispatches `onBatchComplete` appropriately. Changelog: [iOS][Fixed] Integrate ObjC TurboModules async method calls with the bridge Reviewed By: fkgozali Differential Revision: D20831545 fbshipit-source-id: da1cbb4ecef4cae85841ca7ef625ab8e380760cd * add ripple config object to Pressable (#28156) Summary: Motivation is to support ripple radius just like in TouchableNativeFeedback, plus borderless attribute. See https://github.com/facebook/react-native/pull/28009#issuecomment-589489520 In the current form this means user needs to pass an `android_ripple` prop which is an object of this shape: ``` export type RippleConfig = {| color?: ?ColorValue, borderless?: ?boolean, radius?: ?number, |}; ``` Do we want to add methods that would create such config objects - https://facebook.github.io/react-native/docs/touchablenativefeedback#methods ? ## Changelog [Android] [Added] - support borderless and custom ripple radius on Pressable Pull Request resolved: https://github.com/facebook/react-native/pull/28156 Test Plan: Tested locally in RNTester. I noticed that when some content is rendered after the touchables, the ripple effect is "cut off" by the boundaries of the next view. This is not specific to Pressable, it happens to TouchableNativeFeedback too but I just didn't notice it before in https://github.com/facebook/react-native/pull/28009. As it is an issue of its own, I didn't investigate that. ![pressable](https://user-images.githubusercontent.com/1566403/75098762-785f2200-55ba-11ea-8842-e648317610e3.gif) I changed the Touchable example slightly too (I just moved the "custom ripple radius" up to show the "cutting off" issue), so just for completeness: ![touchable](https://user-images.githubusercontent.com/1566403/75098763-81e88a00-55ba-11ea-9528-e0343d1e054b.gif) Reviewed By: yungsters Differential Revision: D20071021 Pulled By: TheSavior fbshipit-source-id: cb553030934205a52dd50a2a8c8a20da6100e23f * Make TurboModule creation thread-safe Summary: NativeModules can be created from any number of threads. In the legacy system, `ModuleHolder`, the class responsible for creating NativeModules, has built-in concurrency control to ensure that NativeModule creation is thread-safe. This diff introduces that thread-safety to the TurboModule infra. Basically, after this diff, if `n` threads race to create a TurboModule x, only the first thread will create x. All other threads will wait until x is created. Changelog: [Android][Fixed] - Make TurboModule creation thread-safe Reviewed By: mdvacca Differential Revision: D20659799 fbshipit-source-id: 2b720fe1ea49e40ae0d6dae50d422f23a6f45520 * Remove unused fields from error dialog Summary: Removed in https://github.com/facebook/react/pull/18487 Changelog: [React Core] Logging changes Reviewed By: gaearon Differential Revision: D20853086 fbshipit-source-id: 4b0002f21269f415769a2ac8305ba5750245f7d1 * Fix crash when enabling Performance Monitor on iOS 13.4 (#28512) Summary: This PR fixes a crash when opening the Performance Monitor on iOS 13.4. Detailed info: https://github.com/facebook/react-native/issues/28414 ## Changelog `[iOS] [Fixed] - Fix crash when enabling Performance Monitor on iOS 13.4` ## How This PR prevents the JavaScriptCore option from being set altogether. This ensures that the performance monitor keeps working, but on iOS 13.4 and higher, it will no longer crash trying to show the GC usage. Pull Request resolved: https://github.com/facebook/react-native/pull/28512 Test Plan: Tested on iOS 13.4 (simulator): ![image](https://user-images.githubusercontent.com/6184593/77903803-c6370c00-7283-11ea-8b71-b6b6546c82f6.png) Tested on iOS 13.1 (simulator) ![image](https://user-images.githubusercontent.com/6184593/77903499-41e48900-7283-11ea-9d14-83f67a3b7b77.png) - Verified that the `setOption` was called, but the Performance Monitor didn't show any GC usage regardless. - Identical PR https://github.com/expo/react-native/pull/21 has been shipped and tested in Expo Client 37 Fixes https://github.com/facebook/react-native/issues/28414 Reviewed By: PeteTheHeat Differential Revision: D20851131 Pulled By: TheSavior fbshipit-source-id: ff96301036e8487db59f95947bbe6841fe230e1e * Modify warning message (#28514) Summary: Modify deprecation warning message for `AccessibilityInfo.fetch` - https://reactnative.dev/docs/accessibilityinfo#isscreenreaderenabled - https://github.com/facebook/react-native/commit/523ab8333800afbfb169c6fd70ab6611fe07cc2a ## Changelog [Internal] [Changed] - Modify deprecation warning message for `AccessibilityInfo.fetch` Pull Request resolved: https://github.com/facebook/react-native/pull/28514 Test Plan: Try using `AccessibilityInfo.fetch` and check log Reviewed By: cpojer Differential Revision: D20850223 Pulled By: TheSavior fbshipit-source-id: e21bb20b7a02d9f2ed6e27e2bfecbac0aebf9e09 * Set _borderLayer.frame when border changes Summary: Changelog: [Internal] Setting `_borderLayer.frame` inside `-[RCTViewComponentView layoutSubviews]` causes unwanted animation because it is not wrapped in `CATransaction`. Moving it to `-[RCTViewComponentView updateLayoutMetrics]` which is called inside `CATransaction`. Reviewed By: shergin Differential Revision: D20836890 fbshipit-source-id: 2048a25fd2edb8109f6275c1186c0adae4b9f504 * Add API for getting sourceURL directly from ReactContext Summary: In bridgeless mode, the CatalystInstance doesn't exist, but we still need to be able to access the sourceURL in SourceCodeModule (which is needed to render the images in LogBox warnings and errors). This diff adds a new API for getting the sourceURL directly from ReactContext, instead of having to call context.getCatalystInstance().getSourceURL(), and updates SourceCodeModule to use it. Changelog: [Internal] Reviewed By: RSNara Differential Revision: D20848700 fbshipit-source-id: 3ecda81a17121178b76bbb3e9b0f27f103c1961a * imp: Remove unused `npx` reference (#28544) Summary: Recently we removed `npx` usage from `react-native-cli` flow. After checking usages in this repo I found unused reference. ## 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] [Removed] - Remove unused `npx` reference Pull Request resolved: https://github.com/facebook/react-native/pull/28544 Test Plan: Tests pass Reviewed By: cpojer Differential Revision: D20873090 Pulled By: hramos fbshipit-source-id: 12e05e9635a83f19439024766817e4599320af98 * Add debug logs to track down T62192299 exception source Summary: Add debug logs to track down T62192299 exception source Changelog: [Internal] Reviewed By: RSNara Differential Revision: D20878063 fbshipit-source-id: 94acd56c45d4b529a695d1b4d2bfd10d8f725e63 * Back out "Fixed scrollview inset when RN view is embedded in another view" Summary: Original commit changeset: fbd72739fb71 Changelog: Back out "[react-native][PR] Fixed scrollview inset when RN view is embedded in another view" Reviewed By: TheSavior Differential Revision: D20878607 fbshipit-source-id: 0d77b9fb08c637f7894c399a219a242e472b0700 * Fail silently in AppStateModule.sendEvent if CatalystInstance is not available Summary: According to our logs, 80% of these warnings are coming from AppStateModule. It's not particularly interesting or surprising that the CatalystInstance would be torn down when there's some app event, so let's stop taking up DB space with a useless message. Reviewed By: ejanzer, mdvacca Differential Revision: D20879426 fbshipit-source-id: b1182461aed4a66d82cb34bbd4b12782af6ed7b3 * Move DebugEnvironment helper to open source Summary: This is an internal only module that we use to detect whether we are in async debugging mode. Changelog: [Internal] Reviewed By: yungsters Differential Revision: D20879780 fbshipit-source-id: 5915f4e1c54a3fda0cf607c77f463120264fdbc4 * Fix Appearance module when using Chrome Debugger Summary: The appearance module uses sync native module methods which doesn't work with the chrome debugger. This broke in 0.62: https://github.com/facebook/react-native/issues/26705 This fix makes the appearance module return 'light' when using the chrome debugger. Changelog: [Fixed] Appearance `getColorScheme` no longer breaks the debugger Reviewed By: yungsters Differential Revision: D20879779 fbshipit-source-id: ad49c66226096433bc9f270e004ad4a6f54fa8c2 * Extend Android ImageViewManager to support analyticsTag prop Summary: This diff extends the Android Image View manager to support the new analyticsTag prop. this prop is going to be used to track performance for images in android changelog: [Android][Added] Add analyticsTag prop into ImageView component Reviewed By: JoshuaGross Differential Revision: D20880602 fbshipit-source-id: e302e8fa83706e6517b228d44a3094a1686830f7 * Extend Image.android to support analyticsTag prop Summary: Quick diff to extend Image.android component to support analytics tag prop changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D20880601 fbshipit-source-id: 99bc11f36ce46953c00480f7c8d628cf6c0a9263 * Create ImageContext object to allow udpating the analyticsTag prop for RN sections Summary: As part of this diff I create the new ImageContext object that will be used to allow the update of the analyticsTag prop for components that contain multiple images in their view hierarchy changelog: [JS][Added] Add ImageContext object, this object can be used to update the Imageview's analyticsTag prop on RN components that contain multiple images in their view hierarchy Reviewed By: JoshuaGross Differential Revision: D20880603 fbshipit-source-id: f2094bfd3ab1c867cf7c107e678a098aab7e94a8 * Ez cleanup in ImageProps Summary: Ez cleanup in ImageProps, this import is not being used anymore changelog: [internal] internal change Reviewed By: JoshuaGross Differential Revision: D20880600 fbshipit-source-id: 7d903b5a6e16c37e61dec661b6bd1f9a6b442cc3 * Exclude all FlipperKit transitive dependencies from iOS Release builds (#28504) Summary: The `:configuration` option from `pod` only affects the specified pod and not its dependencies [1]. Therefore in order to avoid all transitive dependencies being linked in the resulting Release IPA we need to list them in the `Podfile`. Note that this will still build Flipper's pods when doing a Release, but it won't link it in the resulting IPA. [1] https://guides.cocoapods.org/syntax/podfile.html#pod Fixes https://github.com/react-native-community/upgrade-support/issues/28 Related https://github.com/CocoaPods/CocoaPods/issues/9658 ## Changelog * [iOS] [Fixed] - Exclude Flipper from iOS Release builds Pull Request resolved: https://github.com/facebook/react-native/pull/28504 Test Plan: Create a new React Native 0.62 project, run `pod install`, then diff: ``` ProjectName/ios/Pods/Target Support Files/Pods-ProjectName/Pods-ProjectName.debug.xcconfig` ``` and ``` ProjectName/ios/Pods/Target Support Files/Pods-ProjectName/Pods-ProjectName.relaese.xcconfig ``` ![image](https://user-images.githubusercontent.com/855995/78337679-a3fa0280-7591-11ea-8142-6f82cbc6be58.png) Reviewed By: passy Differential Revision: D20894406 Pulled By: priteshrnandgaonkar fbshipit-source-id: 680780f0f5a85fd8423b85a271a499bd12f06d00 * Fix crash in FabricUIManager.onMeasure Summary: Changelog: [Internal] The cause of crash was `NullPointerException`, which happened because of `mReactContextForRootTag.get(rootTag)` returning `null`. This is solved by checking whether it returns `null` before passing it to `I18nUtil`. Reviewed By: mdvacca Differential Revision: D20890623 fbshipit-source-id: c884c6838b83b944a5438375a4c060c1f5b1dc6e * Fix flow types of ImageContext Summary: ez diff to Fix flow types of ImageContext changelog: [internal] internal change to update flow types of ImageContext Reviewed By: TheSavior Differential Revision: D20883647 fbshipit-source-id: 6dba83ab431e56a71f96c39005ebcccf39a7da9a * Avoid passing analyticsTag prop to native if this is set to null Summary: This diff avoids passing the analyticsTag prop to native if this is set to null changelog: [internal] internal optimization Reviewed By: TheSavior Differential Revision: D20904498 fbshipit-source-id: f1ea1e5aa3199ef073668df86ca7cf6e20f70c5b * Rename analyticsTag -> internal_analyticsTag in ImageView component Summary: This diff renames the analyticsTag prop for the intenral_analyticsTag in ImageView component changelog: [internal] Creation of internal_analyticTag prop in ImageView, for now this prop is meant to be used internally. Reviewed By: TheSavior Differential Revision: D20904497 fbshipit-source-id: 2a28f746772ee0f9d657ec71549020c1f3e9d674 * Make Vibration.vibrate compatible with TurboModules (#27951) Summary: This PR fixes a compatibility issue with the Vibration module and TurboModules. The TurboModules spec doesn't allow nullable arguments of type Number, causing the following problem: ![IMG_3758](https://user-images.githubusercontent.com/1247834/73803879-10be6f80-4790-11ea-92d4-a008f0007681.PNG) ## Changelog [iOS] [Fixed] - Make Vibration library compatible with TurboModules. Pull Request resolved: https://github.com/facebook/react-native/pull/27951 Test Plan: Just submitted a PR to my own app to fix the issue [here](https://github.com/rainbow-me/rainbow/pull/340) The problem should be reproducible on RNTester due to this line: https://github.com/facebook/react-native/blob/91f139b94118fe8db29728ea8ad855fc4a13f743/RNTester/js/examples/Vibration/VibrationExample.js#L66 and should be working on this branch. Reviewed By: TheSavior Differential Revision: D19761064 Pulled By: hramos fbshipit-source-id: 84f6b62a2734cc09d450e906b5866d4e9ce61124 * Fix Cocoapods builds Summary: ## Problem For some reason, D20831545 broke the `use_frameworks!` build of RNTester. ## Building RNTester ``` pushd ~/fbsource/xplat/js/react-native-github/RNTester && USE_FRAMEWORKS=1 pod install && open RNTesterPods.xcworkspace && popd; ``` ## Error I built RNTester locally, and the error was this: ``` Undefined symbols for architecture x86_64: "facebook::jsi::HostObject::set(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&, facebook::jsi::Value const&)", referenced from: vtable for facebook::react::ObjCTurboModule in RCTImageEditingManager.o vtable for facebook::react::ObjCTurboModule in RCTImageLoader.o vtable for facebook::react::ObjCTurboModule in RCTImageStoreManager.o "facebook::jsi::HostObject::getPropertyNames(facebook::jsi::Runtime&)", referenced from: vtable for facebook::react::ObjCTurboModule in RCTImageEditingManager.o vtable for facebook::react::ObjCTurboModule in RCTImageLoader.o vtable for facebook::react::ObjCTurboModule in RCTImageStoreManager.o ld: symbol(s) not found for architecture x86_64 ``` ## Fix It looked like libraries that depend on "ReactCommon/turbomodule/core" weren't linking to JSI correctly. So, I modified all such Podspecs to also depend on "React-jsi": ``` arc rfr ' s.dependency "ReactCommon/turbomodule/core", version' ' s.dependency "ReactCommon/turbomodule/core", version\n s.dependency "React-jsi", version' ``` This seemed to do the trick. In buck, we'd fix this problem using exported_dependencies. I skimmed through cocoapods, and couldn't find such a configuration option there. So, I guess this will have to do? Changelog: [iOS][Fixed] - Fix Cocoapods builds of RNTester Reviewed By: fkgozali, hramos Differential Revision: D20905465 fbshipit-source-id: 60218c8274ec165752a428f2a7a9a546607c8fec * Add minimumSize to RCTRootView & RCTRootShadowView Summary: This adds a `minimumSize` property to RCTRootView, and forwards any changes to it's shadow view. This **does not** change any default behaviour, as the default minimum size is `CGSizeZero` before & after this diff. Changelog: [iOS][Internal] Add minimumSize to RCTRootView & RCTRootShadowView Reviewed By: RSNara Differential Revision: D20905456 fbshipit-source-id: a03f880e782891f60ef86b9c898965e05a5e796e * Make RCTNativeAnimatedModule into a TurboModule Summary: D20831545 integrated TurboModules with the bridge's `onBatchComplete` event. This fixed the RCTNativeAnimatedModule jank, so I'm re-converting RCTNativeAnimatedModule into a TurboModule. Changelog: [iOS][Fixed] - Make RCTNativeAnimatedModule TM-compatible Reviewed By: PeteTheHeat Differential Revision: D20850744 fbshipit-source-id: bb85a1bb27963e7d39bf149d0a3d7b71c88175da * upgrade to flow 0.122.0 Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D20919782 fbshipit-source-id: 3d5dc54ea4daafb8a1d96cad6c35a2dab4c24097 * Switch order of onSelectionChange and onChange events send from native Summary: Changelog: [Internal] UIKit uses either `UITextField` or `UITextView` as its UIKit element for `<TextInput>`. `UITextField` is for single line entry, `UITextView` is for multiline entry. There is a problem with order of events when user types a character. In `UITextField` (single line text entry), typing a character first triggers `onChange` event and then `onSelectionChange`. JavaScript depends on this order of events because it uses `mostRecentEventCount` from this even to communicate to native that it is in sync with changes in native. In `UITextView` (multi line text entry), typing a character first triggers `onSelectionChange` and then `onChange`. As JS depends on the correct order of events, this can cause issues. An example would be a TextInput which changes contents based as a result of `onSelectionChange`. Those changes would be ignored as native will throw them away because JavaScript doesn't have the newest version. Reviewed By: JoshuaGross Differential Revision: D20836195 fbshipit-source-id: fbae3b6c0d388fc059ca2541ae980073b8e5f6c7 * Maintain selection and cursor location when setting string on TextInput Summary: Changelog: [Internal] Calling `_backedTextInputView.attributedText = attributedString` causes cursor to be moved to the end of text input. This applies to both, `UITextField` and `UITextView`. This is not desired as when JS sets a new text, we don't want the cursor to be moved to the end of text input. JS has the option to use view commands if it wishes to move cursor somewhere. Reviewed By: JoshuaGross Differential Revision: D20836201 fbshipit-source-id: 9234e54cfbc5fc206f723626988e505275788aae * Implement event count for TextInput Summary: Changelog: [Internal] Implementation of event count for Fabric's Text input. Reviewed By: JoshuaGross Differential Revision: D20800185 fbshipit-source-id: 988692cb2fc786649821cccb06e629b40b9b0479 * Migrate setNativeProps to commands in iOS text input Summary: Changelog: Move from setNativeProps to ViewCommands. Reviewed By: JoshuaGross Differential Revision: D20843018 fbshipit-source-id: 9be9d2bbee01f2e15279e3c3ae785c1a5b163765 * Update default Podfile to not depend on a path (#28572) Summary: Recently, a default Podfile has been modified to not contain all the React Native pods, but use a helper method `use_react_native!`. While this is great, it assumes a hardcoded path of `../node_modules/react-native` to be always the correct location of the React Native. https://github.com/facebook/react-native/blob/d4d8887b5018782eeb3f26efa85125e6bbff73e4/scripts/autolink-ios.rb#L7-L9 Unfortunately, due to the way Ruby works, this completely hides the path away from the users. Before, they could have seen the wrong path explicitly in a Podfile and knew to update it to resolve path-related issues. With the current version in `master`, I can see a lot of issues where developers wonder how to resolve the path issues and how to pass the path itself. https://github.com/facebook/react-native/blob/4118d798265341061105f3a53550db83c66a71cb/template/ios/Podfile#L5-L10 This PR uses React Native CLI configuration (that is already used to link 3rd party dependencies) to explicitly define the correct path to the React Native. As a result, we don't have to change the paths here whether we're running monorepo or not. ## Changelog [IOS] [INTERNAL] - Always provide an explicit path to React Native Pull Request resolved: https://github.com/facebook/react-native/pull/28572 Differential Revision: D20945194 Pulled By: TheSavior fbshipit-source-id: 010f9754f2ed78ef62fd52f4d201f296f5af6d27 * chore: update CLI * fix: do not throw on missing `cliPath`, use the default value (#28625) Summary: The `cliPath` has always been optional value and in fact, even had its default value hardcoded in the React gradle file. In this PR, I am just taking use of it and remove throwing an error, which is going to be a really annoying breaking change. ## Changelog [ANDROID] [INTERNAL] - Don't require `cliPath` Pull Request resolved: https://github.com/facebook/react-native/pull/28625 Test Plan: Run Android project, everything works. Provide custom `cliPath`, it gets respected Reviewed By: cpojer Differential Revision: D21044222 Pulled By: TheSavior fbshipit-source-id: 8029f988d92abb9f64f30e05932c0d407d0c997e * chore: remove Kotlin version from the default template * (eslint-config) update community eslint plugin in eslint config (#28642) Summary: Updating the community eslint-plugin used in the eslint-config to the latest version. expecting new eslint-config version to be released with this change so that it can be included in new project template for 0.63 https://github.com/react-native-community/releases/issues/186 ## 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] - Update community eslint plugin in the eslint config Pull Request resolved: https://github.com/facebook/react-native/pull/28642 Test Plan: yarn lint passes Differential Revision: D21048976 Pulled By: cpojer fbshipit-source-id: 2c3ec0ef450cf357d8c88db7873f4ca1154b2034 * [0.63.0-rc.0] Bump version numbers * Upgrade Hermes dependency to 0.5.0 Summary: Use the latest published release of hermes-engine. Update RN to invoke `hermesc` instead of `hermes`. Changelog: [Android] [Changed] - Upgraded to Hermes 0.5.0 allow-large-files Reviewed By: mhorowitz Differential Revision: D20998564 fbshipit-source-id: 4824e273bcb044029a5a7e9379f168d3da47da50 * Remove the post install step (#28651) Summary: Removes the post install step for Flipper, as the latest version of YogaKit is compatible with swift 5. cc alloy ## 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 --> [Flipper] [Template] - Remove the post install step for Flipper Pull Request resolved: https://github.com/facebook/react-native/pull/28651 Test Plan: Tested a newly created RN app without post install step and it built successfully. Reviewed By: passy Differential Revision: D21064653 Pulled By: priteshrnandgaonkar fbshipit-source-id: da56d0754d918e30a0ebe480c77590f0139d48ac * Allow iOS PlatformColor strings to be ObjC or Swift UIColor selectors (#28703) Summary: Per discussion in https://github.com/react-native-community/releases/issues/186 the iOS `PlatformColor()` function is documented to use the semantic color names provided by the system. The referenced HIG documentation itself links to the `UIColor` documentation for semantic colors names. However, these names differ depending on if you are viewing the new Swift API docs or the Objective C docs. The current Objective C implementation in react-native assumes Objective C UIColor selector names that are suffixed 'Color'. But in Swift, Apple provides a Swift Extension on UIColor that makes aliases without the the 'Color' suffix and then makes the original selectors invalid presumably via `NS_UNAVAILABLE_SWIFT`. Since both selector names are valid depending on if you are using Objective C or Swift, let's make both forms be legal for `PlatformColor()`. In `RCTConvert.m` there is a dictionary of legal selector names. The code already supports the ability to have names be aliases of other selectors via a RCTSelector metadata key. The change adds code to the initialization of the map: it iterates over the keys in the map, which are all ObjC style UIColor selectors, and creates aliases by duplicating the entries, creating key names by stripping off the ObjC "Color" suffix, adds the RCTSelector key referring to the original and then appends these new Swift aliases to the map. ## Changelog [iOS] [Changed] - Allow iOS PlatformColor strings to be ObjC or Swift UIColor selectors Pull Request resolved: https://github.com/facebook/react-native/pull/28703 Test Plan: The PlatformColorExample.js is updated to use the new, shorter Swift selector names. There are still other examples in the same file and in unit tests that exercise the ObjC selector names. <img width="492" alt="PlatformColor" src="https://user-images.githubusercontent.com/30053638/79809089-89ab7d00-8324-11ea-8a9d-120b92edeedf.png"> Reviewed By: shergin Differential Revision: D21147404 Pulled By: TheSavior fbshipit-source-id: 0273ec855e426b3a7ba97a87645859e05bcd4126 * Fix folly::dynamic crash when attaching a debugger to Hermes Summary: folly_futures was compiled with and exported -DFOLLY_MOBILE=1, while folly_json did not. This flag disables fancy F14 data structures for folly::dynamic in favor of a simple std::unordered_map. This caused inlined/templated code from modules depending on folly_futures to disagree with the implementations in folly_json, leading to a crash. The only such libraries were libhermes-inspector and (transitively) libhermes-executor-debug, and these only use folly::dynamic for CDP serialization, which is why the problem was not more apparent. Changelog: [Internal] Fix crash when attaching a Hermes debugger Reviewed By: mhorowitz Differential Revision: D21193307 fbshipit-source-id: 2b795bb6f4f7f991e2adaacec62d62616117322b * Update react.gradle (#28776) Summary: Running `./gradlew assembleRelease` fails as the path to the CLI contains a new line at the end. We don't run this command in `debug` mode, hence it passed the testing. My bad. Fixed, checked in both `debug` with `bundleInDebug: true` and `release`. Fixes https://github.com/facebook/react-native/issues/28700 ## Changelog [INTERNAL] [ANDROID] - Fix `React.gradle` to build Android apps in production Pull Request resolved: https://github.com/facebook/react-native/pull/28776 Test Plan: Running `./gradlew assembleRelease` works Reviewed By: hramos Differential Revision: D21287789 Pulled By: TheSavior fbshipit-source-id: dc3ec8eef7a919b072b562d2bd455e2f704bc083 * Revert D21064653: Remove the post install step Differential Revision: D21064653 Original commit changeset: da56d0754d91 fbshipit-source-id: 1086cfdeca9aa3830370ea115ba7b5f05d3fb124 * Bump @react-native-community/eslint-config in new app template Summary: Changelog: [Changed][General] Update react-native-community/eslint-config to 1.1.0, adding the new color rule Reviewed By: rickhanlonii Differential Revision: D21342153 fbshipit-source-id: ac1367353d4d3e69b6df29dc16f9fcb60cde3519 * [0.63.0-rc.1] Bump version numbers * Upgrade Flipper to 0.37.0 (#28545) Summary: Bump flipper to 0.37 for both iOS and Android [Android] [Changed] - Upgrade Flipper to 0.37.0 [iOS] [Changed] - Upgrade Flipper to 0.37.0 Pull Request resolved: https://github.com/facebook/react-native/pull/28545 Test Plan: RNTester build pass Reviewed By: rickhanlonii Differential Revision: D20930069 Pulled By: hramos fbshipit-source-id: a7cb719da3e51e6a42d27d5e64bc664398d0d3c5 * Enable with CocoaPods `:configuration` (#28796) Summary: ~~⚠️ Depends on https://github.com/facebook/flipper/pull/1086 and a new Flipper release.~~ Fixes https://github.com/facebook/react-native/commit/17f025bc26da13da795845a3f7daee65563420c0#commitcomment-38831234 Currently user’s are being told to add a definition of the `FB_SONARKIT_ENABLED` macro and examples, including those in stock React Native templates, set this for the user by making use of a `post_install` hook in the user’s `Podfile`. This leads to confusion, fragile code [when a user’s project dir structure deviates from vanilla], and is ultimately not necessary as CocoaPods already has dedicated mechanisms to: * specify build settings (through the `xcconfig` property); * and selectively include certain pods only in certain build configurations (e.g. debug). ## 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] [Changed] - Entirely control Flipper being enabled through inclusion in Podfile and optionally limiting to certain build configurations using the `:configuration` directive. Pull Request resolved: https://github.com/facebook/react-native/pull/28796 Test Plan: Tested using the changes of https://github.com/facebook/flipper/pull/1086 in a new app that uses RN `master`. Reviewed By: priteshrnandgaonkar Differential Revision: D21449754 Pulled By: passy fbshipit-source-id: 9ff7c7f4ffc32b364b1edd82b94e0b80c3997625 * Pressable: Rename pressRectOffset to pressRetentionOffset to be consistent with other touchables Summary: Text and the other Touchables have this prop called pressRetentionOffset. Pressable should be consistent with that. Changelog: [Breaking][General]: Pressable: Rename pressRectOffset to pressRetentionOffset to be consistent with other touchables Reviewed By: yungsters Differential Revision: D21552255 fbshipit-source-id: 31e64bad9e48ac98e4934dd2f4c0a7f526de5cb6 * iOS: Fix Animated image crash when CADisplayLink target in RCTWeakProxy is nil Summary: When self is nil, this may crash in RCTUIImageViewAnimated.m. ``` _displayLink = [CADisplayLink displayLinkWithTarget:[RCTWeakProxy weakProxyWithTarget:self] selector:selector(displayDidRefresh:)]; ``` Replace `RCTWeakProxy` with a concrete class `RCTDisplayWeakRefreshable` that has the displayDidRefresh method, that calls the displayDidRefresh method in its weak target. https://github.com/facebook/react-native/pull/28070#issuecomment-619295254 Changelog: [iOS] [Fixed] - Fix Animated image crash when CADisplayLink target in RCTWeakProxy is nil Reviewed By: shergin Differential Revision: D21419385 fbshipit-source-id: da7c3c38f81ea54f633da7f59359e07680ea2faf * Pressable: Add Support for Inspector Overlay Summary: Adds support for the debug overlay (enabled via the Inspector) that the legacy touchable components supported. Changelog: [General][Added] - Added Inspector overlay support for Pressable Reviewed By: TheSavior Differential Revision: D21614412 fbshipit-source-id: b884e04f8dba1bfd35e61de25d33d6d47bc34b03 * Changed iOS LaunchScreen from xib to storyboard (#28239) Summary: > Starting April 30, 2020, all apps submitted to the App Store must use an Xcode storyboard to provide the app’s launch screen and all iPhone apps must support all iPhone screens. Updated iOS Launch screen as per [App Store policy change](https://developer.apple.com/news/?id=03042020b). Community discussion: https://github.com/react-native-community/discussions-and-proposals/issues/209 ## Changelog Changed iOS Launch Screen from a `xib` to `storyboard`. The `LaunchScreen.xib` file has been replaced with `LaunchScreen.storyboard`. Xcode automatically picks up the new Launch Screen no additional change is required. [iOS] [Deleted] - Deleted LaunchScreen.xib [iOS] [Added] - Added LaunchScreen.storyboard Pull Request resolved: https://github.com/facebook/react-native/pull/28239 Test Plan: Build the Xcode project under `template/iOS` and verify that the new launch screen is identical to the previous one. Reviewed By: cpojer Differential Revision: D20408892 Pulled By: hramos fbshipit-source-id: 9c38df58d1304088a23f3d73e0fbd87675804f1a * Fix debugging on android for 0.63 (#29204) Summary: Currently on react native 0.63-rc.0 and 0.63-rc.1 enabling debugging throws an exception. It looks like something may have been missed in unregistering JSDevSupport in this commit c20963e ![crash](https://user-images.githubusercontent.com/14797029/85500252-2acae400-b5b1-11ea-938a-674b55e649b2.gif) This should fix https://github.com/facebook/react-native/issues/28746 and https://github.com/facebook/react-native/issues/29136 ## Changelog [Android] [Fixed] - Fix crash when enabling debug Pull Request resolved: https://github.com/facebook/react-native/pull/29204 Test Plan: To recreate the bug: npx react-native init RN063 --version 0.63.0-rc.1 react-native start react-native run-android Enable debug mode from react native dev menu After this commit, the crash no longer occurs ![non crash](https://user-images.githubusercontent.com/14797029/85500241-269ec680-b5b1-11ea-8cfe-85bfda4dd222.gif) Reviewed By: TheSavior Differential Revision: D22395406 Pulled By: RSNara fbshipit-source-id: 046df77ae1c1de96870fb46f409d59e7d6a68c0d * [0.63.0] Bump version numbers * Add ProGuard rule for hermes (#28571) Summary: This adds a ProGuard for `hermes` rule so it does not have to be added by users manually. https://github.com/facebook/react-native/issues/28270 ## 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 --> [Android] [Added] - ProGuard rule for hermes Pull Request resolved: https://github.com/facebook/react-native/pull/28571 Test Plan: 1. Create a project with/without hermes. 2. Enable proguard. Reviewed By: cpojer Differential Revision: D20947095 Pulled By: hramos fbshipit-source-id: 79b166ad2dd060f20041d9f5cfe2f794c754843d * Fix rounded border drawing when border-radius is smaller than border-width (#28358) Summary: This PR fixes the drawing of the border rounded edges when the border-radius is small than the border-width. The current implementation capped the possible border-radius making it impossible to set smaller border-radii when using thicker borders. After inspection it was found that the rounded-rect calculation is incorrect. ## Changelog `[Android] [Fixed] - Fix rounded border-drawing when border-radius is smaller than border-width` Pull Request resolved: https://github.com/facebook/react-native/pull/28358 Test Plan: **Faulty situation:** As you can see, when the border-radius becomes very low, the border is stuck at a minimum value. Only after setting the border-radius fully to 0 is it again rendered correctly. ![ezgif com-video-to-gif (2)](https://user-images.githubusercontent.com/6184593/77183540-c3435b00-6ace-11ea-950d-29a0ea1757bd.gif) **After the fix:** ![ezgif com-video-to-gif (3)](https://user-images.githubusercontent.com/6184593/77183619-e837ce00-6ace-11ea-93a5-910127d352b7.gif) Differential Revision: D21124739 Pulled By: shergin fbshipit-source-id: cefd1776b77b5b9fb335e95fd7fdd7f345579dc4 * Fix border-stroke drawing after resetting border-radius (#28356) Summary: This PR fixes incorrect drawing of the View borders on Android, after changing the border-radius back to 0 *(and when no background-color is defined)*. This happens because the `drawRoundedBackgroundWithBorders` function in ReactViewBackgroundDrawable changes the style on the Paint object to `STROKE`. This style is however never reverted back to `FILL`. This change ensures that the Paint style is set to `FILL` for the full execution of the `drawRectangularBackgroundWithBorders` function. ## Changelog `[Android] [Fixed] - Fix border-drawing when changing border-radius back to 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28356 Test Plan: **Faulty situation:** ![ezgif com-video-to-gif](https://user-images.githubusercontent.com/6184593/77153163-9759b280-6a99-11ea-82bb-33a1e0a4934c.gif) **After the fix:** ![ezgif com-video-to-gif (1)](https://user-images.githubusercontent.com/6184593/77153825-c91f4900-6a9a-11ea-8e0c-a4280b9e72b8.gif) Differential Revision: D21124741 Pulled By: shergin fbshipit-source-id: 2044f8e8ad59a58df42b64d7ee8c4ad1d3b562f1 * Fixes TextInput shaking when typing Chinese (#28805) Summary: Fixes https://github.com/facebook/react-native/issues/28488. ## Changelog [iOS] [Fixed] - Fixes TextInput shaking when typing Chinese Pull Request resolved: https://github.com/facebook/react-native/pull/28805 Test Plan: Demo see https://github.com/facebook/react-native/issues/28488. Differential Revision: D21376803 Pulled By: shergin fbshipit-source-id: b1fe6cc5f67d42ef98a6c12b8ab9990feac0e2a7 * Set black as default text color for <TextInput/> on iOS (#28708) Summary: This is a follow-up pull request to https://github.com/facebook/react-native/issues/28280 (reviewed by shergin). This pull request tried to solve the problem of the default color in a TextInput in dark mode on iOS being white instead of black. I got suggested to solve the problem not on the level of RCTTextAttributes, but on the level of RCTUITextField. Setting `self.textColor = [UIColor black];` in the constructor did not work, because it gets overwritten by nil in `RCTBaseTextInputView.m`. There I implemented the logic that if NSForegroundColorAttributeName color is nil then the color is being set to black. I think the `defaultTextAttributes` property confuses here, because it ends up being the effective text attributes, e.g. if I unconditionally set the default text color to black, it cannot be changed in React Native anymore. So I put the nil check in. ## Changelog [iOS] [Fixed] - TextInput color has the same default (#000) on iOS whether in light or dark mode Pull Request resolved: https://github.com/facebook/react-native/pull/28708 Test Plan: I have manually tested the following: - The default text color in light mode is black - The default text color in dark mode is black - The color can be changed using the `style.color` attribute - Setting the opacity to 0.5 results in the desired behavior, the whole TextInput becoming half the opacity. – Setting the `style.color` to rgba(0, 0, 0, 0.5) works as intended, creating a half-opaque text color. Differential Revision: D21186579 Pulled By: shergin fbshipit-source-id: ea6405ac6a0243c96677335169b214a2bb9ccc29 * Enable array buffers in JSCRuntime.cpp (#28961) Summary: The JavaScriptCore implementation of JSI [does not currently support array buffers](https://github.com/facebook/react-native/blob/master/ReactCommon/jsi/JSCRuntime.cpp#L925-L943). The comments in the code suggest the JSC version used by React Native does not work with array buffers, but this seems to be out of date since the current version of JSC used by React Native does indeed support array buffers. This change just enables array buffers in JSCRuntime.cpp. NOTE: See https://github.com/react-native-community/discussions-and-proposals/issues/91#issuecomment-632371219 for more background on this change. ## Changelog [General] [Added] - Support for array buffers in the JavaScriptCore implementation of JSI Pull Request resolved: https://github.com/facebook/react-native/pull/28961 Test Plan: To test these changes, I just made some temporary changes to RNTester to use JSI to inject a test function into the JS runtime that reads from and writes to an array buffer, and call that function from the JS of the RNTester app (see https://github.com/ryantrem/react-native/commit/28152ce3f4ae0fa906557415d106399b3f072118). For the JS side of this, specifically look at https://github.com/ryantrem/react-native/blob/28152ce3f4ae0fa906557415d106399b3f072118/RNTester/js/RNTesterApp.android.js#L13-L18 For the native side of this, specifically look at https://github.com/ryantrem/react-native/blob/28152ce3f4ae0fa906557415d106399b3f072118/RNTester/android/app/src/main/cpp/JSITest.cpp#L22-L38 Reviewed By: shergin Differential Revision: D21717995 Pulled By: tmikov fbshipit-source-id: 5788479bb33c24d01aa80fa7f509e0ff9dcefea6 * Fix font variant crash on Android < 4.4 (#29176) Summary: In RN 0.62 support for `fontVariant` was added on Android. Using that prop crashes the app on Android below KitKat (4.3 and below) To reproduce just add any Text with the `fontVariant` styling prop in the app: ```js <Text style={{fontVariant: ['tabular-nums']}}>This will crash</Text> ``` It will crash any device running Android below KitKat with the error: ![image](https://user-images.githubusercontent.com/4534323/85073452-18206b80-b1bb-11ea-8d7e-96f27fa1a320.png) This is caused by `java.utils.Objects` only being available on Android 4.4+ ## Changelog [Android] [Fixed] - Fix font variant crash on Android < 4.4 Pull Request resolved: https://github.com/facebook/react-native/pull/29176 Test Plan: [TextUtils.equals](https://developer.android.com/reference/android/text/TextUtils#equals) was added as soon as API level 1, so no compatibility issue here. Tested on Emulator running Android 4.1, no crash anymore. I've searched for other occurences of `java.utils.Objects` in the project, and this was the only one, so no need to remove other occurences ✅ Reviewed By: JoshuaGross Differential Revision: D22337316 Pulled By: mdvacca fbshipit-source-id: 5507b21b237a725d596d47b5c01e269895b16d4a * Fix LogBox.ignoreAllLogs used with no argument (#29310) Summary: When you call `LogBox.ignoreAllLogs()` it should ignore logs. This fixes a bug that made this equivalent to `LogBox.ignoreAllLogs(false)` ## Changelog [General] [Fixed] - LogBox.ignoreAllLogs() should ignore logs Pull Request resolved: https://github.com/facebook/react-native/pull/29310 Test Plan: Added tests Reviewed By: TheSavior Differential Revision: D22448436 Pulled By: rickhanlonii fbshipit-source-id: 6ba12b9d9c1f29cf3ac503946ac5ca0097425a7a * Pressable: Minimum Press Duration Summary: When a `Pressable` has a configured (or the default) `delayPressIn` and no (or the default) `delayPressOut`, tapping very quickly can lead to intantaneous invocation of `onPressIn` and `onPressOut`. The end result is that users may never experience any intended visual press feedback. This changes `Pressable` to accept (and be preconfigured with a default) **minimum press duration**. The minimum press duration ensures that even if the press is released before `delayPressIn` has elapsed, `onPressOut` will still wait the remaining time up to `minPressDuration` before firing. Note that setting a non-zero `delayPressOut` is insufficient because if a user holds down on a `Pressable` for longer than `delayPressIn`, we still want `onPressOut` to fire immediately when the press is released. Changelog: [General][Changed] - Added `minPressDuration` to `Pressable`. Reviewed By: TheSavior Differential Revision: D21614708 fbshipit-source-id: 502f3d8ad6a40e7762435b6df16809c8798dd92c * chore: bring back script to org shape * [0.63.1] Bump version numbers * Exclude okhttp from flipper dependency (#29260) Summary: This fixes https://github.com/facebook/react-native/issues/28481. As explained in [this comment](https://github.com/facebook/react-native/issues/28481#issuecomment-645546195), the flipper network plugin pulls a more recent version of okhttp (3.14), but only versions of okhttp up to 3.12 works on Android API 21 and less. This prevented being able to run the app in debug mode, it was still working fine in release mode. ## 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 --> [Android] [Fixed] - Fix unable to run in debug mode on Android API < 21 Pull Request resolved: https://github.com/facebook/react-native/pull/29260 Test Plan: Using `yarn react-native run-android` the app would instantly crash with this error in `adb logcat`: ``` E/AndroidRuntime( 5079): java.lang.RuntimeException: Unable to create application com.awesometsproject.MainApplication: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created E/AndroidRuntime( 5079): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4154) E/AndroidRuntime( 5079): at android.app.ActivityThread.access$1300(ActivityThread.java:130) E/AndroidRuntime( 5079): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1255) E/AndroidRuntime( 5079): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 5079): at android.os.Looper.loop(Looper.java:137) E/AndroidRuntime( 5079): at android.app.ActivityThread.main(ActivityThread.java:4745) E/AndroidRuntime( 5079): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 5079): at java.lang.reflect.Method.invoke(Method.java:511) E/AndroidRuntime( 5079): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) E/AndroidRuntime( 5079): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) E/AndroidRuntime( 5079): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 5079): Caused by: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:90) E/AndroidRuntime( 5079): at com.facebook.react.ReactInstanceManager.<init>(ReactInstanceManager.java:238) E/AndroidRuntime( 5079): at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:281) E/AndroidRuntime( 5079): at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:87) E/AndroidRuntime( 5079): at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:39) E/AndroidRuntime( 5079): at com.awesometsproject.MainApplication.onCreate(MainApplication.java:47) E/AndroidRuntime( 5079): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:999) E/AndroidRuntime( 5079): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4151) E/AndroidRuntime( 5079): ... 10 more E/AndroidRuntime( 5079): Caused by: java.lang.reflect.InvocationTargetException E/AndroidRuntime( 5079): at java.lang.reflect.Constructor.constructNative(Native Method) E/AndroidRuntime( 5079): at java.lang.reflect.Constructor.newInstance(Constructor.java:417) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:80) E/AndroidRuntime( 5079): ... 17 more E/AndroidRuntime( 5079): Caused by: java.lang.NoClassDefFoundError: java.util.Objects E/AndroidRuntime( 5079): at okhttp3.CertificatePinner.withCertificateChainCleaner(CertificatePinner.java:231) E/AndroidRuntime( 5079): at okhttp3.OkHttpClient.<init>(OkHttpClient.java:238) E/AndroidRuntime( 5079): at okhttp3.OkHttpClient$Builder.build(OkHttpClient.java:1015) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevServerHelper.<init>(DevServerHelper.java:132) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerImpl.<init>(DevSupportManagerImpl.java:183) E/AndroidRuntime( 5079): ... 20 more W/ActivityManager( 1456): Force finishing activity com.awesometsproject/.MainActivity ``` With this fix, the app launch successfully in debug mode, without having to remove flipper altogether from our config. Reviewed By: passy Differential Revision: D22521109 Pulled By: mdvacca fbshipit-source-id: 3c0263642438bd7c0d09b045e15a933bd8a26734 * Send key when onKeyPress event is fired from TextInput Summary: Changelog: [Internal] In `onKeyPress` event, we were not returning `key` property. This diff adds `key` property to `onKeyPress` event and removes other, redundant properties from `onKeyPress` event. The implementation has been translated from Paper. Reviewed By: shergin Differential Revision: D21250411 fbshipit-source-id: f1e31381667acb9dec02d0b33883df8f8f5b2a4b * Calling Paper TextInput setTextAndSelection view command now dirties layout Summary: Changelog: [Internal] Previously `setTextAndSelection` was not dirtying layout. This would cause an issue where `setTextAndSelection` causes layout change. For example calling setTextAndSelection with empty string on a multiline auto expanding text input. I changed one example in TextInputSharedExamples.js, "Live Re-Write (no spaces allowed) and clear" example is now multiline. This allows to test whether `setTextAndSelection` dirties layout. Enter multiline string to to the example text input and press clear. Observe that the text input shrinks to single line height. Reviewed By: shergin Differential Revision: D21182990 fbshipit-source-id: de8501ea0b97012cf4cdf8d5f658649139f92da6 * Remove setMostRecentEventCount from TextInput view commands Summary: Changelog: [Internal] We don't use view command `setMostRecentEventCount`, let's get rid of it. Reviewed By: JoshuaGross Differential Revision: D21016600 fbshipit-source-id: 6491c063e9d6a89252300cb47c010b248e473f4b * Restore Previous Behavior for StyleSheet Validation of Null/Undefined Styles (#29171) Summary: https://github.com/facebook/react-native/issues/27264 changed stylesheet validation to avoid enumerating properties on the prototype of a style. It introduces a secondary behavior change, where null/undefined styles used to be tolerated but now lead to an exception. This is because `for in undefined` will noop where `for of Object.keys(undefined)` will throw. This scenario of undefined/null styles seems to actually show up in practice and was previously well tolerated. E.g. `Button.js` has code that looks like this: ```jsx const styles = StyleSheet.create({ button: Platform.select({ ios: {}, android: { elevation: 4, // Material design blue from https://material.google.com/style/color.html#color-color-palette backgroundColor: '#2196F3', borderRadius: 2, }, }), ``` For non ios/Android platforms, that creates a style object which looks like: ```js { button: undefined, ... } ``` This previously meant that the component would be unstyled if created, but now means out-of-tree platforms throw if the builtin Button component is required. This change restores the previous `for in` loop but adds a `hasOwnProperty` check to avoid properties on prototypes. ## Changelog [General] [Fixed] - Restore Previous Behavior for StyleSheet Validation of Null/Undefined Styles Pull Request resolved: https://github.com/facebook/react-native/pull/29171 Test Plan: Validated that importing Buttons will no longer cause an exception, and that invalid properties are still caught. Reviewed By: JoshuaGross Differential Revision: D22118379 Pulled By: TheSavior fbshipit-source-id: 650c64b934ccd12a3dc1b75e95debc359925ad73 * Set windowTranslucentNavigation to false (#29399) Summary: This fixes https://github.com/facebook/react-native/issues/29397. Without this, apps that specify `android:windowTranslucentNavigation` draw the `LogBox` buttons underneath the soft navigation bar, making the buttons unpressable. Before | After :-------------------------:|:-------------------------: <img src="http://ashoat.com/AndroidTranslucentNavigationLogBox.png" width="300" /> | <img src="http://ashoat.com/AndroidTranslucentNavigationLogBoxFixed.png" width="300" /> ## Changelog [Android] [Fixed] - Set LogBox windowTranslucentNavigation to false Pull Request resolved: https://github.com/facebook/react-native/pull/29399 Test Plan: I tested this change on the [repo](https://github.com/Ashoat/LogBoxTest) I set up to reproduce the issue. I set it up to [build `ReactAndroid` from source](https://github.com/Ashoat/LogBoxTest/commit/3a2cdab8777ac381cd3be5a84a5bf3250751ac11) and then edited `node_modules/react-native/ReactAndroid/src/main/res/devsupport/values/styles.xml` directly. Reviewed By: rickhanlonii Differential Revision: D22602970 Pulled By: mdvacca fbshipit-source-id: 8c2adc149aa0157825075022f00bb695956d3121 * Fix image cannot show in iOS 14 (#29420) Summary: This PR is to fix https://github.com/facebook/react-native/issues/29279, which image cannot show in iOS 14 As https://github.com/facebook/react-native/issues/29279#issuecomment-658244428 mention, this issue can be fixed by calling ` [super displayLayer:layer];` it it is still image, to let `UIImageView` handle still image rendering ## Changelog [iOS] [Fixed] - Fix image cannot show in iOS 14 Pull Request resolved: https://github.com/facebook/react-native/pull/29420 Test Plan: Image can be shown in iOS 14 build with Xcode 12 beta, using ```js <Image source={require('./images/some_local_image.jpg')}/> ``` It may also need to test gif image is render correctly ```js <Image source={{uri: 'https://some_remote_gif_image.gif'}}/> ``` Reviewed By: p-sun Differential Revision: D22619448 Pulled By: shergin fbshipit-source-id: f4d0ad83af945a6b8099d4eaea5a5f1933c7bfd2 * [0.63.2] Bump version numbers * botched merge changes 1 * more hermes changes needed from upstream, botched merge? * [RCTPicker] Guard UIKit only API on macOS * [RCTSegmentedControl] Make UIKit agnostic * [RCTDisplayWeakRefreshable] Make platform agnostic * [RCTImageLoader] Make platform agnostic * [RCTDevLoadingView] Make platform agnostic * botched merge changes 2 * [RCTPushNotificationManager] Guard for macOS * v0.63 TODO * [RCTBaseTextInputViewManager] Make platform agnostic * [RCTBaseTextInputView] Make platform agnostic * [RNTester-macOS] Fix * [RCT-Folly] Fix build * [PlatformColorValueTypes] Add macOS shim * [package] Update CLI to no longer require config This makes a previous change more explicit: https://github.com/microsoft/react-native-macos/pull/602 * Fix iOS build failures. * Get RNTester to launch * [CODEOWNERS] Add myself * [flow] Remove deprecated rule in newer Flow https://github.com/facebook/flow/commit/759970c1b6dc0a25171d9969e34eaf5dae70f130 * [flow] Get iOS checks green * [PlatformColor] Duplicate iOS code for macOS This is a naive version of this change, there should likely be some code sharing happening between iOS and macOS. * [test] Make green with macOS fork changes * [test] Get macOS test bundle to build * [Color] Rename alternating colors to match to assumptions * [PlatformExample] Fix examples on macOS * [transform] Use iOS implementation for macOS * [circle] Fix config * [ci] Update metro config as per upstream * [ci] Ignore metro config in e2e tests * Revert "[ci] Ignore metro config in e2e tests" This reverts commit 25f7006bc9ba76b1e002b721954a823b3d710c5c. * Revert "[ci] Update metro config as per upstream" This reverts commit b47ca570be00394bbd92b349eab02083787301e7. * [ci] Only disable custom metro config in e2e test * [ci] Ignore metro config in e2e tests * [ci] Switch to experimental CocoaPods CDN * Revert "[ci] Switch to experimental CocoaPods CDN" This reverts commit 44a92f7f08397406429672b14930d44b6aa06b5e. * [ci] Skip Android tests in Apple PR on master * [rnm-init] Fix pod reference * [rnm-init] Update minimum iOS deployment target Co-authored-by: Christoph Nakazawa <cpojer@fb.com> Co-authored-by: Sergio Estevao <sergioestevao@gmail.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: Sam Mathias Weggersen <sawegger@microsoft.com> Co-authored-by: Tommy Nguyen <tonguye@microsoft.com> Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Héctor Ramos <hector@hectorramos.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Sebastian Markbage <sema@fb.com> Co-authored-by: generatedunixname89002005287564 <generatedunixname89002005287564@fb.com> Co-authored-by: Eddie Dugan <ejd@fb.com> Co-authored-by: Valentin Shergin <shergin@fb.com> Co-authored-by: Max Ovtsin <maxovtsin@fb.com> Co-authored-by: Alexander Kawrykow <akawry@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Spencer Ahrens <sahrens@fb.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Jack Wang <shoubowang@fb.com> Co-authored-by: Oleg Bogdanov <boguscoder@fb.com> Co-authored-by: Michael Bolin <mbolin@fb.com> Co-authored-by: Dan Abramov <gaearon@fb.com> Co-authored-by: Peter Argany <petetheheat@fb.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: George Zahariev <gkz@fb.com> Co-authored-by: Jason Safaiyeh <safaiyeh@protonmail.com> Co-authored-by: Pedro Barbiero <pedrobarbiero@gmail.com> Co-authored-by: Brian Vaughn <bvaughn@fb.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Martin Sherburn <mns@fb.com> Co-authored-by: Tom Underhill <tomun@microsoft.com> Co-authored-by: Ventsislav Dimitrov <4097884+vdmtrv@users.noreply.github.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: Lucas Bento <lucas.bsilva@outlook.com> Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com> Co-authored-by: Vojtech Novak <vonovak@gmail.com> Co-authored-by: Emilis Baliukonis <emilisb@wix.com> Co-authored-by: Jacob Bower <jbower@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: Marc Horowitz <mhorowitz@fb.com> Co-authored-by: Sidharth Guglani <sidharthguglani@fb.com> Co-authored-by: Andrew Coates (REDMOND) <acoates@microsoft.com> Co-authored-by: maciej simka <mcj.simka@gmail.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Pavlos Vinieratos <pvinis@gmail.com> Co-authored-by: Cristiano Santos <cristianomnsantos@gmail.com> Co-authored-by: Daniel Cohen Gindi <Danielgindi@gmail.com> Co-authored-by: Eli White <eliwhite@fb.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: jiggag <jiggag90@gmail.com> Co-authored-by: Emily Janzer <janzer@fb.com> Co-authored-by: Kacper Wiszczuk <kacperwiszczuk@gmail.com> Co-authored-by: Xiaoyu Yin <xyin@fb.com> Co-authored-by: Javier Cuevas <javi@diacode.com> Co-authored-by: Bruno Barbieri <brunobar79@gmail.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Will Holen <willholen@fb.com> Co-authored-by: Pritesh Nandgaonkar <prit91@fb.com> Co-authored-by: sunnylqm <sunnylqm@qq.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Tim Yung <yungsters@fb.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: Devon Deonarine <hello@devondeonarine.ca> Co-authored-by: Radek Czemerys <radko93@gmail.com> Co-authored-by: Hein Rutjes <IjzerenHein@users.noreply.github.com> Co-authored-by: zhongwuzw <zhongwuzw@qq.com> Co-authored-by: Jonny Burger <jonathanburger11@gmail.com> Co-authored-by: Ryan Tremblay <ryan.tremblay@microsoft.com> Co-authored-by: almouro <contact@almouro.com> Co-authored-by: Rick Hanlon <rickhanlonii@gmail.com> Co-authored-by: Matthieu Harlé <bonjour@matthieuharle.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Ashoat Tevosyan <ashoat@gmail.com> Co-authored-by: Tom Cheung <cheungch@gmail.com>
2020-09-30 19:38:06 +03:00
return require('./Libraries/YellowBox/YellowBoxDeprecated');
},
// Plugins
get DeviceEventEmitter(): RCTDeviceEventEmitter {
return require('./Libraries/EventEmitter/RCTDeviceEventEmitter').default;
},
get DynamicColorIOS(): DynamicColorIOS {
return require('./Libraries/StyleSheet/PlatformColorValueTypesIOS')
.DynamicColorIOS;
},
get NativeAppEventEmitter(): RCTNativeAppEventEmitter {
return require('./Libraries/EventEmitter/RCTNativeAppEventEmitter');
},
get NativeModules(): NativeModules {
return require('./Libraries/BatchedBridge/NativeModules');
},
get Platform(): Platform {
return require('./Libraries/Utilities/Platform');
},
v0.63 sync from upstream (#613) * Upgrade to Metro 0.59 Summary: Upgrades RN to Metro 0.59. Changelog: [Internal] Metro Upgrade Reviewed By: motiz88 Differential Revision: D20533864 fbshipit-source-id: 3c5fb8e37d2363edf0b9a1a8cfbdefba00763415 * Fix mock for TextInput (#28332) Summary: This PR adds the `isFocused` method to the mock of the TextInput component. My understanding some of the latest changes on the TextInput to make it use a forwardRef change the way this method is mock giving an error when trying to use in on a mock. The change suggested here fixes the issue. ## Changelog [JavaScript] [Fixed] - Fix the mock for TextInput to support the `isFocused` method Pull Request resolved: https://github.com/facebook/react-native/pull/28332 Reviewed By: cpojer Differential Revision: D20538044 Pulled By: TheSavior fbshipit-source-id: be734af105ab62ffdf9ed4017bd70845e207f8cd * Properly handle LogBox errors during tests Summary: This diff fixes an issue where errors in LogBox during tests would cause the tests to crash. The crash is due to the NativeExceptionsManager module not being mocked (as all native module need to be in tests). The fix is to properly mock the NativeExceptionManger. This fix exposed an infinite loop issue where failures in LogBox will be logged to the ExceptionManager, which logs to the console, which logs to LogBox, creating a loop. This diff also fixes that look by moving the LogBox internal error check to the top of the monkey patched console methods. Changelog: [Internal] Differential Revision: D20428590 fbshipit-source-id: 7289a480c99ba8dee67772178b7629afb40b330a * Back out "Track animations and flush them" Summary: Original commit changeset: b594d0e6e9b6 D20319824 introduced a problem in LayoutAnimations, which makes surfaced as the problem in T63911344. This diff reverts D20319824. Changelog: [Internal] Reviewed By: lunaleaps Differential Revision: D20541918 fbshipit-source-id: ff72b839f57d39051122920a38b2632cbb5ec362 * Consolidate "dispatchMountItems" reentrancy prevention code, and retry code, in one function Summary: Simplifying the dispatchMountItems reentrance and retry logic. Motivation: cleanup so I can work on dispatching ViewCommands before anything else. Importantly, this gives us the properties that: 1) Only one function is responsible for calling dispatchMountItems 2) Only one function is responsible for deciding if we shouldn't call dispatchMountItems due to reentrance 3) Only one function is responsible for all cleanup 4) Only one function maintains all of the relevant flags (except dispatchPreMountItems... two total now, instead of 4 before) Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20437035 fbshipit-source-id: 5370366790eb25f653bee6c1950e747458374a61 * Only retry ViewCommand mount items if exception is marked as "Retryable" Summary: Instead of just blindly retrying all ViewCommands if they fail - which could be dangerous, since it's arbitrary imperative commands we'd be executing twice, potentially with bad app state - we only retry if the ViewCommand throws a "RetryableMountingLayerException". Changelog: [Internal] Optimization to ViewCommands Reviewed By: mdvacca Differential Revision: D20529985 fbshipit-source-id: 0217b43f4bf92442bcc7ca48c8ae2b9a9e543dc9 * Introduce early dispatch of ViewCommands in FabricUIManager Summary: Earlier this week I introduced a change in the old, non-Fabric renderer (D20378633 D20427803) that (gated behind a feature-flag) executes ViewCommands before all other types of commands, as a perf optimization and (I think) a potential fix for a category of race conditions. I've added more details in comments here. The Fabric renderer uses the same feature-flag that I introduced for the non-Fabric renderer. Changelog: [Internal] Fabric Reviewed By: mdvacca Differential Revision: D20449186 fbshipit-source-id: bb3649f565f32c417a6247369902333989a043aa * Change nightly build from hourly to nightly (daily at 00:00) (#28346) Summary: We initially added the nightly build test to run every hour, in order to more quickly validate it. Now that it has been validated we can run it every night as it is intended to do. cc hramos ## Changelog [General] [Changed] - Change nightly build from hourly to nightly Pull Request resolved: https://github.com/facebook/react-native/pull/28346 Reviewed By: cpojer Differential Revision: D20550143 Pulled By: hramos fbshipit-source-id: 9487c6785684ad6ea7e877290d50a33118090a7f * Add diffing to app bundle size reports (#28284) Summary: Add diffing to app bundle size reports. ## Changelog [Internal] [Changed] - Add diffing to app bundle size reports Pull Request resolved: https://github.com/facebook/react-native/pull/28284 Test Plan: - App bundle size reports should now display a diff where available - Right now, the database contains only one entry for the last known good iOS build - Triggering a new build should not create additional comments Reviewed By: cpojer Differential Revision: D20450158 Pulled By: hramos fbshipit-source-id: 720772275f24d3ff0a49705f4dada2efe2e99bd3 * feat: improve monorepo support by removing redundant PROJECT_ROOT (#28354) Summary: Historically, React Native didn't support a lot of custom project structures apart from the standard flat directory with `ios` and `android` folders. The CLI had to be explicitly started from the project root, otherwise Metro didn't work right. In order to resolve the project root in the most accurate way, React Native assumed that project root is always `../../` from its location in `node_modules` - this is not true when the installation gets hoisted (e.g. in a monorepo). To address that, janicduplessis brought support for custom [`PROJECT_ROOT`](https://github.com/facebook/react-native/commit/9ccde378b6e6379df61f9d968be6346ca6be7ead) that allowed overriding the `../../` in case it wasn't true. Today, CLI is able to automatically resolve the project root, no matter where it's started. It will traverse the tree of the directories upwards and stop as soon as it meets `package.json`. As a result, it doesn't really matter from where we start the CLI anymore as a part of `react-native-xcode.sh`. By replacing the default value of `$REACT_NATIVE_DIR/../../` with `$PWD, that is default for all Xcode scripts, we can make the setup for monorepo easier - nobody will need to set `$PROJECT_ROOT` in order to override the incorrect defaults. By default, all scripts defined in Xcode run from `$PWD` directory, which is the location of the iOS project. In the future, we will be able to remove `cd` entirely. To better understand this PR, let's look a few hypothetical structures as an example: #### Monorepo: > tl;dr works out of the box, no need to mess around with paths ``` - package.json - packages/ - my-app/ - index.js - package.json - ios/ - MyApp.xcodeproj ``` **Before this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $REACT_NATIVE_DIR/../../ node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - Because we change the directory to the root of monorepo, CLI throws an error. All in all, there's no `react-native` dependency at the workspace root. - Some users turn `no hoist` in an act of troubleshooting the errors, which resolves the problem - `react-native` is moved under `my-app/node_modules` which makes this mechanism resolve properly. - Some users find out about `PROJECT_ROOT` and set it to overwrite the default value. For example, setting `export PROJECT_ROOT = "$PWD/../` will set the directory to `my-app`, which has a dependency on `react-native` in a `package.json` and makes the CLI happy. **After this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $PWD node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - The `$PWD` is `packages/my-app/ios/` because that's where the Xcode project is located. CLI will automatically set the root to `../` because that's where it finds `package.json` with `react-native` dependency. It will pass that root to Metro, unless users have set a different one themselves. Thanks to that, all paths to JavaScript files remain working and unaffected. - No need to set `PROJECT_ROOT` anymore. - We don't rely on the location of `node_modules`, which is cleaner and future proof. #### Standard: > tl;dr no changes ``` - ios/ - MyApp.xcodeproj - index.js - package.json ``` **Before this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $REACT_NATIVE_DIR/../../ node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - Everything works fine. Path from `react-native` inside `node_modules` is correct - the project root is set right to `/` **After this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $PWD node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - The root will be set to where Xcode project is located, which is `/ios`. This is the PWD for all Xcode scripts. CLI will look for the `package.json` going upwards from `ios` folder. Will stop at `/`, find out it has `react-native` dependency, load it and its commands and proceed further. ## Changelog [iOS] [Feature] - Better monorepo support when building release apk Pull Request resolved: https://github.com/facebook/react-native/pull/28354 Test Plan: - All projects (standard/monorepo) run without issues. - PROJECT_ROOT is not needed. CC: Titozzz (who wrote monorepo guide), alloy, bartolkaruza Reviewed By: cpojer Differential Revision: D20558005 Pulled By: hramos fbshipit-source-id: 2551120beadcfd4c2f1393ce8a2c2fa6b93c9290 * Fix `test_android`: Remove references to fbsource cell (#28363) Summary: Fixes https://github.com/facebook/react-native/issues/28361. ## Changelog [Internal] [CI] - Fix test_android Pull Request resolved: https://github.com/facebook/react-native/pull/28363 Test Plan: Prior to fix: ``` react-native $ ./scripts/circleci/buck_fetch.sh Guessing 168a69309928ba16065cdb33b1775a4af9f924a6 as the last one used version. Using additional configuration options from /Users/hramos/.buckconfig.d/experiments, /etc/buckconfig.d/fb_chef.ini, /etc/buckconfig.d/fb_chef_override.ini Invalidating internal cached state: Watchman failed to start. This may cause slower builds. Parsing buck files: finished in 1.5 sec Buck wasn't able to parse /Users/hramos/git/react-native/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK: IOError: [Errno 2] No such file or directory: '/Users/hramos/git/react-native/tools/build_defs/platform_defs.bzl' Call stack: File "/Users/hramos/git/react-native/.buckd/resources/168a69309928ba16065cdb33b1775a4af9f924a6/buck_server/buck_parser/profiler.py", line 507, in wrapped return func(*args, **kwargs) File "/Users/hramos/git/react-native/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK", line 1 load("//tools/build_defs:platform_defs.bzl", "ANDROID") File "/Users/hramos/git/react-native/.buckd/resources/168a69309928ba16065cdb33b1775a4af9f924a6/buck_server/buck_parser/profiler.py", line 507, in wrapped return func(*args, **kwargs) This error happened while trying to get dependency '//ReactAndroid/src/main/java/com/facebook/fbreact/specs:FBReactNativeSpec' of target '//ReactAndroid/src/main/java/com/facebook/react/devsupport:devsupport' ``` After fix: ``` react-native $ ./scripts/circleci/buck_fetch.sh + buck fetch ReactAndroid/src/test/java/com/facebook/react/modules Guessing 168a69309928ba16065cdb33b1775a4af9f924a6 as the last one used version. Using additional configuration options from /Users/hramos/.buckconfig.d/experiments, /etc/buckconfig.d/fb_chef.ini, /etc/buckconfig.d/fb_chef_override.ini Invalidating internal cached state: Watchman failed to start. This may cause slower builds. Parsing buck files: finished in 1.1 sec Configuration 'ANDROID_SDK' points to an invalid directory '/opt/android_sdk'. When creating rule //ReactAndroid/src/main/java/com/facebook/hermes/instrumentation:instrumentation. ``` > Note: I don't have the Android SDK configured in this machine. Verified on Circle CI. `test_android` is now green: https://circleci.com/gh/facebook/react-native/140682?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link Reviewed By: cpojer Differential Revision: D20564934 Pulled By: hramos fbshipit-source-id: 5d843b8f113c4db5391ee39addc3ff259d962290 * Fix TextInput left/right padding Summary: This fixes two things: 1) Currently it only respects Start and End padding, and if there's a Theme default, it will override Left/Right padding. Whoops. 2) Currently it doesn't respect when a TextInput starts with padding, but then is removed. This resolves both. It still does not account for RTL support. Changelog: [Internal] Fix AndroidTextInput padding Reviewed By: mdvacca Differential Revision: D20573151 fbshipit-source-id: e89791641b6699e728cde9dbd661a8c21485fbc8 * Validate selection range passed to setTextAndSelection Summary: Changelog: [Internal] # Fabric 1. If `start` and `end` parameters in `setTextAndSelection` are -1, we don't move the cursor. Previously the cursor would be moved to beginning of text input. 2. In view commands, do not validate `eventCount`. It is passed in as undefined from JS because Fabric's text input doesn't use `eventCount`. # Paper 1. If `start` and `end` parameters in `setTextAndSelection` are -1, we don't move the cursor. Previously the cursor would be moved to beginning of text input. Reviewed By: shergin Differential Revision: D20538290 fbshipit-source-id: c7aeddc25f58697254474058ce901df958321f7c * Remove ReactTypes from fbsource and React sync Summary: See https://github.com/facebook/react/pull/18366 This contains a fork of the upstream Flow types. We shouldn't be syncing this since these leads to conflicting types. As a result, these uses have already been codemodded away. Only the imports remained. Changelog: [React Core] - Remove ReactTypes from sync. Reviewed By: gaearon Differential Revision: D20583740 fbshipit-source-id: fc86a934cbdca8ff90fe90282b86ecc945a85e5f * Fix controlled TextInput with child nodes Summary: Changelog: [Internal] # There are three changes in this diff ## _stateRevision is replaced with a BOOL `_stateRevision` was protecting against setting attributed string that is already visible to the user. Previously this was ok because the change was only coming from native, any changes from JS were ignored. Imagine following scenario: 1. User taps key. 2. Update state is called on component initiated by native. 3. New state is created with incremented revision by one. 4. `_stateRevision` gets set to new state's revision + 1. 5. Now JS wants to change something because it just learnt that user tapped the key. 6. New state is created again with incremented revision by one. 7. Update state is called on the component, but the change isn't applied to the text view because `_state->getRevision()` will equal `_stateRevision`. By having a BOOL instead of number, we very explicitly mark the region in which we don't want state changes to be applied to text view. ## Calling [_backedTextInputView setAttributedText] move cursor to the end of text input This is prevented by storing what the current selection is and applying it after `[_backedTextInputView setAttributedText]` is called. This was previously invisible because JS wasn't changing contents of `_backedTextInputView`. ## Storing of previously applied JS attributed string in state This is the mechanism used to detect when value of text input changes come from JavaScript. JavaScript sends text input value changes through props and as children of TextInput. We compare what previously was set from JavaScript to what is currently being send from JavaScript and if they differ, this change is communicated to the component. Previously only first attributed string send from JavaScript was send to the component. # Problem If children are used to set text input's value, then there is a case in which we can't tell what source of truth should be. Let's take following example We have a text field that allows only 4 characters, again this is only a problem if those 4 characters come as children, not as value. This is a controller text input. 1. User types 1234. 2. User types 5th character. 3. JavaScript updates TextInput, saying that the content should stay 1234. 4. In `TextInputShadowNode` `hasJSUpdatedAttributedString` will be set to false, because previous JS value is the same as current JS value. Reviewed By: shergin Differential Revision: D20587681 fbshipit-source-id: 1b8a2efabbfa0fc87cba210570142d162efe61e6 * Daily `arc lint --take BUCKFORMAT` Reviewed By: zertosh Differential Revision: D20593906 fbshipit-source-id: b056947c698508119dc9d4d1bba202295b8f0fda * RN picker - implement background color Summary: add support to the android implementation of the Picker component for setting the background color. Changelog: [Android] [Added] - Support item background color in Dialog Picker Differential Revision: D20566131 fbshipit-source-id: d693b40803fa1051ec955c5728994c820fecd9e9 * Fabric: Modernizing Yoga Dirty flag test. Summary: Now we using TEST_F thing that allows consilidating initialization. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D20578788 fbshipit-source-id: 103bcb8fdeb3dbf297385cfe56415bd646e16791 * Fabric: Changing signature of `ComponentDescriptor::createState` Summary: This is pure syntactic change. Often we don't have a shared pointer to ShadowNodeFamily and only have just a reference. At the same time, `ComponentDescriptor::createState` does not have to accept a shared pointer. So, it's better to accept just a reference. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20578787 fbshipit-source-id: 905277001e096d41e75007575b59ea2ea15fbf4b * Fabric: View Test: Changing state should not dirty Yoga tree (in some most cases) Summary: Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D20578789 fbshipit-source-id: 4336165217bd39fc8065cfaeb96ef7753433d48a * Get ReactiveNative compiled with Clang 10 (#28362) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/28362 Fixed a few compilation errors emitted by Clang 10. Changelog: [iOS] [Fixed] - Get ready for Clang 10 Differential Revision: D20549970 fbshipit-source-id: dc36a85d90d3e43a05f045feb57c6ab6ded67da7 * Guard against null values in object parameters for bridged methods Summary: Handles the case when a value in an object parameter of a turbo module spec is null (even if the type is nullable). For example, given: ``` export interface Spec extends TurboModule { +myFunc: ({| foo: ?string, |}) => void; } ``` and calling `NativeModule.myFunc({foo: null})`, we see an error like: ``` JSON value '<null>' of type NSNull cannot be converted to NSString ``` Guarding against this by converting NSNull's to nils ## Changelog: [iOS] [Fixed] - Fix crash when passing null value in object parameter of bridged method Reviewed By: fkgozali Differential Revision: D20591590 fbshipit-source-id: fdb90f34131427a235f2e3c99147bf1e6a9c6732 * Modify pending deletion tags to be cross manageChildren Summary: Changelog: [Internal] Removing historic layout animations index adjustment (D20323928) broke the Dating Secret Crush screen. Since flushing animations (D20319824) had to be reverted due to issues with Saved + Privacy Shortcuts (https://fburl.com/tasks/eijtmifu) we need to track pending deletions across `manageChildren` operations. Reviewed By: JoshuaGross Differential Revision: D20601079 fbshipit-source-id: c6f116683750e97abe7f988cf361d2a6449e90e6 * Enable label-actions on the react-native repository (#28374) Summary: Enhance our issue management workflow by having the bot respond automatically whenever a label is applied to the issue. ## Changelog [Internal] - CI Pull Request resolved: https://github.com/facebook/react-native/pull/28374 Test Plan: Not tested. If needed, could be applied to a different, test repository. Reviewed By: cpojer Differential Revision: D20606887 Pulled By: hramos fbshipit-source-id: 874d1464527ea76bf51394a7d3e98e4fd8f69345 * Fix Animated Value initialized with undefined in ScrollView (#28349) Summary: When passing an object to contentOffset that doesn't have `y` prop set it causes the following error: ``` Error: AnimatedValue: Attempting to set value to undefined This error is located at: in ScrollView (at src/index.js:638) ... ``` This happens since a runtime check was added to the `AnimatedValue` constructor. (a3aaa471eca58b31597b9a0669f7ade385ccb175) According to flow types the object passed to contentOffset should always contain both x and y props but since it worked before when y is undefined I think its fine to patch the runtime behaviour defensively, especially since the code change is simple. ## Changelog [General] [Fixed] - Fix Animated Value initialized with undefined in ScrollView Pull Request resolved: https://github.com/facebook/react-native/pull/28349 Test Plan: Tested that the crash no longer reproduces when passing an empty object to contentOffset. Reviewed By: cpojer Differential Revision: D20601664 Pulled By: hramos fbshipit-source-id: b098a2dd1e702f995a9a92fa6e4e9a204187dac4 * xplat/js/react-native-github/ReactCommon/fabric/components/textinput/ Summary: Changelog: [Internal] Reviewed By: scottrice Differential Revision: D20619227 fbshipit-source-id: 674337e6ce585a4e96d020f9624b874ba86e2d80 * Seed ssh known hosts with github's public key (#28370) Summary: The [previous attempt](https://github.com/facebook/react-native/pull/28304) to fix the publish step failed, so now reverting to manually configuring things. This PR adds an entry to SSH’s `known_hosts` file using github.com’s public key that I have verified as per [these instructions](https://serverfault.com/a/807363): ``` ~/C/R/react-native [master] » nmap github.com --script ssh-hostkey Nmap scan report for github.com (140.82.118.4) rDNS record for 140.82.118.4: lb-140-82-118-4-ams.github.com PORT STATE SERVICE 22/tcp open ssh | ssh-hostkey: | 1024 ad:1c:08:a4:40:e3:6f:9c:f5:66:26:5d:4b:33:5d:8c (DSA) |_ 2048 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48 (RSA) ``` These fingerprints line up with [the ones posted by GitHub](https://help.github.com/en/github/authenticating-to-github/githubs-ssh-key-fingerprints), so my setup should be good and can be trusted to grab the public key from the right host: ``` ~/C/R/react-native [master] » ssh-keyscan -t rsa -H github.com # github.com:22 SSH-2.0-babeld-d48c3acd |1|If6MU203eXTaaWL678YEfWkVMrw=|kqLeIAyTy8pzpj8x8Ae4Fr8Mtlc= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== ``` ## Changelog [Internal] [Fixed] - Make automated publishing of packages from CI work again Pull Request resolved: https://github.com/facebook/react-native/pull/28370 Test Plan: I used the command being added in this PR in [a failed CI job](https://app.circleci.com/pipelines/github/facebook/react-native/4104/workflows/916127cb-177f-4583-9f90-cae5318041d8/jobs/140810). When I invoked the publish script manually I was not greeted by the blocking prompt and the package was successfully published: https://www.npmjs.com/package/react-native/v/0.0.0-56cf99a96 Reviewed By: cpojer Differential Revision: D20601527 Pulled By: hramos fbshipit-source-id: b1a4405228408cfc4a1b3b44ab88c79522af3a66 * Fix app bundle size diff not always being compared against latest commit (#28368) Summary: - Timestamp of entries in our Firebase instance sometimes get stored as number. This means that we may not always be diffing against the latest master commit. - Size report of Android and iOS gets overwritten depending on which build finishes first. ## Changelog [Internal] [Fixed] - App bundle size diff not always being compared against latest commit [Internal] [Fixed] - Android and iOS app bundle size diff overwrite each other Pull Request resolved: https://github.com/facebook/react-native/pull/28368 Test Plan: - We are now using Firebase's own [firebase.firestore.Timestamp.now](https://firebase.google.com/docs/reference/js/firebase.firestore.Timestamp#now) to ensure that we always get a timestamp in the preferred format. This has been tested locally but can only be verified when merged to master and we start getting new data. In the meantime, I'll manually fix up all the entries in the store. - There should be one app bundle size comment for Android and one for iOS in this PR. Reviewed By: cpojer Differential Revision: D20601620 Pulled By: hramos fbshipit-source-id: 0c3e4b78a74cbd659f1957a6aa74322b016e0646 * Hopefully fix so loading crashes Summary: Changelog: [Android][Internal] Fix potential initializer interruption threading crashes. Reviewed By: mdvacca Differential Revision: D20615755 fbshipit-source-id: 58b706deeb6df1998caff5bf2ae9ec60114313fe * Fix label-actions configuration Summary: Adds back a missing label key, fixes open source issue: https://github.com/facebook/react-native/issues/28378 Changelog: [Internal] [CI] - Fix label-actions config Reviewed By: cpojer Differential Revision: D20625887 fbshipit-source-id: 63c90db249aa9c15369a4b5bcab71cbe75c6d4b8 * Changing Order Of mOverrideColorScheme In Constructor Summary: Changelog: [Android] [Updated] mOverrideColorScheme should be assigned before the first colorSchemeForCurrentConfiguration call, so the initial setting of mColorScheme will reflect the override Reviewed By: zackargyle Differential Revision: D20630173 fbshipit-source-id: a2a2d174d3fc40c14f27dce6a7fa8e67203480c9 * hermes | inspector | Don't include posix headers on non-posix systems Summary: Changelog: [Internal] Hermes inspector includes pthreads, arpa and sys headers on all OSes that would break vanilla Windows builds. This diff adds a check for posix-compliance before inclusion (Note: this ignores all push blocking failures!) Reviewed By: dulinriley Differential Revision: D20564449 fbshipit-source-id: 8e264bc3104065dc4315bb291e8560609fe65184 * Upgrade Prettier from 1.17 to 2.0.2. Summary: This gets us on the latest Prettier 2.x: https://prettier.io/blog/2020/03/21/2.0.0.html Notably, this adds support for TypeScript 3.8, which introduces new syntax, such as `import type`. Reviewed By: zertosh Differential Revision: D20636268 fbshipit-source-id: fca5833d003804333a05ba16325bbbe0e06d6c8a * Back out "Upgrade Prettier from 1.17 to 2.0.2." Differential Revision: D20639755 fbshipit-source-id: 5028563f9cf0527a30b4259daac50cdc03934bfd * Fabric: Additional temporary checks in prop parsing infra Summary: While ViewConfig infra isn't perfect we need to check some value for correctness during prop-parsing. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D20639055 fbshipit-source-id: 193dcd0769bc7777bc8d60c964ede72ebdaa83e4 * Update React package Summary: This just updates the `react` package to the latest stable version. We updated it to experimental internally earlier so this brings the open source version to the latest before the branch cut. This doesn't include any breaking changes. Changelog: [General][Changed] - Update to React 16.13.1 Reviewed By: cpojer Differential Revision: D20642909 fbshipit-source-id: 68a4c74bfe72f1abdb33b0b9071a4f4e8e568318 * Fix sketchy null checks induced by new formatting in Prettier 2.0 Summary: Update code to prepare for Prettier 2.0, which will reformat `a || (b || c)` to `a || b || c`. Changelog: [Internal] prepare for Prettier 2.0 Reviewed By: kassens Differential Revision: D20639483 fbshipit-source-id: c2932b1495884684172ba9291d56c546f51711b8 * RN picker - fix types in AndroidDialogPickerManagerInterface Summary: according to [this crash report](https://our.intern.facebook.com/intern/logview/details/facebook_android_crashes/7ba7056481015482c6166d65cb97e49d/?trace_key=1506fe36a70dd5e50cdc8968f6317f27), `value` was throwing an NPE despite being null-checked. this is because it was an `int` rather than an `Integer`, so the null check wasn't working Changelog: Fix types in AndroidDialogPickerManagerInterface Reviewed By: mdvacca Differential Revision: D20646343 fbshipit-source-id: a27587e0a48f5782bcf5ffddb604018218e65206 * Remove RCTExportModule log spam Summary: The bridge complains if modules aren't exported, which isn't really helpful with lazily loaded modules and turbo modules. I considered only turning this off when TurboModules is enabled, but figured we'd be killing this soon anyways... If anyone feels strongly I can go that approach. Changelog: [iOS][Internal] Remove RCTExportModule log spam Reviewed By: shergin Differential Revision: D20629575 fbshipit-source-id: d32d9fe244c4d06acfee982fca7c7f63da294dc5 * De-jank DevLoadingView Summary: ## Problems Repro steps: 1. Disable Fabric (because CMD + R doesn't work with Fabric right now). 2. Open up Marketplace and hit `CMD + OPT + R` 3. **Observe:** The progress bar doesn't show up right away. It also doesn't actually show progress. https://pxl.cl/140g1 RN Support post: https://fb.workplace.com/groups/rn.support/permalink/3437652016283389/ ## Fixes The first problem is that progress bar doesn't actually show progress. **Fix:** Bundle load progress is updated in `RCTCxxBridge`, where we first require `RCTDevLoadingView`, and then call its `updateProgress` method. Previously, we wouldn't lazily load `RCTDevLoadingView`, it already didn't exist. Lazily loading `RCTDevLoadingView` causes the progress view to show up. Here: https://pxl.cl/140gt If you look at the above video, you'll notice there are two stages to the progress bar: stage 1 displays the actual progress. Stage 2 prompts that we're downloading the JS bundle. As you can see, stage 1 and stage 2 have different background colors, even though both of them are green. **Fix:** I adjusted the JS to match the Native color. Here: https://pxl.cl/140gT We're almost there, but the progress bar is dismissed twice? **Fix:** I dug into the code, and the reason why was because when we hit `CMD + R`, we invalidate the bridge, and immediately re-initialize it. This means that we asynchronously invalidate the old TurboModuleManager, and immediately create a brand new one. Therefore, two `RCTDevLoadingView` modules can (and do) exist at once. So, I moved `RCTDevLoadingView` to be an instance member of `FBReactModule`, to ensure that it doesn't get cleaned up and re-created when TurboModuleManager is deleted and re-created. This finally fixed the progress bar jank: https://pxl.cl/140hn Changelog: [iOS][Fixed] - Remove RCTDevLoadingView jank Reviewed By: rickhanlonii Differential Revision: D20607815 fbshipit-source-id: 05825c67adaf3cfda70be0fa2dc92d413dc8921b * Fix retaining self in block in LogBox impl Summary: Logbox has a retain cycle (see linked task for my deeper investigation). This diff doesn't fix the retain cycle, but it's just good practice to not retain self strongly in blocks. Changelog: [iOS][Internal] Fix retaining self in block in LogBox implementation Reviewed By: shergin Differential Revision: D20630693 fbshipit-source-id: cf399495e9bcd1917932fcc0e9c9d2d2a32bf6f0 * Flow type infoLog Summary: Changelog: [General][Internal] flow type infoLog Reviewed By: zackargyle Differential Revision: D20577939 fbshipit-source-id: eed4401b2ae0a6bf845fdcb54c6abe1fe98fe7c1 * Replace fbsource// with // in xplat/js/ files [1] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: scottrice Differential Revision: D20495655 fbshipit-source-id: a57b72f694c533e2e16dffe74eccb8fdec1f55f5 * Deploy Flow 0.121 to Xplat (#901) Summary: Deploy Flow 0.121 to Xplat bypass-lint allow-large-files Closes https://github.com/facebook/flipper/pull/901 Changelog: [Internal] Reviewed By: panagosg7 Differential Revision: D20570316 fbshipit-source-id: a76983d6f46c8b995ce2dd5cd1e014534790698a * Replace fbsource// with // in xplat/js/ files [3] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D20656211 fbshipit-source-id: deb91b917d349bc500acbb03d734ff621f6e1fc7 * Replace fbsource// with // in xplat/js/ files [4] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: JoshuaGross, shergin Differential Revision: D20656696 fbshipit-source-id: 10f02decb1dc969fd3491ac90d97f09e2bda59e7 * Add Needs: Repro bot action (#28397) Summary: Add automated response for Needs: Repro ## Changelog [Internal] [Added] - Add automated response for Needs: Repro Pull Request resolved: https://github.com/facebook/react-native/pull/28397 Test Plan: Bot should add a comment with the Needs: Repro label. Reviewed By: cpojer Differential Revision: D20665378 Pulled By: hramos fbshipit-source-id: 1c7d878faacf935a640849f74c81f119e5c7e92d * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D20666684 fbshipit-source-id: 32255ac7509e0257693969a7b4b044569af30df7 * ✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392) Summary: Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`. Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job. What was done in this PR: * The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use. * The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument. * The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument * The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument ## Changelog [Internal] [CI] - ✅ Green CI, disabled test infrastructure work Pull Request resolved: https://github.com/facebook/react-native/pull/28392 Test Plan: Verified on Circle CI Reviewed By: cpojer Differential Revision: D20665512 Pulled By: hramos fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726 * Upgrade internal packages to support ESLint >= 6 (#28393) Summary: Fixes https://github.com/facebook/react-native/issues/28293 I've tested it with https://github.com/react-native-community/react-native-template-typescript and it seems to be working as expected - no warnings, supports typescript 3.8. (note: I didn't upgrade the package version as I don't know how the releases work for this package) ## Changelog [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/28393 Reviewed By: hramos Differential Revision: D20647112 Pulled By: cpojer fbshipit-source-id: ca6b67971f625dc8125a58f9220dfcd86250ba94 * Fabric: Fixing a deadlock in RCTSurfacePresenter Summary: This is another attempt to fix an issue very similar to T59424871. The previous attempt was in D19249490. I don't know why we don't see production crashes (stalls) but it happened to me (and not to me) in the debugger. The previous attempt didn't work because we still could have a deadlock because we tried to acquired shared mutex already owned exclusively by the `suspend` method. Here is another approach: Instead of using one shared mutex, now we use two. One is similar to what we had and another that protects `suspend` and `resume`. Besides that, now we pass a Scheduler to functions that use that explicitly. This way we can be more explicit about acquiring mutexes and the overall flow of execution. The idea is: Now an arbitrary code that can be reentrant does not cover with mutexes, so the deadlock is not possible. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20639228 fbshipit-source-id: 98515742f00f2ae94b50b585c9f1f0611e169ebe * Update React Hooks Plugin Summary: Updates `eslint-plugin-react-hooks` to 3.0.0. This introduces a new lint error when you use a Hook inside a class. Changelog: [General][Changed] - Updated the React Hooks ESLint Plugin Reviewed By: cpojer Differential Revision: D20675528 fbshipit-source-id: d0cbe9748fd15df7a4c6de00bd1462610e0a43d6 * Upgrade React DevTools 4.0.6 -> 4.6.0 Summary: Upgrading the embedded version of React DevTools, primarily to pull in [this PR](https://github.com/facebook/react/pull/18397) which will reduce the impact of this package on `node_modules` size. # Update process Following a similar process as D15973709, I began by searching for [all of the references](https://our.intern.facebook.com/intern/biggrep/?corpus=xplat&filename=.json&case=false&view=default&extre=&s=%22react-devtools&engine=apr_strmatch&context=false&filter[uninteresting]=false&filter[intern]=false&filter[test]=false&grep_regex=) to the `react-devtools-core` package and updated all v4 usage to to point to the new 4.6.0 release: 1: Manually update "react-devtools-core" versions: ``` js/package.json js/react-native-github/package.json nuclide/package.json sonar/desktop/app/package.json sonar/desktop/plugins/reactdevtools/package.json vscode/modules/vscode-webview/package.json ``` 2: Setup Yarn proxy: ``` yarn config set proxy http://fwdproxy:8080/ yarn config set https-proxy http://fwdproxy:8080 ``` 3: Run "yarn" in each of the above directories. 4: Run the lockfile shell script: ``` ~/xplat/js/scripts/update-oss-yarn-lockfile.sh ``` 5: Update the generated `MOBILE_JS_NODE_MODULE_DEPS.bzl` by running ``` js1 build buckfiles ``` ## Changelog: [General] [Changed] - Upgrade embedded React DevTools backend from v4.0.6 to v4.6.0. Reviewed By: cpojer, gaearon Differential Revision: D20676091 fbshipit-source-id: 99865bdba9bce45e2a7d582d5fb550cfdbeeca3a * Make ScrollView use ForwardRef Summary: Have ScrollView use forwardRef so that the host component methods like `measure` and `measureLayout` are available without having to call `getNativeScrollRef`. Instead, you can use `<ScrollView ref={myRef} />` and directly call all methods of ScrollView and host components on `myRef`. Previous usage: ``` const myRef = React.createRef<React.ElementRef<typeof ScrollView>>(); <ScrollView ref={myRef} /> const innerViewRef = myRef.current.getNativeScrollRef(); innerViewRef.measure(); ``` New usage: ``` const myRef = React.createRef<React.ElementRef<typeof View>>(); <ScrollView ref={myRef} /> // now, myRef.current can be used directly as the ref myRef.current.measure(); myRef.current.measureLayout(); // Additionally, myRef still has access to ScrollView methods myRef.current.scrollTo(...); ``` Changes: * Added deprecation warnings to ScrollView methods `getNativeScrollRef`, `getScrollableNode`, and `getScrollResponder` * Added the forwardRef call to create `ForwardedScrollView` - this takes in `ref` and passes it into the class ScrollView as `scrollViewRef`. * Forwarded the ref to the native scroll view using `setAndForwardRef`. * Added statics onto `ForwardedScrollView` so that `ScrollView.Context` can still be accessed. * Added type `ScrollViewImperativeMethods`, which lists the public methods of ScrollView. * Converted all public methods of ScrollView to arrow functions. This is because they need to be bound to the forwarded ref. * Bound all public methods of ScrollView to the forwarded ref in the `setAndForwardRef` call. * Flow typed the final output (ForwardedScrollView) as an abstract component that takes in the props of the `ScrollView` class, and has all methods of both the inner host component (`measure`, `measureLayout`, etc) and the public methods (`scrollTo`, etc). Changes to mockScrollView: * Changed mockScrollView to be able to mock the function component instead of a class component * Updated necessary tests Changelog: [General] [Changed] - Make ScrollView use forwardRef Reviewed By: TheSavior Differential Revision: D19304480 fbshipit-source-id: 6c359897526d9d5ac6bc6ab6d5f9d82bfc0d8af4 * Fix issue with onEndReached Summary: onEndReached can be triggered twice when more items are added to the end of the list. This change makes it so that a second call to onEndReached won't happen until the user scrolls down to the new end of the list. Changelog: [General] [Fixed] - Fix double call to onEndReached in VirtualizedList Reviewed By: sahrens Differential Revision: D20066740 fbshipit-source-id: 129d7ae6bfd241eeea18fe0bb12b82be67735874 * Remove console warnings from ScrollView methods Summary: The newly added console warnings in D19304480 are adding a lot of warning noise due to missed infra callsites. Those callsites need to be updated before these warnings can be added. Changelog: [Removed] Remove console warnings from ScrollView methods Reviewed By: rickhanlonii Differential Revision: D20700917 fbshipit-source-id: cb618ee3a291d26e1942e4f91bbc02dee41fb78b * Upgrade react-docgen, jscodeshift and flow-parser Summary: In preparation for upgrading babel, I'm updating some of our source transform tools to the latest versions. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D20675201 fbshipit-source-id: fa4fee2652529c6677087e42cdd1325a8080e46f * Ship State Reconciliation 100% on all platforms Summary: State Reconciliation has been running 50/50 for a while and all metrics look stable. This is necessary for providing a good experience so we should ship to everyone unconditionally. Changelog: [Internal] Fabric diffing reconciliation process improvement Reviewed By: mdvacca Differential Revision: D20715694 fbshipit-source-id: 25b2635ecc29b67e2911679c9db66bc84d37dec1 * Core telemetry tests: update so they pass on my machine Summary: `std::this_thread::sleep_for` is not really precise and will attempt to sleep for "at least" that much time, but may sleep much longer depending on what CPUs are doing and scheduling policies. To get this to pass on my machine, I had to substantially increase the thresholds. Changelog: [Internal] Reviewed By: shergin Differential Revision: D20689571 fbshipit-source-id: f159420d24a95da2b5d95d49ed7882e783291e98 * Optimize diff algorithm to produce fewer remove+insert ("move") paired instructions Summary: An evolution of D20633188 but more performant. There are three optimized paths before the slow path. The first optimized path tries to pair identical nodes from old/new tree, and generate Update mutations, until we hit nodes that are different (indicating either a remove or an insert). This already existed. The next two optimizations, introduced by Tim in his JS pseudocode, were inspired by ReactJS's diffing algorithm. They work in cases where the rest of the nodes are (1) all removals/deletes or (2) all creates+inserts. Finally, if those final two optimized paths can't run, it's because there is a mix of delete+remove, create+insert, and "move" operations, mixed at the beginning, middle, and/or end of the list. This has slightly better average/best-case complexity as the previous implementation. In particularly pathological cases where all nodes are arbitrarily reordered, or reversed, for instance (ABCDE->EDCBA) the algorithm has the same complexity as the previous algorithm (quadratic). For now iOS is pinned to the older differ Changelog: [Internal] Experiment to optimize diffing algorithm in Fabric Reviewed By: shergin Differential Revision: D20684094 fbshipit-source-id: d29fba95a0328156c023e1c87804f23770ee1d91 * Unit test for V2 "minimal instruction" diffing algorithm Summary: This unit test is to verify that the new diffing algorithm generates a "minimal" instruction set, with regards to removes and inserts ("moves"). These unit tests are here to verify the expected behavior in this new algorithm, but these tests may be modified or deleted in the future if we decide we want to change this behavior. Changelog: [Internal] fabric unit test Reviewed By: mdvacca Differential Revision: D20706592 fbshipit-source-id: 5f9991498e0d788ecbf88d938bfe6d3f0f27af40 * Add ES Lint rules for `DynamicColorIOS()`and `ColorAndroid()` (#28398) Summary: The [PlatformColor PR](https://github.com/facebook/react-native/pull/27908) added support for iOS and Android to express platform specific color values. The primary method for an app to specify such colors is via the `PlatformColor()` method that takes string arguments. The `PlatformColor` method returns an opaque Flow type enforcing that apps use the PlatformColor method instead of creating Objects from scratch -- doing so would make it harder to write static analysis tools around Color values in the future. But in addition to `PlatformColor()`, iOS has a `DynamicColorIOS()` method that takes an Object. The Flow type for this Object cannot be opaque, but we still want to enforce that app code doesn't pass variables instead of Object literals or that values in the Objects are variables. To ensure `DynamicColorIOS()` can be statically analyzed this change adds an ESLint rule to enforce that `DynamicColorIOS()` takes an Object literal of a specific shape. A `ColorAndroid()` was also introduced not for practical use but just to test having platform specific methods for more than one platform in the same app. A second ESLint rule is created for `ColorAndroid` as well. ## Changelog [General] [Changed] - Add ES Lint rules for `DynamicColorIOS()`and `ColorAndroid()` Pull Request resolved: https://github.com/facebook/react-native/pull/28398 Test Plan: `yarn lint` passes. Reviewed By: cpojer Differential Revision: D20685383 Pulled By: TheSavior fbshipit-source-id: 9bb37ccc059e74282b119577df0ced63cb9b1f53 * fix: Android gradle config when bundling for release (#28415) Summary: This fix aims to address the issue when bundling an Android app for release and getting the error exhibited in https://github.com/facebook/react-native/issues/28002 which I also encountered myself. The config was changed sometime in November 2019 (as part of https://github.com/facebook/react-native/issues/26940, commit https://github.com/facebook/react-native/commit/a3b08048674e324dbe1f0ca816f35607e9e06a2f) to be very opinionated when it comes to the use of `npx` which Gradle itself cannot find anyway (I have `npx` installed globally and it didn't pick it up). Another issue that the use of `npx` creates is that Gradle should only ever use the currently installed react-native cli rather than a (possibly) higher version which may not always have backward compatibility. The proposed change simply throws a more descriptive error rather than defaulting to a tool which may or may not exist on the machine, be it CI or a development environment. I've also modified the RNTester app to reflect the correct config implementation relative to the RNTester app itself. In real projects, the config inside `android/app/build.gradle` should look similar to the following snippet: ``` project.ext.react = [ cliPath: "$rootDir/../node_modules/react-native/cli.js", entryFile: "index.js" ]; ``` ## Changelog [Android] [Fixed] - Gradle release config Pull Request resolved: https://github.com/facebook/react-native/pull/28415 Test Plan: - [x] Successfully bundled an Android release build with correct config - [x] Works with RNTester app Reviewed By: mdvacca Differential Revision: D20714372 Pulled By: hramos fbshipit-source-id: 4d66139249c6f840582a71a48c64e6a6595f7af0 * Reimplement D19965405: Small improvements in Differentiator/TinyMap Summary: Two things: 1) I reimplement Valentin's idea in D19965405, so that TinyMaps can be iterated over, with a couple of bugfixes (calling front() or back() on an empty vector will crash). 2) I now use TinyMap instead of better::map in the "optimized" diffing algorithm. 3) `erase` now actually removes elements from the vector, but only when more than half of elements have been erased. 4) If you repeatedly erase elements at the beginning of the vector, they will no longer be iterated over. This is a specific optimization for our heaviest TinyMap use-cases. These amount to some small but hopefully somewhat meaningful perf improvements. Changelog: [Internal] Fabric perf Reviewed By: shergin Differential Revision: D20718719 fbshipit-source-id: 91f4b2e2e0f6387ae484e43d5b0095103087baa6 * Remove LayoutInspectingPolicy.includeScrollViewContentOffset Summary: `LayoutInspectingPolicy` has two flags, `includeTransform` and `includeScrollViewContentOffset`. `includeScrollViewContentOffset` seems to be redundant for two reasons. # 1st From looking at callers, they have always the same value. I looked at all call sites, and they are either always both set to true or both set to false. # 2nd The way we include scroll view content offset, is through transformation, so setting `includeTransform` to true and `includeScrollViewContentOffset` to false will include content offset anyway. In order to make both flags work, we would need to introduce further changes to `getRelativeLayoutMetrics`. But since the flag isn't used anyway, I think it is better to get rid of it for now. If we need it in the future, we could re-introduce it. Reviewed By: shergin Differential Revision: D20622256 fbshipit-source-id: fb6156c66b752319ea928239fa723ff90688b0a0 * Add support for translation and rotation to operator * between Rect and Transform Summary: Changelog: [Internal] Until now `Rect operator*(Rect const &rect, Transform const &transform)` supported only scaling. Now it supports translation and rotation as well. Reviewed By: shergin Differential Revision: D20622876 fbshipit-source-id: 1b65393bd3fd6fd9a8941903e0f2681a10097e4a * Include transform property when calling getRelativeLayoutMetrics Summary: Changelog: [Internal] Current implementation of `measure` doesn't take transform into account.. So if you had a view which has width and height 100 and had `Scale(0.5, 0.5, 1)` (this will shrink view by half). Calling `getRelativeLayoutMetrics` would report its size being `{100, 100}`. This applies if view's parent has transformation as well, because transformation is applied to all subviews of the view as well. Reviewed By: mdvacca Differential Revision: D20621590 fbshipit-source-id: 2cf902a0494291c821ecada56f810c5e6620db5a * feat: migrate appveyor to circleci (#28245) Summary: This issue closes https://github.com/facebook/react-native/issues/28241 Migrated Windows test from AppVeyor to CircleCI ## Changelog [Internal] [Changed] - Migrated Windows test from AppVeyor to CircleCI Pull Request resolved: https://github.com/facebook/react-native/pull/28245 Test Plan: For CircleCI to Pass Reviewed By: cpojer Differential Revision: D20689163 Pulled By: hramos fbshipit-source-id: 285c762457ef00f7884ee9157b3f336044c0452f * Remove "Debug with Nuclide" option Summary: This is no longer needed. Reviewed By: cpojer Differential Revision: D20722274 fbshipit-source-id: 5bc3104e90811d724f42aadbf137ab8eff718ca0 * experiment to preload RN bridge after fb4a bookmarks render Summary: Changelog: [Android][Internal] add internal supermodule label Reviewed By: mdvacca Differential Revision: D20434200 fbshipit-source-id: fae50309cdd0df4a4523c2f88d1c8e01a7163575 * Fix CursorDrawable Color Tint for Android 10+ Summary: Accessing this field via reflection is explicitly blacklisted by Google in Android 10 and higher. They have provided a new API to change the color, which I have implemented here. [The old setColorFilter is deprecated](https://developer.android.com/reference/android/graphics/drawable/Drawable#setColorFilter(int,%20android.graphics.PorterDuff.Mode)) so I also updated that method call as well. Changelog: [General] [Fixed] Use new setTextCursorDrawable API for Android 10 Reviewed By: JoshuaGross Differential Revision: D20656068 fbshipit-source-id: 58a92b57c0a892c7c87fc5d735e4ceaa4e987ec7 * Early return on tinting CursorDrawable if no color supplied Summary: There's (potentially) a lot of expensive reflection calls here that, as best I can tell, end up being ignored if the supplied color is null. Better to early return. Changelog: [General] [Internal] Preclude reflection when setting cursor color if color is null Reviewed By: JoshuaGross Differential Revision: D20670594 fbshipit-source-id: 480a988355bbd79008002c4326d4b35035ec2a95 * Partial React Sync for Inspector Summary: Partial sync for React that includes: - https://github.com/facebook/react/pull/18388 - https://github.com/facebook/react/commit/dd7e5e4f5ac2ffac3171ef61daee2cb1edc69635 Created from this branch: https://github.com/facebook/react/compare/master...rickhanlonii:rh-partial-3-24?expand=1 Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20651395 fbshipit-source-id: 67baf7c407f75d9fd01c17f2203a77a38567100e * Enable inspector for Fabric Summary: ## Overview This diff refactors the Inspector, moving logic to look up view data for a touched view inside the renderer as `getInspectorDataForViewAtPoint`. We then implement that same function for Fabric in order to support the inspector in that renderer. Requires https://github.com/facebook/react/pull/18388 ## Motivation Reason one for this refactor is that, previously, the inspector held all of the logic to look up view data for a given x,y touch coordinate. To do this, it would take the React tag and coordinates, look up the native view tag, measure it, and then ask React internals for the Fiber information of that tag. All of this is deeply coupled to React internals, yet the logic is outside of React core in the Inspector. Reason two is that, for Fabric, the logic for getting the view data is different than Paper. In Fabric, we pass the x,y coordinates to native directly, which returns an instance handle. That handle can be used to measure the ShadowNode, or retrieve the Fiber information. By moving the logic into the renderer in React core, we decouple the implementation details of looking up view data for a tapped point and allow ourselves the ability to add and change renderer-specific code for the actual lookup without impacting outsiders like the Inspector. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D20291710 fbshipit-source-id: a125223f2e44a6483120c41dc6146ad75a0e3e68 * chore: update url of warning message from deprecated imports (#28452) Summary: Some of the repository name of Lean Core(https://github.com/facebook/react-native/issues/23313) libraries has been renamed. This PR updates the warning message to display the updated url. ## Changelog [General] [Changed] - Update warning message of deprecated imports Pull Request resolved: https://github.com/facebook/react-native/pull/28452 Test Plan: updated URL can be accessed. Reviewed By: cpojer Differential Revision: D20745184 Pulled By: TheSavior fbshipit-source-id: 2c3ed6a000b45022ca6c4862305aa567c4d18b2e * Add `upgrade-support` link on issue creation (#28411) Summary: This PR adds a https://github.com/react-native-community/upgrade-support link for the user when creating an issue. Changelog: [Internal] Pull Request resolved: https://github.com/facebook/react-native/pull/28411 Reviewed By: cpojer Differential Revision: D20714274 Pulled By: hramos fbshipit-source-id: 4ca42224a50e386b95f21f0fb236a917e1b6b982 * Update PixelRatio 'getFontScale' method description (#28407) Summary: Refs facebook/react-native-website#1776. Despite in-code description `PixelRatio.getFontScale()` is working properly on the iOS (it also reflects the user settings). This PR updates the in-code description to match current behaviour. I have decided to skip in the code information about additional setting in `Accessibility` menu and in `Control Centre`, but if you think it is important just let me know, I can update this PR. ## Changelog [Internal] [Fixed] - Fix PixelRatio getFontScale method description Pull Request resolved: https://github.com/facebook/react-native/pull/28407 Test Plan: N/A Differential Revision: D20750260 Pulled By: shergin fbshipit-source-id: c40ec2fd49cd60e2975351c3a1c453aab0045da4 * Remove allowDisablingImmediateExecutionOfScheduleMountItems feature flag Summary: No longer needed. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20747684 fbshipit-source-id: a8077519b7670d72e23267b1c1423556ec97be3f * RuntimeExecutor helpers that modify the way of the callback is being executed. Summary: Here we implement a bunch of helper methods that allow customizing the behavior of a RuntimeExecutor "on-demand" on the caller side. We will use it in the next diff(s). Changelog: [Internal] Fabric-specific internal change. Reviewed By: PeteTheHeat Differential Revision: D20551411 fbshipit-source-id: 51d3cd02b69753110c0e1155347c6e52eb882c7d * Fabric: Using `executeSynchronouslyOnSameThread_CAN_DEADLOCK` in MainRunLoopEventBeat Summary: We are replacing inline-ed implementation with practically the same one implemented as the helper method. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20551409 fbshipit-source-id: fcc6f497cd240af65fba534051c217fe5746ce82 * Set RootNodeKind trait in ModalHostViewShadowNode Summary: Changelog: [internal] `ModalHostViewShadowNode` didn't have `RootNodeKit` trait, therefore `getRelativeLayoutMetrics` was including nodes in ancestors that it shouldn't have. Reviewed By: shergin Differential Revision: D20735801 fbshipit-source-id: 6b81e3b174c2f82e530abc2bca2da8bebc2270b0 * mention RNTester app in contributor guide (#28042) Summary: motivation is following - the RNTester app is imho the best place to try out any changes that a contributor would make, yet it is not directly mentioned in the contributor guide. This fixes it. ## Changelog [Internal] - Docs Pull Request resolved: https://github.com/facebook/react-native/pull/28042 Test Plan: not necessary Reviewed By: TheSavior Differential Revision: D20401260 Pulled By: hramos fbshipit-source-id: 01c1b7dff56b59909c94b2feb609650f0baba1a9 * Buck: Use Android SDK 29 during build (#28455) Summary: Fixes `test_android` and `test_docker` build failures. Thanks to dulmandakh for identifying the fix. Changelog: [Internal] [Android] [Changed] - Use Android SDK 29 to build during CI tests Pull Request resolved: https://github.com/facebook/react-native/pull/28455 Test Plan: Circle CI shows `test_android` and `test_docker` passing: https://app.circleci.com/jobs/github/facebook/react-native/142273 Reviewed By: sturmen Differential Revision: D20766589 Pulled By: hramos fbshipit-source-id: 8ef8a8ce3a6e7353ae47425accb3bd26cf1608c4 * Assign orderIndex_ in ConcreteViewShadowNode constructor instead of ViewShadowNode's constructor Summary: Changelog: [Internal] `orderIndex_` was only being assigned for `ViewShadowNode`, not for other `ShadowNodes` that are later represented on the screen. Reviewed By: shergin Differential Revision: D20746477 fbshipit-source-id: c04c2cfea14b9141d22bc3d9e9bb4c0c59925754 * Implement nativePerformanceNow to improve Profiler API results (#27885) Summary: When experimenting with React Profiler API (https://reactjs.org/docs/profiler.html), I noticed that durations are integers without a debugger, but they are doubles with higher precision when debugger is attached. After digging into React Profiler code, I found out that it's using `performance.now()` to accumulate execution times of individual units of work. Since this method does not exist in React Native, it falls back to Javascript `Date`, leading to imprecise results. This PR introduces `global.nativePerformanceNow` function which returns precise native time, and a very basic `performance` polyfill with `now` function. This will greatly improve React Profiler API results, which is essential for profiling and benchmark tools. Solves https://github.com/facebook/react-native/issues/27274 ## Changelog [General] [Added] - Implement `nativePerformanceNow` and `performance.now()` Pull Request resolved: https://github.com/facebook/react-native/pull/27885 Test Plan: ``` const initialTime = global.performance.now(); setTimeout(() => { const newTime = global.performance.now(); console.warn('duration', newTime - initialTime); }, 1000); ``` ### Android + Hermes ![Screenshot_1580198068](https://user-images.githubusercontent.com/13116854/73245757-af0d6c80-41b5-11ea-8130-dde14ebd41a3.png) ### Android + JSC ![Screenshot_1580199089](https://user-images.githubusercontent.com/13116854/73246157-92256900-41b6-11ea-87a6-ac222383200c.png) ### iOS ![Simulator Screen Shot - iPhone 8 - 2020-01-28 at 10 06 49](https://user-images.githubusercontent.com/13116854/73245871-f136ae00-41b5-11ea-9e31-b1eff5717e62.png) Reviewed By: ejanzer Differential Revision: D19888289 Pulled By: rickhanlonii fbshipit-source-id: ab8152382da9aee9b4b3c76f096e45d40f55da6c * Save/restore IP when leaving the interpreter Summary: This diff implements the instruction pointer save/restore trick Tzvetan came up with; allowing us to observe and modify the IP from outside the interpreter loop with negligible overhead. From Tzvetan's internal post on the subject: > [Today] the interpreter IP is just a local variable in the interpreter function, so there is no way to get to its value from outside the function. It lives in a register and we don't want to make it a Runtime field since the overhead [of accessing it via memory in the interpeter loop] would kill us. > However, if you really think about it, it only lives in a register while the interpreter function is running. For the rest of the time, it is spilled by the C++ compiler onto the stack. So, precisely when we need it, it is actually stored in memory. The only problem is, we don't know where! Admittedly, that is an annoying problem, but it feels like it should be solvable. > What if, instead of relying on the compiler to spill the IP register, we manually spill it ourselves, to a known location? It works. Example: https://godbolt.org/z/ftSDnp This diff implements this approach across the whole interpreter loop: whenever we call out of the loop we capture/publish the IP and restore it again immediately after the external call returns. This means we can now see the IP outside the interpret loop and even change it. This is effectively "for free" as the compiler now skips spilling/restoring the IP behind the scenes. The immediate benefit of this is knowing the current IP allows us to have more accurate stack-traces during execution. In future this may enabled tricks like changing the IP before returning to the interpreter loop, allowing things outside the interpreter to affect program flow without adding logic to the interpreter loop. Reviewed By: tmikov Differential Revision: D20151091 fbshipit-source-id: 3814382639800208d8985a32ede31ba8f7ff7c80 * Plumb through memory allocation profiler feature to Chrome Inspector Summary: Changelog: Make allocation profiler feature of Chome Inspector work Reviewed By: dulinriley Differential Revision: D20383003 fbshipit-source-id: 8a10c310d5a639a6644763adb53f2f0017057587 * chore: update lint config in template (#28443) Summary: Updating the eslint config and metro-preset used in project template. ## Changelog [General] [Changed] - Upgrade eslint-config and metro-preset in project template Pull Request resolved: https://github.com/facebook/react-native/pull/28443 Test Plan: - Start new project with `npx react-native init TestLint` - upgrade lint and metro-config - run lint and start up emulator on iOS and android Reviewed By: cpojer Differential Revision: D20771048 Pulled By: hramos fbshipit-source-id: a6d387b8687cee348681bcb10d22c7e3de291ed7 * Apply buckformat in preparation for updating buildifier Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D20773287 fbshipit-source-id: 144bb13191312eef246646b99e1dc06304c6d210 * Circle CI Housekeeping: Windows, e2e (#28471) Summary: Circle CI Housekeeping: * Integrate Windows job into `tests` workflow * Add parametrized e2e tests command * Move js e2e tests out of the disabled test quarantine area * Parametrize and split `test_ios` job to reduce total execution time by ~13 minutes **Before:** Longest running iOS job at 39 minutes. | Setup Job Runtime | Job | Job Runtime | Total Runtime | | - | - | - | - | | 01:24 | test_ios | 38:04 | **39:28** | | 01:24 | test_ios_frameworks | 38:02 | 39:26 | ![Screen Shot 2020-03-31 at 12 40 29 PM](https://user-images.githubusercontent.com/165856/78068308-044c3280-734d-11ea-96bf-2e50691a0ef7.png) **After:** Longest running iOS job down to 26 minutes. | Setup Job Runtime | Job | Job Runtime | Total Runtime | | - | - | - | - | | 01:26 | test_ios_unit | 20:48 | 22:14 | | 01:26 | test_ios_unit_frameworks | 22:52 | 24:18 | | 01:26 | test_ios_detox | 24:35 | 39:28 | | 01:26 | test_ios_detox_frameworks | 24:54 | **26:20** | ![Screen Shot 2020-03-31 at 12 39 22 PM](https://user-images.githubusercontent.com/165856/78068294-fe565180-734c-11ea-96da-8836231d7747.png) ## Changelog [Internal] [CI] - CI Housekeeping Pull Request resolved: https://github.com/facebook/react-native/pull/28471 Test Plan: Circle CI Reviewed By: cpojer Differential Revision: D20774521 Pulled By: hramos fbshipit-source-id: 4a2f5a4083cd76dcb51d5ccaf726cd204fca222e * Fix bug in optimized differ Summary: The differ was still producing correct, but not minimal, instruction sets in some cases due to an optimization that was buggy. This affected cases where 2+ nodes were inserted at the beginning of a list. It would trigger the old behavior where all nodes after the first would be removed, deleted, then reinserted. See the test case (which was failing and now passed) and P128190998 (the 3->4 transition) for samples. Changelog: [Internal] Fabric differ Reviewed By: mdvacca Differential Revision: D20785729 fbshipit-source-id: 2fea6a816753066abb358ed7bb51003140cd5fc4 * Use `buildCodeFrameError` in babel-plugin-inline-view-configs Summary: The next version of Babel changes how it prints file names in errors. This diff fixes the test by using `/` as the `cwd` and switches the plagin to use `path.buildCodeFrameError` so errors will be more helpful for users. I renamed the `nodePath` variable to `path` because that's what babel plugins usually do. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D20781805 fbshipit-source-id: cc149dce6389aa9402ce70ea30035c74a6150ea3 * Swap left and right yoga position with start and end in RTL context Summary: Changelog: [Internal] Paper swaps right and left in RTL setting, this logic is in [RCTShadowView.m](https://our.intern.facebook.com/intern/diffusion/FBS/browse/master/xplat/js/react-native-github/React/Views/RCTShadowView.m?commit=cdd504cfbee66ae0659495604c4ff7b5764a1d9e&lines=529-549). For Fabric instead of doing it during yoga props assignment, I swap the left/right with start/end just before we pass yoga nodes to layout calculation. Reviewed By: shergin Differential Revision: D20420040 fbshipit-source-id: b777f2658f56c173743b2034b8b5059e3e0c9840 * Fix inline-view-configs test on Windows. Summary: *facepalm* The file path is platform specific. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D20793023 fbshipit-source-id: 4fbcbf982911ee449a4fa5067cc0c5d81088ce04 * Pass isRTL flag from FabricUIManager Fabric core Summary: Changelog: [Internal] Send `isRTL` flag and `doLeftAndRightSwapInRTL` flags from Java to Fabric Core. Reviewed By: JoshuaGross, mdvacca Differential Revision: D20776005 fbshipit-source-id: 946c239d9a11ebea958b0a6d04f2316b7cd77311 * Promote shadowColor to formsStackingContext property Summary: Changelog: [Internal] View with `ShadowColor` was getting flattened and therefore views didn't have shadow property set. This is fixed by promoting ShadowColor so in case it is set, it forms stacking context. Reviewed By: shergin Differential Revision: D20792201 fbshipit-source-id: 1033ac00e32047ffbb14e61b7c26348c578d132d * Get CallInvokers from the bridge Summary: ## Context For now, assume TurboModules doesn't exist. **What happens when we call an async NativeModule method?** Everytime JS calls an async NativeModule method, we don't immediately execute it. The legacy infra pushes the call into some queue managed by `MessageQueue.js`. This queue is "flushed" or "emptied" by the following events: - **Flushed:** A C++ -> JS call. NativeModule async methods can called with an `onSuccess` and/or `onFail` callback(s). Calling `NativeToJsBridge::invokeCallback` to invoke one of these callbacks is one way for ObjC++/C++/Java to call into JS. Another way is via JSModule method calls, which are initiated by `NativeToJsBridge::callFunction`. - **Flushed:** When `JSIExecutor::flush` is called. Since TurboModules don't exist, this only happens when we call `JSIExecutor::loadApplicationScript`. - **Emptied:** When more than 5 ms have passed, and the queue hasn't been flushed/emptied, on the next async NativeModule method call, we add to the queue. Afterwards, we empty it, and invoke all the NativeModule method calls. **So, what's the difference between flushed and emptied?** > Note: These are two terms I just made up, but the distinction is important. If the queue was "flushed", and it contained at least one NativeModule method call, `JsToNativeBridge` dispatches the `onBatchComplete` event. On Android, the UIManager module is the only module that listens to this event. This `onBatchComplete` event doesn't fire if the queue was "emptied". **Why does any of this matter?** 1. TurboModules exist. 2. We need the TurboModules infra to have `JsToNativeBridge` dispatch `onBatchComplete`, which depends on: - **Problem 1:** The queue being flushed on calls into JS from Java/C++/ObjC++. - **Problem 2:** There being queued up NativeModule async method calls when the queue is flushed. In D14656466, fkgozali fixed Problem 1 by making every C++/Java/Obj -> JS call from TurboModules also execute `JSIExecutor::flush()`. This means that, with TurboModules, we flush the NativeModule async method call queue as often as we do without TurboModules. So far, so good. However, we still have one big problem: As we convert more NativeModules to TurboModules, the average size of the queue of NativeModule method calls will become smaller and smaller, because more NativeModule method calls will be TurboModule method calls. This queue will more often be empty than not. Therefore, we'll end up dispatching the `onBatchComplete` event less often with TurboModules enabled. So, somehow, when we're about to flush the NativeModule method call queue, we need `JsToNativeBridge` to understand that we've executed TurboModule method calls in the batch. These calls would have normally been queued, which would have led the queue size to be non-zero. So if, during a batch, some TurboModule async method calls were executed, `JsToNativeBridge` should dispatch `onBatchComplete`. **So, what does this diff do?** 1. Make `Instance` responsible for creating the JS `CallInvoker`. 2. Make `NativeToJsBridge` responsible for creating the native `CallInvoker`. `Instance` calls into `NativeToJsBridge` to get the native `CallInvoker`. 3. Hook up `CatalystInstanceImpl`, the Android bridge, with the new JS `CallInvoker`, and the new native `CallInvoker`. This fixes `onBatchComplete` on Android. iOS work is pending. Changelog: [Android][Fixed] - Ensure `onBatchComplete` is dispatched correctly with TurboModules Reviewed By: mdvacca Differential Revision: D20717931 fbshipit-source-id: bc3ccbd6c135b7f084edbc6ddb4d1e3c0c7e0875 * Make HermesRuntime::description() always include "HermesRuntime" Summary: If name is passed in as part of RuntimeConfig, that is included in the description, too. Changelog: [Internal] Reviewed By: dulinriley Differential Revision: D20716320 fbshipit-source-id: f2fba6df32f496090dee787d8b7f55a6a4dd8ed8 * Fix Yoga flexshrink with min-width sizing issue Summary: While resolving the flexible items we calculate totalFlexShrinkScaledFactors which uses the flexBasis or initial width of node (Not min-width). At a later stage during distribution of space we are subtracting value from this which also takes care of min-width. For example If node has flexShrink 1 and width 100 and min-width 301 then totalFlexShrinkScaledFactors will become -1*100 = -100 but later we are subtracting -1 * 301 (min-width) = -301 which is ambiguous and causing layout inconsistencies with how web behaves. Fixed this by only using the flexBasis or width for these calculations. Changelog: [Internal][Yoga] Fix layout issue when flexShrink and min-width are used together Reviewed By: pasqualeanatriello Differential Revision: D20219419 fbshipit-source-id: 948fbc06ca541d4ad307c88c8a2df65d157778b1 * More consistent snapshots on windows (#28482) Summary: Get jest tests to be runnable on windows, and match current snapshots ## Changelog [Internal] [Fixed] - More consistent snapshots on windows Pull Request resolved: https://github.com/facebook/react-native/pull/28482 Test Plan: run `yarn test` on a windows machine, and hit the test_windows circleci tests Reviewed By: hramos Differential Revision: D20799002 Pulled By: cpojer fbshipit-source-id: da3db0171c34a43199c7d3dc17b622b37bc91701 * Improve component stack parsing Summary: Update the error log message parsing to fix missing component stacks in console.errors. Changelog: [Internal] Reviewed By: cpojer Differential Revision: D20801985 fbshipit-source-id: ae544200315a8c3c0310e8370bc38b0546734f38 * Implement RCTWarn equivalent on Android Summary: ## Overview This diff is an RFC to port a logging feature from iOS to Android. Changelog: [Internal] ## Motivation On iOS we have the following log functions and behaviors available for logging native warnings and errors: - **Warnings** (`RCTLogWarn`) - Log level 'warn' to console - Display warning in LogBox - **Errors** (`RCTLogError`) - Log level 'error' to console - Display a native RedBox (needs converted to show a LogBox if available) - **Logs** - We also have `RCTLog`, `RCTTrace`, `RCTAdvice`, `RCTInfo`, which just log to the console. In Java, we have: - **Warnings** - **None**, added in this diff - **Errors** (`DevSupportManager.showNewJavaError`) - Log level 'error' to console with `FLog.e` - Display a native RedBox (needs converted to show a LogBox if available - **Logs** - `ReactSoftException` (crashes the app??) - `ReactNoCrashSoftException` (only logs??) - Others? ## Details This diff adds a method to pair with `RCTLogWarn`, `DevSupportManager.showNewJavaWarning`, which will log to the console and show a LogBox warning if LogBox is available. ## Concerns I have a few concerns/questions about the state of logging on Android: - Should/can we move all of the logging to it's own class, like how RCTLog works? - Why does some logging happen on DevSupportManager and some in other classes? - If we moved it all to it's own class, how could we access the reactContext to call the RCTLog JS module Reviewed By: JoshuaGross Differential Revision: D20056394 fbshipit-source-id: 32d57e300685e46da8039fc77cb22b4084acf81a * Remove unused feature flag: useMapNativeAccessor Summary: useMapNativeAccessor isn't being used anywhere. Changelog: [Internal] Removing unused internal feature flags: mUseMapNativeAccessor and mUseArrayNativeAccessor Reviewed By: mdvacca Differential Revision: D20788147 fbshipit-source-id: bf670508326813602cb544f86d3d2164651d3394 * Remove unused Feature Flag: lazilyLoadViewManagers Summary: Remove unused feature flag. This is not used within Facebook and I'm not aware of usage outside of FB. Changelog: [Removed] Removing Android feature flag: lazilyLoadViewManagers Reviewed By: mdvacca Differential Revision: D20788210 fbshipit-source-id: 435316e3de7830d7cb7f14537351883e4fc6eeaa * Remove unused feature flag: enableExtraWebViewLogs Summary: Hard-coded to false everywhere, and write-only. We never read from this. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20788252 fbshipit-source-id: ae117ebc51db7045947b9713602527ff4220833e * Remove unused feature flag: logDroppedViews Summary: Remove unused internal feature flag, logDroppedViews. Changelog: [Internal] Reviewed By: lunaleaps Differential Revision: D20797353 fbshipit-source-id: 1bfea7fcce9e80cdb92cda59a89c7dd817d4a581 * Split loadApplicationScript into initializeRuntime and loadBundle (#27844) Summary: This is the first of three PRs related to enabling multi-bundle support in React Native. More details, motivation and reasoning behind it can be found in RFC [here](https://github.com/react-native-community/discussions-and-proposals/issues/152). Logic responsible for installing globals was pulled out from `loadApplicationScript` to `initializeRuntime` since it should be ran only once, what was left was renamed to `loadBundle`. It's based on dratwas work from [here](https://github.com/callstack/react-native/tree/feat/multibundle/split-load-application), but applied to current `master` to avoid rebasing 3-months old branch and issues that come with that. ## Changelog [Internal] [Changed] - split `loadApplicationScript` into `initializeRuntime` and `loadBundle` to enable multi-bundle support in the future Pull Request resolved: https://github.com/facebook/react-native/pull/27844 Test Plan: Initialized new RN app with CLI, set RN to build from source and verified the still app builds and runs OK using code from this branch. Reviewed By: rickhanlonii Differential Revision: D19888605 Pulled By: ejanzer fbshipit-source-id: 24ace48ffe8978796591fe7c6cf53a61b127cce6 * Back out "Fix controlled TextInput with child nodes" Summary: Changelog: [Internal] Original commit changeset: 1b8a2efabbfa Original diff D20587681 breaks non-controlled text input. Reviewed By: motiz88 Differential Revision: D20815935 fbshipit-source-id: 70577ed1e5701850ff0e30a6592945a31c2a8bec * Fixed crash in JSIExecutor::NativeModuleProxy Summary: JSIExecutor::NativeModuleProxy is an object created by JSIExecutor and essentially representing that in JavaScript world. Before this change, JSIExecutor::NativeModuleProxy had a raw reference to JSIExecutor which (I believe) caused a crash because JSIExecutor can be deallocated before JSIExecutor::NativeModuleProxy. Now, instead of storing a pointer to JSIExecutor, we store a weak pointer to JSINativeModules which we can safely validate before calling on it. Changelog: [Internal] Fixed crash in JSIExecutor Now the configuration looks like this: ``` + - - - - - - - - - - - - - - - - - - - - - Something else | | shared_ptr<jsi::Runtime> runtime --+ | | + - - - - - - - - - - - - - - - - - - - - - | | | +------------------------------------------+ | | | | | JSExecutorFactory | | +--------------------------------+-------------------------------+ | | +-----------------------+ | | | +------------------------------------------+ | | v | | | +------------------------------------------+ | +--------------------------+ | | | | | | | | ModuleRegistry | | v | | | | | +------------------------------------------+ | | +------------------------------------------+ | | HermesRuntimeImpl | | | | | | (jsi::Runtime) |--+ | | +->+------------------------------------------+ | | | | | | | |std::unordered_map<std::string, size_t> | | +------------------------------------------+ | | | | |modulesByName_ | | | | | | | | | | | | | +------------------------------------------+ | | | | +->+------------------------------------------+ | +-----------------------+ | | |std::vector<std::unique_ptr<NativeModule>>| | | | | |modules_ | | | | | | | | v | | +------------------------------------------+ | +------------------------------------------+ | | | | | | | | | JSIExecutor::NativeModuleProxy | | | | | | | | | +------------------------------------------+ | | | +------------------------------------------+ | | | | | | +->+------------------------------------------+ | | | | NativeToJsBridge | |shared_ptr<JSINativeModules> | | | | | | |nativeModules_ | | | | +------------------------------------------+ +------------------------------------------+--+-----+------------------------------------+ | | | | | | +->+------------------------------------------+ | | | | | |unique_ptr<JSExecutor> | | | | | | |m_executor | | | | | | |(`::destroy()` resets it.) | | | | | | +------------------------------------------+--------------------------------+ | | | | +->+------------------------------------------+ | | | | | | |shared_ptr<JsToNativeBridge> | | | | | | | |m_delegate | | | | | | | +------------------------------------------+--+ v | | | | +->+------------------------------------------+ | +------------------------------------------+ | | | | |shared_ptr<MessageQueueThread> | | | | | | | | |m_executorMessageQueueThread | | | HermesExecutor: JSIExecutor: JSExecutor | | | | | +------------------------------------------+ | | | | | | | | +------------------------------------------+ | | | | | | | | | | | +->+------------------------------------------+ | | | | | | |shared_ptr<jsi::Runtime> | | | | | | | |runtime_ | | | | | | | +------------------------------------------+--+ | | | | +->+------------------------------------------+ | | | | | |shared_ptr<JSINativeModules> | | | | | | |nativeModules_ | | | | | | +------------------------------------------+--------+------------------------------------+ | +--------------------------+ +->+------------------------------------------+ | | | | |std::shared_ptr<ExecutorDelegate> | | v | | |delegate_ | | +------------------------------------------+ | | +------------------------------------------+--+ | | | | | | | | JSINativeModules | | | | | | | | | | | +------------------------------------------+ | | | | | | | | | +-->+------------------------------------------+ | +-----------------------------------------------------------------------------------+ | |m_moduleRegistry | | | | |(shared_ptr) | | | | +------------------------------------------+--+ | | | | v | +------------------------------------------+ | | | | | JsToNativeBridge: ExecutorDelegate | | | | | +------------------------------------------+ | | | +->+------------------------------------------+ | |shared_ptr<ModuleRegistry> | | |m_registry | | +------------------------------------------+-----------------------------------------------------------------+ ``` Reviewed By: RSNara Differential Revision: D20817257 fbshipit-source-id: 9ae378dbe880aaabfef7ae783dae2f94ee4b0af5 * Fix crash caused by <Modal> trying to present view controller twice Summary: Changelog: [Internal] `_viewController` was being presented twice causing following exception ``` 'Application tried to present modally an active controller <FBReactRootViewController: 0x7fe741818b80; ``` Reviewed By: shergin Differential Revision: D20820395 fbshipit-source-id: 5c9489011e5f99d8bd37befbd544d2d55a650589 * Loosen up restrictions for internal changelogs (#28486) Summary: Do not nag on PRs that contain internal changelogs (meaning, the change doesn't need to be called out in release notes). ## Changelog [Internal] - This should be acceptable. Pull Request resolved: https://github.com/facebook/react-native/pull/28486 Test Plan: See PR. Reviewed By: cpojer Differential Revision: D20817454 Pulled By: hramos fbshipit-source-id: a7082c4db05ec53ad27349db7e5bce2cfffd6930 * Fix TextInlineViews when UIImplementation processes two roots at the same time Summary: This diff cleans the variable NativeViewHierarchyOptimizer.mTagsWithLayoutVisited right after all the view updates for a rootShadowNode have been processed by the UIImplementation class. This intends to fix the bug reported in the task: T61185028, which root cause seems related to the fact that the variable NativeViewHierarchyOptimizer.mTagsWithLayoutVisited is not cleaned up when updating multiple rootShadowNodes as part of the same batch changelog: [Android][internal] internal bug fix Reviewed By: JoshuaGross Differential Revision: D20812921 fbshipit-source-id: 28067ee29a931d7a9e9c33c90aceb4e3512dac1a * Add a React Feature Flag to control TextInlineView fix Summary: This diff adds a temporary Feature Flag to control a fix in TextInlineView (see previous diffs of the stack) changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D20812920 fbshipit-source-id: 90fece9b29ba173546d96e4d9baf1ccabb3031b2 * Pass native CallInvoker to ObjCTurboModule constructor Summary: This is necessary to integrate TurboModule async method dispatch with the bridge's `onBatchComplete` event. See D20717931 for more details. This diff is similar to D20480971. **Note:** This stack doesn't really make any functional changes, since the native CallInvoker is `nullptr` right now. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809199 fbshipit-source-id: bf465a3a51bdddb8b56d1e696ca510fdf071f9ec * Manual changes required to make ObjCTurboModule accept native CallInvoker Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809200 fbshipit-source-id: d540eec9a3360a031f75d76a6ab9fb15303f8af5 * Codemod all getTurboModuleWithJsInvoker methods to accept a native CallInvoker Summary: To make iOS TurboModules integrate with the bridge's onBatchComplete event, they need to use a native CallInvoker. This call invoker is created by the `NativeToJsBridge`, and ObjCTurboModule will use this native CallInvoker to dispatch TurboModule method calls. This diff makes sure that ObjCTurboModules are created with that native CallInvoker. ## Script ``` var withSpaces = (...args) => args.join('\s*') var regexString = withSpaces( '-', '\(', 'std::shared_ptr', '<', '(?<turboModuleClass>(facebook::react::|react::|::|)TurboModule)', '>', '\)', 'getTurboModuleWithJsInvoker', ':', '\(', 'std::shared_ptr', '<', '(?<callInvokerClass>(facebook::react::|react::|::|)CallInvoker)', '>', '\)', '(?<jsInvokerInstance>[A-Za-z0-9]+)', 'perfLogger', ':', '\(', 'id', '<', 'RCTTurboModulePerformanceLogger', '>', '\)', '(?<perfLoggerInstance>[A-Za-z0-9]+)', '{', 'return', 'std::make_shared', '<', '(?<specName>(facebook::react::|react::|::|)Native[%A-Za-z0-9]+SpecJSI)', '>', '\(', 'self', ',', '\k<jsInvokerInstance>', ',', '\k<perfLoggerInstance>', '\)', ';', '}', ) var replaceString = `- (std::shared_ptr<$<turboModuleClass>>) getTurboModuleWithJsInvoker:(std::shared_ptr<$<callInvokerClass>>)$<jsInvokerInstance> nativeInvoker:(std::shared_ptr<$<callInvokerClass>>)nativeInvoker perfLogger:(id<RCTTurboModulePerformanceLogger>)$<perfLoggerInstance> { return std::make_shared<$<specName>>(self, $<jsInvokerInstance>, nativeInvoker, $<perfLoggerInstance>); }` const exec = require('../lib/exec'); const abspath = require('../lib/abspath'); const relpath = require('../lib/relpath'); const readFile = (filename) => require('fs').readFileSync(filename, 'utf8'); const writeFile = (filename, content) => require('fs').writeFileSync(filename, content); function main() { const tmFiles = exec('cd ~/fbsource && xbgs -n 10000 -l getTurboModuleWithJsInvoker:').split('\n').filter(Boolean); tmFiles .filter((filename) => !filename.includes('microsoft-fork-of-react-native')) .map(abspath) .forEach((filename) => { const source = readFile(filename); const newSource = source.replace(new RegExp(regexString, 'g'), replaceString); if (source == newSource) { console.log(relpath(filename)); } writeFile(filename, newSource); }); } if (!module.parent) { main(); } ``` Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809202 fbshipit-source-id: 5d39b3cacdaa5681b70ce1803351d0432dd74550 * Make RCTTurboModuleManagerDelegate getTurboModule accept native CallInvoker and PerfLogger Summary: Might be worthwhile to just kill this method instead, since we're having all NativeModules provide their TurboModule jsi::HostObjects. But I'll leave that decision to a later time. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809201 fbshipit-source-id: ee73d4b5454a76460832a54f9b864841e5b2b9c0 * eslint-config: add version badge and add homepage for eslint-config (#28506) Summary: Add version badge to README of eslint-config, and add specific url for the homepage so people looking at the npm package can find out where the package is from. ## Changelog [Internal] [Changed] - Add version badge to README of eslint-config Pull Request resolved: https://github.com/facebook/react-native/pull/28506 Test Plan: Not required as the only changes are made in README and homepage prop of package.json Differential Revision: D20837085 Pulled By: cpojer fbshipit-source-id: 820d3b44b069780ec8764c6152d2e7fd5220933c * Rename Instance::getNativeCallinvoker to Instance::getDecoratedNativeCallInvoker Summary: Now, instead of accepting a `std::function` that schedules work, and returning a `CallInvoker`, `Instance::getDecoratedNativeCallInvoker` will accept a `CallInvoker` that schedules work, and return a decorated `CallInvoker`. I think this change will help with readability. It also clarifies that the bridge is adding additional behaviour to the native `CallInvoker`. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20826885 fbshipit-source-id: a2c5681d10a4544ee3d2a0d1f1cbd386ef06d0e6 * Add CallInvoker::invokeSync Summary: We'll be using a native CallInvoker to dispatch sync and async method calls to ObjC NativeModules. This native CallInvoker will hold a reference to the ObjC NativeModule's method queue. **Why is the native CallInvoker required for ObjC NativeModules?** In the case where the ObjC NativeModule neither provides nor requests a method queue, we must create a method queue for it. When we go to invoke a method from JS, for these NativeModules specifically, there is no way to access this method queue. A native CallInvoker is a convenient abstraction that holds on to that method queue. For async calls, we'll just call `CallInvoker::invokeAsync`, and for sync calls, we'll just call `CallInvoker::invokeSync`. **Why do we need sync call support for native `CallInvoker`?** In ObjC, sync NativeModule method calls block the JS thread, then execute synchronously on the NativeModule's method queue, and then unblock the JS thread. This is what'll be implemented by `CallInvoker::invokeSync`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20829955 fbshipit-source-id: efb9d5408a1ade81069a943c865f232d4d10acfe * Export Instance::getDecoratedNativeCallInvoker from RCTCxxBridge Summary: `RCTTurboModuleManager` will create a native `CallInvoker` for each ObjC NativeModule. This `CallInvoker` will be used to dispatch calls from JS to native. Before passing the native `CallInvoker` to the `ObjCTurboModule`, it'll first use `RCTCxxBridge decorateNativeCallInvoker` to get a bridge-aware decorated native `CallInvoker`. That way, the bridge remains informed about async TurboModule method calls that took place since the last time it was flushed. This ensures that we don't end up dispatching `onBatchComplete` any less with TurboModules on than we do with TurboModules off. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20831546 fbshipit-source-id: b2eb4e0097e0dabf8c4bd8fdc4c850a0858af699 * Add Author Feedback label automatically (#28484) Summary: Improve issue triage by automatically adding the "Needs: Author Feedback" label. NOTE: The old label-actions app should be disabled when this PR is merged: https://github.com/apps/label-actions/installations/7445225 ## Changelog [Internal] - Issue Triage Pull Request resolved: https://github.com/facebook/react-native/pull/28484 Test Plan: Verified the same `label-actions.yml` and workflow config on a private repo. Reviewed By: cpojer Differential Revision: D20817443 Pulled By: hramos fbshipit-source-id: 39732dd67509c9fb9cf6ff7306913f5ec088266d * docs: add README and specify file in package.json (#28507) Summary: Adding a README for `react-native-codegen` since the package was published. Also added a `files` prop in package.json so unused file won't be included in the package. ## Changelog [Internal] [Changed] - Add README for react-native-codegen. Pull Request resolved: https://github.com/facebook/react-native/pull/28507 Test Plan: verify js files to function correctly without including files other than `src` Reviewed By: rickhanlonii Differential Revision: D20836113 Pulled By: cpojer fbshipit-source-id: e860f14760e9c1dbe121f5fb95ccf72d4ddb2af1 * Make the link easier to copy. (#28516) Summary: Making a PR from GitHub, I need to copy-paste the link, and it would be easier to just triple-click a line with the URL rather than carefully selecting the URL from the text. <img width="723" alt="Screen Shot 2020-04-03 at 17 33 47" src="https://user-images.githubusercontent.com/100233/78378550-6c12af80-75d1-11ea-93a4-2eae568ce602.png"> ## Changelog [General] [Changed] - Make PR template easier to use with changelog URL. Pull Request resolved: https://github.com/facebook/react-native/pull/28516 Reviewed By: fkgozali Differential Revision: D20842238 Pulled By: hramos fbshipit-source-id: 3fef7a994f36a996bbbc52556600d468a56210a9 * Upgrade tests to Xcode 11.3.1 (#28498) Summary: Upgrade Sandcastle and Circle CI tests to use Xcode 11.3.1 across the board. Pull Request resolved: https://github.com/facebook/react-native/pull/28498 Pull Request resolved: https://github.com/facebook/react-native/pull/28501 Changelog: [Internal] - Use Xcode 11.3.1 in iOS tests Reviewed By: fkgozali Differential Revision: D20821844 fbshipit-source-id: b250ca82bdf2c9fb7faa765d3e2433eb46efd692 * Fixes iOS reload through metro "r" command key (#28477) Summary: This allows the iOS device to be reloaded through the metro command line, besides the fact that whenever packagerServerHost is called, it will only get the IP address once when debugging. ## Changelog [iOS] [Fixed] - Fixed connection of metro reload command to iOS device Pull Request resolved: https://github.com/facebook/react-native/pull/28477 Test Plan: - Build any react-native project in debug mode to an iOS device connected through USB - Press the “r” key on the terminal that is running metro - The device should now reload the project Reviewed By: cpojer Differential Revision: D20818462 Pulled By: TheSavior fbshipit-source-id: 6d9792447d205223dad8fbd955518885427cbba8 * Create method queues for NativeModules that neither provide nor request one Summary: ## Problem: Let `A` be the set of all ObjC NativeModules that neither provide nor reqeust a method queue. The TurboModule system dispatches all method calls to NativeModules in `A` synchronously to the JS thread. Here is the relevant logic: **RCTTurboModule.mm:** Link: https://fburl.com/diffusion/nz9gqje8 ``` jsi::Value performMethodInvocation( // ... ) { // ... dispatch_queue_t methodQueue = NULL; if ([instance_ conformsToProtocol:protocol(RCTBridgeModule)] && [instance_ respondsToSelector:selector(methodQueue)]) { methodQueue = [instance_ performSelector:selector(methodQueue)]; } if (methodQueue == NULL || methodQueue == RCTJSThread) { // This is the default mode of execution: on JS thread. block(); } else if (methodQueue == dispatch_get_main_queue()) { ``` **Why does this end up happening?** 1. NativeModules that request a method queue have `synthesize methodQueue = _methodQueue` in their `implementation` section. This generates a `methodQueue` getter for the NativeModule, and also creates an ivar to back that getter. The TurboModule system generates a `dispatch_queue_t` and uses ObjC's KVC API to write to the ivar. So in the above logic, for NativeModules that provide a method queue, methodQueue will neither be `NULL` nor `RCTJSThread`, so we don't dispatch synchronously to the JS thread. 2. NativeModules that provide a method queue will return something that is not `NULL` or something that is `RCTJSThread`. If they return `NULL`, the infra will throw an error early. If they return `RCTJSThread`, we'll dispatch synchronously to the JS thread, as we should (...wait. For async NativeModule methods that dispatch to `RCTJSThread`, should we dispatch asynchronously to the JS thread, via jsInvoker? **Edit:** Nope: https://fburl.com/diffusion/ivt9b40s.). In all other cases, we dispatch to appropriately to the respective method queue. 3. For NativeModules that neither provide nor request a method queue (i.e: NativeModules in `A`), they don't implement the `methodQueue` selector. Therefore, we dispatch synchronously to the JS thread. ## The fix (Part 1): The first step towards fixing this problem is to generate `dispatch_queue_t`s for NativeModules in `A`. That's what this diff accomplishes. Changelog: [iOS][Fixed] - Create method queue for NativeModules that don't provide nor request one. Reviewed By: fkgozali Differential Revision: D20821054 fbshipit-source-id: 17a73550ad96766c5c7e719e28e1cc879e36465c * Rename duplicate name `<ScrollView>` example on RNTester (#28515) Summary: Tiny change. When searching for `scro` in the RNTester, two `<ScrollView>`s come up, from different example files. One is the "simple" one and the other is the "regular" one. Before: <img width="370" alt="Screen Shot 2020-04-03 at 17 14 01" src="https://user-images.githubusercontent.com/100233/78377338-c6ab0c00-75cf-11ea-9c45-2dcdd6460f6d.png"> After: <img width="369" alt="Screen Shot 2020-04-03 at 17 13 38" src="https://user-images.githubusercontent.com/100233/78377371-cf034700-75cf-11ea-89ea-aa3ff2f3988c.png"> ## Changelog [Internal] [Changed] - Rename the "simple" ScrollView example in RNTester to "ScrollSimpleView". Pull Request resolved: https://github.com/facebook/react-native/pull/28515 Test Plan: - Try to search for `scro` in RNTester. Reviewed By: fkgozali Differential Revision: D20842264 Pulled By: hramos fbshipit-source-id: 3db54a826ae774108e62690e7f154e85b541520f * Fix Fabric SSTs, so they actually run in Fabric instead of Paper, convert ServerSnapshotTestsAppImpl to functional component Summary: Update instrumentation test infra for Fabric tests. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D19961919 fbshipit-source-id: 17264b6308712dddece730effd57832817e148cf * Fixed scrollview inset when RN view is embedded in another view (#27607) Summary: I'm using RNN, which embeds RN view inside native view controllers. On iOS 13, a modal view controller is "floating" and is offset from the top of the screen. This causes the calculation of inset in `KeyboardAvoidingView` incorrect as it mixes local view controller coordinate space, with keyboard's screen coordinate space. ## Changelog [iOS] [Fixed] - Fixed `KeyboardAvoidingView` inset in embedded views (i.e modal view controllers on iOS 13) Pull Request resolved: https://github.com/facebook/react-native/pull/27607 Test Plan: 1. Tested before and after in a simple view controller (should stay the same) 2. Tested before and after in a modal view controller (should be offset before, and fixed after) 3. Repeated no. 2 with each device rotation (upsideDown, landscapeLeft, landscapeRight) Reviewed By: cpojer Differential Revision: D20812231 Pulled By: TheSavior fbshipit-source-id: fbd72739fb7152655028730e284ad26ff4a5da73 * Bump react-native-codegen to 0.0.2 Summary: Changelog: [Internal] Reviewed By: cpojer Differential Revision: D20843514 fbshipit-source-id: c611bf91d311c6ce8a7e469d267a0417b2ee58e5 * Rename ScrollViewSimpleExample Summary: Changelog: [Internal] - Rename ScrollViewSimpleExample in RNTester Reviewed By: fkgozali Differential Revision: D20846977 fbshipit-source-id: 397589cb0a17beaf37a25b91ad8efa4a2bc62358 * Remove console warnings for innerViewNode/Ref Summary: Remove these warnings until the methods in ScrollResponder have been moved into ScrollView, so that unactionable warnings aren't firing. Changelog: [General][Removed] Remove console warnings for innerViewNode/Ref in ScrollView Reviewed By: TheSavior Differential Revision: D20850624 fbshipit-source-id: ce90988e204c3cc3b93536842ec3caa12cf6994e * Make TurboModules dispatch method calls via native CallInvoker Summary: This diff: 1. Has ObjC NativeModules use the native `CallInvoker` to invoke JS -> native sync/async calls. 2. Integrates the native `CallInvoker` for each ObjC NativeModule with the bridge. This way, the bridge is informed of all JS -> native TurboModule method calls, and dispatches `onBatchComplete` appropriately. Changelog: [iOS][Fixed] Integrate ObjC TurboModules async method calls with the bridge Reviewed By: fkgozali Differential Revision: D20831545 fbshipit-source-id: da1cbb4ecef4cae85841ca7ef625ab8e380760cd * add ripple config object to Pressable (#28156) Summary: Motivation is to support ripple radius just like in TouchableNativeFeedback, plus borderless attribute. See https://github.com/facebook/react-native/pull/28009#issuecomment-589489520 In the current form this means user needs to pass an `android_ripple` prop which is an object of this shape: ``` export type RippleConfig = {| color?: ?ColorValue, borderless?: ?boolean, radius?: ?number, |}; ``` Do we want to add methods that would create such config objects - https://facebook.github.io/react-native/docs/touchablenativefeedback#methods ? ## Changelog [Android] [Added] - support borderless and custom ripple radius on Pressable Pull Request resolved: https://github.com/facebook/react-native/pull/28156 Test Plan: Tested locally in RNTester. I noticed that when some content is rendered after the touchables, the ripple effect is "cut off" by the boundaries of the next view. This is not specific to Pressable, it happens to TouchableNativeFeedback too but I just didn't notice it before in https://github.com/facebook/react-native/pull/28009. As it is an issue of its own, I didn't investigate that. ![pressable](https://user-images.githubusercontent.com/1566403/75098762-785f2200-55ba-11ea-8842-e648317610e3.gif) I changed the Touchable example slightly too (I just moved the "custom ripple radius" up to show the "cutting off" issue), so just for completeness: ![touchable](https://user-images.githubusercontent.com/1566403/75098763-81e88a00-55ba-11ea-9528-e0343d1e054b.gif) Reviewed By: yungsters Differential Revision: D20071021 Pulled By: TheSavior fbshipit-source-id: cb553030934205a52dd50a2a8c8a20da6100e23f * Make TurboModule creation thread-safe Summary: NativeModules can be created from any number of threads. In the legacy system, `ModuleHolder`, the class responsible for creating NativeModules, has built-in concurrency control to ensure that NativeModule creation is thread-safe. This diff introduces that thread-safety to the TurboModule infra. Basically, after this diff, if `n` threads race to create a TurboModule x, only the first thread will create x. All other threads will wait until x is created. Changelog: [Android][Fixed] - Make TurboModule creation thread-safe Reviewed By: mdvacca Differential Revision: D20659799 fbshipit-source-id: 2b720fe1ea49e40ae0d6dae50d422f23a6f45520 * Remove unused fields from error dialog Summary: Removed in https://github.com/facebook/react/pull/18487 Changelog: [React Core] Logging changes Reviewed By: gaearon Differential Revision: D20853086 fbshipit-source-id: 4b0002f21269f415769a2ac8305ba5750245f7d1 * Fix crash when enabling Performance Monitor on iOS 13.4 (#28512) Summary: This PR fixes a crash when opening the Performance Monitor on iOS 13.4. Detailed info: https://github.com/facebook/react-native/issues/28414 ## Changelog `[iOS] [Fixed] - Fix crash when enabling Performance Monitor on iOS 13.4` ## How This PR prevents the JavaScriptCore option from being set altogether. This ensures that the performance monitor keeps working, but on iOS 13.4 and higher, it will no longer crash trying to show the GC usage. Pull Request resolved: https://github.com/facebook/react-native/pull/28512 Test Plan: Tested on iOS 13.4 (simulator): ![image](https://user-images.githubusercontent.com/6184593/77903803-c6370c00-7283-11ea-8b71-b6b6546c82f6.png) Tested on iOS 13.1 (simulator) ![image](https://user-images.githubusercontent.com/6184593/77903499-41e48900-7283-11ea-9d14-83f67a3b7b77.png) - Verified that the `setOption` was called, but the Performance Monitor didn't show any GC usage regardless. - Identical PR https://github.com/expo/react-native/pull/21 has been shipped and tested in Expo Client 37 Fixes https://github.com/facebook/react-native/issues/28414 Reviewed By: PeteTheHeat Differential Revision: D20851131 Pulled By: TheSavior fbshipit-source-id: ff96301036e8487db59f95947bbe6841fe230e1e * Modify warning message (#28514) Summary: Modify deprecation warning message for `AccessibilityInfo.fetch` - https://reactnative.dev/docs/accessibilityinfo#isscreenreaderenabled - https://github.com/facebook/react-native/commit/523ab8333800afbfb169c6fd70ab6611fe07cc2a ## Changelog [Internal] [Changed] - Modify deprecation warning message for `AccessibilityInfo.fetch` Pull Request resolved: https://github.com/facebook/react-native/pull/28514 Test Plan: Try using `AccessibilityInfo.fetch` and check log Reviewed By: cpojer Differential Revision: D20850223 Pulled By: TheSavior fbshipit-source-id: e21bb20b7a02d9f2ed6e27e2bfecbac0aebf9e09 * Set _borderLayer.frame when border changes Summary: Changelog: [Internal] Setting `_borderLayer.frame` inside `-[RCTViewComponentView layoutSubviews]` causes unwanted animation because it is not wrapped in `CATransaction`. Moving it to `-[RCTViewComponentView updateLayoutMetrics]` which is called inside `CATransaction`. Reviewed By: shergin Differential Revision: D20836890 fbshipit-source-id: 2048a25fd2edb8109f6275c1186c0adae4b9f504 * Add API for getting sourceURL directly from ReactContext Summary: In bridgeless mode, the CatalystInstance doesn't exist, but we still need to be able to access the sourceURL in SourceCodeModule (which is needed to render the images in LogBox warnings and errors). This diff adds a new API for getting the sourceURL directly from ReactContext, instead of having to call context.getCatalystInstance().getSourceURL(), and updates SourceCodeModule to use it. Changelog: [Internal] Reviewed By: RSNara Differential Revision: D20848700 fbshipit-source-id: 3ecda81a17121178b76bbb3e9b0f27f103c1961a * imp: Remove unused `npx` reference (#28544) Summary: Recently we removed `npx` usage from `react-native-cli` flow. After checking usages in this repo I found unused reference. ## 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] [Removed] - Remove unused `npx` reference Pull Request resolved: https://github.com/facebook/react-native/pull/28544 Test Plan: Tests pass Reviewed By: cpojer Differential Revision: D20873090 Pulled By: hramos fbshipit-source-id: 12e05e9635a83f19439024766817e4599320af98 * Add debug logs to track down T62192299 exception source Summary: Add debug logs to track down T62192299 exception source Changelog: [Internal] Reviewed By: RSNara Differential Revision: D20878063 fbshipit-source-id: 94acd56c45d4b529a695d1b4d2bfd10d8f725e63 * Back out "Fixed scrollview inset when RN view is embedded in another view" Summary: Original commit changeset: fbd72739fb71 Changelog: Back out "[react-native][PR] Fixed scrollview inset when RN view is embedded in another view" Reviewed By: TheSavior Differential Revision: D20878607 fbshipit-source-id: 0d77b9fb08c637f7894c399a219a242e472b0700 * Fail silently in AppStateModule.sendEvent if CatalystInstance is not available Summary: According to our logs, 80% of these warnings are coming from AppStateModule. It's not particularly interesting or surprising that the CatalystInstance would be torn down when there's some app event, so let's stop taking up DB space with a useless message. Reviewed By: ejanzer, mdvacca Differential Revision: D20879426 fbshipit-source-id: b1182461aed4a66d82cb34bbd4b12782af6ed7b3 * Move DebugEnvironment helper to open source Summary: This is an internal only module that we use to detect whether we are in async debugging mode. Changelog: [Internal] Reviewed By: yungsters Differential Revision: D20879780 fbshipit-source-id: 5915f4e1c54a3fda0cf607c77f463120264fdbc4 * Fix Appearance module when using Chrome Debugger Summary: The appearance module uses sync native module methods which doesn't work with the chrome debugger. This broke in 0.62: https://github.com/facebook/react-native/issues/26705 This fix makes the appearance module return 'light' when using the chrome debugger. Changelog: [Fixed] Appearance `getColorScheme` no longer breaks the debugger Reviewed By: yungsters Differential Revision: D20879779 fbshipit-source-id: ad49c66226096433bc9f270e004ad4a6f54fa8c2 * Extend Android ImageViewManager to support analyticsTag prop Summary: This diff extends the Android Image View manager to support the new analyticsTag prop. this prop is going to be used to track performance for images in android changelog: [Android][Added] Add analyticsTag prop into ImageView component Reviewed By: JoshuaGross Differential Revision: D20880602 fbshipit-source-id: e302e8fa83706e6517b228d44a3094a1686830f7 * Extend Image.android to support analyticsTag prop Summary: Quick diff to extend Image.android component to support analytics tag prop changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D20880601 fbshipit-source-id: 99bc11f36ce46953c00480f7c8d628cf6c0a9263 * Create ImageContext object to allow udpating the analyticsTag prop for RN sections Summary: As part of this diff I create the new ImageContext object that will be used to allow the update of the analyticsTag prop for components that contain multiple images in their view hierarchy changelog: [JS][Added] Add ImageContext object, this object can be used to update the Imageview's analyticsTag prop on RN components that contain multiple images in their view hierarchy Reviewed By: JoshuaGross Differential Revision: D20880603 fbshipit-source-id: f2094bfd3ab1c867cf7c107e678a098aab7e94a8 * Ez cleanup in ImageProps Summary: Ez cleanup in ImageProps, this import is not being used anymore changelog: [internal] internal change Reviewed By: JoshuaGross Differential Revision: D20880600 fbshipit-source-id: 7d903b5a6e16c37e61dec661b6bd1f9a6b442cc3 * Exclude all FlipperKit transitive dependencies from iOS Release builds (#28504) Summary: The `:configuration` option from `pod` only affects the specified pod and not its dependencies [1]. Therefore in order to avoid all transitive dependencies being linked in the resulting Release IPA we need to list them in the `Podfile`. Note that this will still build Flipper's pods when doing a Release, but it won't link it in the resulting IPA. [1] https://guides.cocoapods.org/syntax/podfile.html#pod Fixes https://github.com/react-native-community/upgrade-support/issues/28 Related https://github.com/CocoaPods/CocoaPods/issues/9658 ## Changelog * [iOS] [Fixed] - Exclude Flipper from iOS Release builds Pull Request resolved: https://github.com/facebook/react-native/pull/28504 Test Plan: Create a new React Native 0.62 project, run `pod install`, then diff: ``` ProjectName/ios/Pods/Target Support Files/Pods-ProjectName/Pods-ProjectName.debug.xcconfig` ``` and ``` ProjectName/ios/Pods/Target Support Files/Pods-ProjectName/Pods-ProjectName.relaese.xcconfig ``` ![image](https://user-images.githubusercontent.com/855995/78337679-a3fa0280-7591-11ea-8142-6f82cbc6be58.png) Reviewed By: passy Differential Revision: D20894406 Pulled By: priteshrnandgaonkar fbshipit-source-id: 680780f0f5a85fd8423b85a271a499bd12f06d00 * Fix crash in FabricUIManager.onMeasure Summary: Changelog: [Internal] The cause of crash was `NullPointerException`, which happened because of `mReactContextForRootTag.get(rootTag)` returning `null`. This is solved by checking whether it returns `null` before passing it to `I18nUtil`. Reviewed By: mdvacca Differential Revision: D20890623 fbshipit-source-id: c884c6838b83b944a5438375a4c060c1f5b1dc6e * Fix flow types of ImageContext Summary: ez diff to Fix flow types of ImageContext changelog: [internal] internal change to update flow types of ImageContext Reviewed By: TheSavior Differential Revision: D20883647 fbshipit-source-id: 6dba83ab431e56a71f96c39005ebcccf39a7da9a * Avoid passing analyticsTag prop to native if this is set to null Summary: This diff avoids passing the analyticsTag prop to native if this is set to null changelog: [internal] internal optimization Reviewed By: TheSavior Differential Revision: D20904498 fbshipit-source-id: f1ea1e5aa3199ef073668df86ca7cf6e20f70c5b * Rename analyticsTag -> internal_analyticsTag in ImageView component Summary: This diff renames the analyticsTag prop for the intenral_analyticsTag in ImageView component changelog: [internal] Creation of internal_analyticTag prop in ImageView, for now this prop is meant to be used internally. Reviewed By: TheSavior Differential Revision: D20904497 fbshipit-source-id: 2a28f746772ee0f9d657ec71549020c1f3e9d674 * Make Vibration.vibrate compatible with TurboModules (#27951) Summary: This PR fixes a compatibility issue with the Vibration module and TurboModules. The TurboModules spec doesn't allow nullable arguments of type Number, causing the following problem: ![IMG_3758](https://user-images.githubusercontent.com/1247834/73803879-10be6f80-4790-11ea-92d4-a008f0007681.PNG) ## Changelog [iOS] [Fixed] - Make Vibration library compatible with TurboModules. Pull Request resolved: https://github.com/facebook/react-native/pull/27951 Test Plan: Just submitted a PR to my own app to fix the issue [here](https://github.com/rainbow-me/rainbow/pull/340) The problem should be reproducible on RNTester due to this line: https://github.com/facebook/react-native/blob/91f139b94118fe8db29728ea8ad855fc4a13f743/RNTester/js/examples/Vibration/VibrationExample.js#L66 and should be working on this branch. Reviewed By: TheSavior Differential Revision: D19761064 Pulled By: hramos fbshipit-source-id: 84f6b62a2734cc09d450e906b5866d4e9ce61124 * Fix Cocoapods builds Summary: ## Problem For some reason, D20831545 broke the `use_frameworks!` build of RNTester. ## Building RNTester ``` pushd ~/fbsource/xplat/js/react-native-github/RNTester && USE_FRAMEWORKS=1 pod install && open RNTesterPods.xcworkspace && popd; ``` ## Error I built RNTester locally, and the error was this: ``` Undefined symbols for architecture x86_64: "facebook::jsi::HostObject::set(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&, facebook::jsi::Value const&)", referenced from: vtable for facebook::react::ObjCTurboModule in RCTImageEditingManager.o vtable for facebook::react::ObjCTurboModule in RCTImageLoader.o vtable for facebook::react::ObjCTurboModule in RCTImageStoreManager.o "facebook::jsi::HostObject::getPropertyNames(facebook::jsi::Runtime&)", referenced from: vtable for facebook::react::ObjCTurboModule in RCTImageEditingManager.o vtable for facebook::react::ObjCTurboModule in RCTImageLoader.o vtable for facebook::react::ObjCTurboModule in RCTImageStoreManager.o ld: symbol(s) not found for architecture x86_64 ``` ## Fix It looked like libraries that depend on "ReactCommon/turbomodule/core" weren't linking to JSI correctly. So, I modified all such Podspecs to also depend on "React-jsi": ``` arc rfr ' s.dependency "ReactCommon/turbomodule/core", version' ' s.dependency "ReactCommon/turbomodule/core", version\n s.dependency "React-jsi", version' ``` This seemed to do the trick. In buck, we'd fix this problem using exported_dependencies. I skimmed through cocoapods, and couldn't find such a configuration option there. So, I guess this will have to do? Changelog: [iOS][Fixed] - Fix Cocoapods builds of RNTester Reviewed By: fkgozali, hramos Differential Revision: D20905465 fbshipit-source-id: 60218c8274ec165752a428f2a7a9a546607c8fec * Add minimumSize to RCTRootView & RCTRootShadowView Summary: This adds a `minimumSize` property to RCTRootView, and forwards any changes to it's shadow view. This **does not** change any default behaviour, as the default minimum size is `CGSizeZero` before & after this diff. Changelog: [iOS][Internal] Add minimumSize to RCTRootView & RCTRootShadowView Reviewed By: RSNara Differential Revision: D20905456 fbshipit-source-id: a03f880e782891f60ef86b9c898965e05a5e796e * Make RCTNativeAnimatedModule into a TurboModule Summary: D20831545 integrated TurboModules with the bridge's `onBatchComplete` event. This fixed the RCTNativeAnimatedModule jank, so I'm re-converting RCTNativeAnimatedModule into a TurboModule. Changelog: [iOS][Fixed] - Make RCTNativeAnimatedModule TM-compatible Reviewed By: PeteTheHeat Differential Revision: D20850744 fbshipit-source-id: bb85a1bb27963e7d39bf149d0a3d7b71c88175da * upgrade to flow 0.122.0 Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D20919782 fbshipit-source-id: 3d5dc54ea4daafb8a1d96cad6c35a2dab4c24097 * Switch order of onSelectionChange and onChange events send from native Summary: Changelog: [Internal] UIKit uses either `UITextField` or `UITextView` as its UIKit element for `<TextInput>`. `UITextField` is for single line entry, `UITextView` is for multiline entry. There is a problem with order of events when user types a character. In `UITextField` (single line text entry), typing a character first triggers `onChange` event and then `onSelectionChange`. JavaScript depends on this order of events because it uses `mostRecentEventCount` from this even to communicate to native that it is in sync with changes in native. In `UITextView` (multi line text entry), typing a character first triggers `onSelectionChange` and then `onChange`. As JS depends on the correct order of events, this can cause issues. An example would be a TextInput which changes contents based as a result of `onSelectionChange`. Those changes would be ignored as native will throw them away because JavaScript doesn't have the newest version. Reviewed By: JoshuaGross Differential Revision: D20836195 fbshipit-source-id: fbae3b6c0d388fc059ca2541ae980073b8e5f6c7 * Maintain selection and cursor location when setting string on TextInput Summary: Changelog: [Internal] Calling `_backedTextInputView.attributedText = attributedString` causes cursor to be moved to the end of text input. This applies to both, `UITextField` and `UITextView`. This is not desired as when JS sets a new text, we don't want the cursor to be moved to the end of text input. JS has the option to use view commands if it wishes to move cursor somewhere. Reviewed By: JoshuaGross Differential Revision: D20836201 fbshipit-source-id: 9234e54cfbc5fc206f723626988e505275788aae * Implement event count for TextInput Summary: Changelog: [Internal] Implementation of event count for Fabric's Text input. Reviewed By: JoshuaGross Differential Revision: D20800185 fbshipit-source-id: 988692cb2fc786649821cccb06e629b40b9b0479 * Migrate setNativeProps to commands in iOS text input Summary: Changelog: Move from setNativeProps to ViewCommands. Reviewed By: JoshuaGross Differential Revision: D20843018 fbshipit-source-id: 9be9d2bbee01f2e15279e3c3ae785c1a5b163765 * Update default Podfile to not depend on a path (#28572) Summary: Recently, a default Podfile has been modified to not contain all the React Native pods, but use a helper method `use_react_native!`. While this is great, it assumes a hardcoded path of `../node_modules/react-native` to be always the correct location of the React Native. https://github.com/facebook/react-native/blob/d4d8887b5018782eeb3f26efa85125e6bbff73e4/scripts/autolink-ios.rb#L7-L9 Unfortunately, due to the way Ruby works, this completely hides the path away from the users. Before, they could have seen the wrong path explicitly in a Podfile and knew to update it to resolve path-related issues. With the current version in `master`, I can see a lot of issues where developers wonder how to resolve the path issues and how to pass the path itself. https://github.com/facebook/react-native/blob/4118d798265341061105f3a53550db83c66a71cb/template/ios/Podfile#L5-L10 This PR uses React Native CLI configuration (that is already used to link 3rd party dependencies) to explicitly define the correct path to the React Native. As a result, we don't have to change the paths here whether we're running monorepo or not. ## Changelog [IOS] [INTERNAL] - Always provide an explicit path to React Native Pull Request resolved: https://github.com/facebook/react-native/pull/28572 Differential Revision: D20945194 Pulled By: TheSavior fbshipit-source-id: 010f9754f2ed78ef62fd52f4d201f296f5af6d27 * chore: update CLI * fix: do not throw on missing `cliPath`, use the default value (#28625) Summary: The `cliPath` has always been optional value and in fact, even had its default value hardcoded in the React gradle file. In this PR, I am just taking use of it and remove throwing an error, which is going to be a really annoying breaking change. ## Changelog [ANDROID] [INTERNAL] - Don't require `cliPath` Pull Request resolved: https://github.com/facebook/react-native/pull/28625 Test Plan: Run Android project, everything works. Provide custom `cliPath`, it gets respected Reviewed By: cpojer Differential Revision: D21044222 Pulled By: TheSavior fbshipit-source-id: 8029f988d92abb9f64f30e05932c0d407d0c997e * chore: remove Kotlin version from the default template * (eslint-config) update community eslint plugin in eslint config (#28642) Summary: Updating the community eslint-plugin used in the eslint-config to the latest version. expecting new eslint-config version to be released with this change so that it can be included in new project template for 0.63 https://github.com/react-native-community/releases/issues/186 ## 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] - Update community eslint plugin in the eslint config Pull Request resolved: https://github.com/facebook/react-native/pull/28642 Test Plan: yarn lint passes Differential Revision: D21048976 Pulled By: cpojer fbshipit-source-id: 2c3ec0ef450cf357d8c88db7873f4ca1154b2034 * [0.63.0-rc.0] Bump version numbers * Upgrade Hermes dependency to 0.5.0 Summary: Use the latest published release of hermes-engine. Update RN to invoke `hermesc` instead of `hermes`. Changelog: [Android] [Changed] - Upgraded to Hermes 0.5.0 allow-large-files Reviewed By: mhorowitz Differential Revision: D20998564 fbshipit-source-id: 4824e273bcb044029a5a7e9379f168d3da47da50 * Remove the post install step (#28651) Summary: Removes the post install step for Flipper, as the latest version of YogaKit is compatible with swift 5. cc alloy ## 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 --> [Flipper] [Template] - Remove the post install step for Flipper Pull Request resolved: https://github.com/facebook/react-native/pull/28651 Test Plan: Tested a newly created RN app without post install step and it built successfully. Reviewed By: passy Differential Revision: D21064653 Pulled By: priteshrnandgaonkar fbshipit-source-id: da56d0754d918e30a0ebe480c77590f0139d48ac * Allow iOS PlatformColor strings to be ObjC or Swift UIColor selectors (#28703) Summary: Per discussion in https://github.com/react-native-community/releases/issues/186 the iOS `PlatformColor()` function is documented to use the semantic color names provided by the system. The referenced HIG documentation itself links to the `UIColor` documentation for semantic colors names. However, these names differ depending on if you are viewing the new Swift API docs or the Objective C docs. The current Objective C implementation in react-native assumes Objective C UIColor selector names that are suffixed 'Color'. But in Swift, Apple provides a Swift Extension on UIColor that makes aliases without the the 'Color' suffix and then makes the original selectors invalid presumably via `NS_UNAVAILABLE_SWIFT`. Since both selector names are valid depending on if you are using Objective C or Swift, let's make both forms be legal for `PlatformColor()`. In `RCTConvert.m` there is a dictionary of legal selector names. The code already supports the ability to have names be aliases of other selectors via a RCTSelector metadata key. The change adds code to the initialization of the map: it iterates over the keys in the map, which are all ObjC style UIColor selectors, and creates aliases by duplicating the entries, creating key names by stripping off the ObjC "Color" suffix, adds the RCTSelector key referring to the original and then appends these new Swift aliases to the map. ## Changelog [iOS] [Changed] - Allow iOS PlatformColor strings to be ObjC or Swift UIColor selectors Pull Request resolved: https://github.com/facebook/react-native/pull/28703 Test Plan: The PlatformColorExample.js is updated to use the new, shorter Swift selector names. There are still other examples in the same file and in unit tests that exercise the ObjC selector names. <img width="492" alt="PlatformColor" src="https://user-images.githubusercontent.com/30053638/79809089-89ab7d00-8324-11ea-8a9d-120b92edeedf.png"> Reviewed By: shergin Differential Revision: D21147404 Pulled By: TheSavior fbshipit-source-id: 0273ec855e426b3a7ba97a87645859e05bcd4126 * Fix folly::dynamic crash when attaching a debugger to Hermes Summary: folly_futures was compiled with and exported -DFOLLY_MOBILE=1, while folly_json did not. This flag disables fancy F14 data structures for folly::dynamic in favor of a simple std::unordered_map. This caused inlined/templated code from modules depending on folly_futures to disagree with the implementations in folly_json, leading to a crash. The only such libraries were libhermes-inspector and (transitively) libhermes-executor-debug, and these only use folly::dynamic for CDP serialization, which is why the problem was not more apparent. Changelog: [Internal] Fix crash when attaching a Hermes debugger Reviewed By: mhorowitz Differential Revision: D21193307 fbshipit-source-id: 2b795bb6f4f7f991e2adaacec62d62616117322b * Update react.gradle (#28776) Summary: Running `./gradlew assembleRelease` fails as the path to the CLI contains a new line at the end. We don't run this command in `debug` mode, hence it passed the testing. My bad. Fixed, checked in both `debug` with `bundleInDebug: true` and `release`. Fixes https://github.com/facebook/react-native/issues/28700 ## Changelog [INTERNAL] [ANDROID] - Fix `React.gradle` to build Android apps in production Pull Request resolved: https://github.com/facebook/react-native/pull/28776 Test Plan: Running `./gradlew assembleRelease` works Reviewed By: hramos Differential Revision: D21287789 Pulled By: TheSavior fbshipit-source-id: dc3ec8eef7a919b072b562d2bd455e2f704bc083 * Revert D21064653: Remove the post install step Differential Revision: D21064653 Original commit changeset: da56d0754d91 fbshipit-source-id: 1086cfdeca9aa3830370ea115ba7b5f05d3fb124 * Bump @react-native-community/eslint-config in new app template Summary: Changelog: [Changed][General] Update react-native-community/eslint-config to 1.1.0, adding the new color rule Reviewed By: rickhanlonii Differential Revision: D21342153 fbshipit-source-id: ac1367353d4d3e69b6df29dc16f9fcb60cde3519 * [0.63.0-rc.1] Bump version numbers * Upgrade Flipper to 0.37.0 (#28545) Summary: Bump flipper to 0.37 for both iOS and Android [Android] [Changed] - Upgrade Flipper to 0.37.0 [iOS] [Changed] - Upgrade Flipper to 0.37.0 Pull Request resolved: https://github.com/facebook/react-native/pull/28545 Test Plan: RNTester build pass Reviewed By: rickhanlonii Differential Revision: D20930069 Pulled By: hramos fbshipit-source-id: a7cb719da3e51e6a42d27d5e64bc664398d0d3c5 * Enable with CocoaPods `:configuration` (#28796) Summary: ~~⚠️ Depends on https://github.com/facebook/flipper/pull/1086 and a new Flipper release.~~ Fixes https://github.com/facebook/react-native/commit/17f025bc26da13da795845a3f7daee65563420c0#commitcomment-38831234 Currently user’s are being told to add a definition of the `FB_SONARKIT_ENABLED` macro and examples, including those in stock React Native templates, set this for the user by making use of a `post_install` hook in the user’s `Podfile`. This leads to confusion, fragile code [when a user’s project dir structure deviates from vanilla], and is ultimately not necessary as CocoaPods already has dedicated mechanisms to: * specify build settings (through the `xcconfig` property); * and selectively include certain pods only in certain build configurations (e.g. debug). ## 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] [Changed] - Entirely control Flipper being enabled through inclusion in Podfile and optionally limiting to certain build configurations using the `:configuration` directive. Pull Request resolved: https://github.com/facebook/react-native/pull/28796 Test Plan: Tested using the changes of https://github.com/facebook/flipper/pull/1086 in a new app that uses RN `master`. Reviewed By: priteshrnandgaonkar Differential Revision: D21449754 Pulled By: passy fbshipit-source-id: 9ff7c7f4ffc32b364b1edd82b94e0b80c3997625 * Pressable: Rename pressRectOffset to pressRetentionOffset to be consistent with other touchables Summary: Text and the other Touchables have this prop called pressRetentionOffset. Pressable should be consistent with that. Changelog: [Breaking][General]: Pressable: Rename pressRectOffset to pressRetentionOffset to be consistent with other touchables Reviewed By: yungsters Differential Revision: D21552255 fbshipit-source-id: 31e64bad9e48ac98e4934dd2f4c0a7f526de5cb6 * iOS: Fix Animated image crash when CADisplayLink target in RCTWeakProxy is nil Summary: When self is nil, this may crash in RCTUIImageViewAnimated.m. ``` _displayLink = [CADisplayLink displayLinkWithTarget:[RCTWeakProxy weakProxyWithTarget:self] selector:selector(displayDidRefresh:)]; ``` Replace `RCTWeakProxy` with a concrete class `RCTDisplayWeakRefreshable` that has the displayDidRefresh method, that calls the displayDidRefresh method in its weak target. https://github.com/facebook/react-native/pull/28070#issuecomment-619295254 Changelog: [iOS] [Fixed] - Fix Animated image crash when CADisplayLink target in RCTWeakProxy is nil Reviewed By: shergin Differential Revision: D21419385 fbshipit-source-id: da7c3c38f81ea54f633da7f59359e07680ea2faf * Pressable: Add Support for Inspector Overlay Summary: Adds support for the debug overlay (enabled via the Inspector) that the legacy touchable components supported. Changelog: [General][Added] - Added Inspector overlay support for Pressable Reviewed By: TheSavior Differential Revision: D21614412 fbshipit-source-id: b884e04f8dba1bfd35e61de25d33d6d47bc34b03 * Changed iOS LaunchScreen from xib to storyboard (#28239) Summary: > Starting April 30, 2020, all apps submitted to the App Store must use an Xcode storyboard to provide the app’s launch screen and all iPhone apps must support all iPhone screens. Updated iOS Launch screen as per [App Store policy change](https://developer.apple.com/news/?id=03042020b). Community discussion: https://github.com/react-native-community/discussions-and-proposals/issues/209 ## Changelog Changed iOS Launch Screen from a `xib` to `storyboard`. The `LaunchScreen.xib` file has been replaced with `LaunchScreen.storyboard`. Xcode automatically picks up the new Launch Screen no additional change is required. [iOS] [Deleted] - Deleted LaunchScreen.xib [iOS] [Added] - Added LaunchScreen.storyboard Pull Request resolved: https://github.com/facebook/react-native/pull/28239 Test Plan: Build the Xcode project under `template/iOS` and verify that the new launch screen is identical to the previous one. Reviewed By: cpojer Differential Revision: D20408892 Pulled By: hramos fbshipit-source-id: 9c38df58d1304088a23f3d73e0fbd87675804f1a * Fix debugging on android for 0.63 (#29204) Summary: Currently on react native 0.63-rc.0 and 0.63-rc.1 enabling debugging throws an exception. It looks like something may have been missed in unregistering JSDevSupport in this commit c20963e ![crash](https://user-images.githubusercontent.com/14797029/85500252-2acae400-b5b1-11ea-938a-674b55e649b2.gif) This should fix https://github.com/facebook/react-native/issues/28746 and https://github.com/facebook/react-native/issues/29136 ## Changelog [Android] [Fixed] - Fix crash when enabling debug Pull Request resolved: https://github.com/facebook/react-native/pull/29204 Test Plan: To recreate the bug: npx react-native init RN063 --version 0.63.0-rc.1 react-native start react-native run-android Enable debug mode from react native dev menu After this commit, the crash no longer occurs ![non crash](https://user-images.githubusercontent.com/14797029/85500241-269ec680-b5b1-11ea-8cfe-85bfda4dd222.gif) Reviewed By: TheSavior Differential Revision: D22395406 Pulled By: RSNara fbshipit-source-id: 046df77ae1c1de96870fb46f409d59e7d6a68c0d * [0.63.0] Bump version numbers * Add ProGuard rule for hermes (#28571) Summary: This adds a ProGuard for `hermes` rule so it does not have to be added by users manually. https://github.com/facebook/react-native/issues/28270 ## 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 --> [Android] [Added] - ProGuard rule for hermes Pull Request resolved: https://github.com/facebook/react-native/pull/28571 Test Plan: 1. Create a project with/without hermes. 2. Enable proguard. Reviewed By: cpojer Differential Revision: D20947095 Pulled By: hramos fbshipit-source-id: 79b166ad2dd060f20041d9f5cfe2f794c754843d * Fix rounded border drawing when border-radius is smaller than border-width (#28358) Summary: This PR fixes the drawing of the border rounded edges when the border-radius is small than the border-width. The current implementation capped the possible border-radius making it impossible to set smaller border-radii when using thicker borders. After inspection it was found that the rounded-rect calculation is incorrect. ## Changelog `[Android] [Fixed] - Fix rounded border-drawing when border-radius is smaller than border-width` Pull Request resolved: https://github.com/facebook/react-native/pull/28358 Test Plan: **Faulty situation:** As you can see, when the border-radius becomes very low, the border is stuck at a minimum value. Only after setting the border-radius fully to 0 is it again rendered correctly. ![ezgif com-video-to-gif (2)](https://user-images.githubusercontent.com/6184593/77183540-c3435b00-6ace-11ea-950d-29a0ea1757bd.gif) **After the fix:** ![ezgif com-video-to-gif (3)](https://user-images.githubusercontent.com/6184593/77183619-e837ce00-6ace-11ea-93a5-910127d352b7.gif) Differential Revision: D21124739 Pulled By: shergin fbshipit-source-id: cefd1776b77b5b9fb335e95fd7fdd7f345579dc4 * Fix border-stroke drawing after resetting border-radius (#28356) Summary: This PR fixes incorrect drawing of the View borders on Android, after changing the border-radius back to 0 *(and when no background-color is defined)*. This happens because the `drawRoundedBackgroundWithBorders` function in ReactViewBackgroundDrawable changes the style on the Paint object to `STROKE`. This style is however never reverted back to `FILL`. This change ensures that the Paint style is set to `FILL` for the full execution of the `drawRectangularBackgroundWithBorders` function. ## Changelog `[Android] [Fixed] - Fix border-drawing when changing border-radius back to 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28356 Test Plan: **Faulty situation:** ![ezgif com-video-to-gif](https://user-images.githubusercontent.com/6184593/77153163-9759b280-6a99-11ea-82bb-33a1e0a4934c.gif) **After the fix:** ![ezgif com-video-to-gif (1)](https://user-images.githubusercontent.com/6184593/77153825-c91f4900-6a9a-11ea-8e0c-a4280b9e72b8.gif) Differential Revision: D21124741 Pulled By: shergin fbshipit-source-id: 2044f8e8ad59a58df42b64d7ee8c4ad1d3b562f1 * Fixes TextInput shaking when typing Chinese (#28805) Summary: Fixes https://github.com/facebook/react-native/issues/28488. ## Changelog [iOS] [Fixed] - Fixes TextInput shaking when typing Chinese Pull Request resolved: https://github.com/facebook/react-native/pull/28805 Test Plan: Demo see https://github.com/facebook/react-native/issues/28488. Differential Revision: D21376803 Pulled By: shergin fbshipit-source-id: b1fe6cc5f67d42ef98a6c12b8ab9990feac0e2a7 * Set black as default text color for <TextInput/> on iOS (#28708) Summary: This is a follow-up pull request to https://github.com/facebook/react-native/issues/28280 (reviewed by shergin). This pull request tried to solve the problem of the default color in a TextInput in dark mode on iOS being white instead of black. I got suggested to solve the problem not on the level of RCTTextAttributes, but on the level of RCTUITextField. Setting `self.textColor = [UIColor black];` in the constructor did not work, because it gets overwritten by nil in `RCTBaseTextInputView.m`. There I implemented the logic that if NSForegroundColorAttributeName color is nil then the color is being set to black. I think the `defaultTextAttributes` property confuses here, because it ends up being the effective text attributes, e.g. if I unconditionally set the default text color to black, it cannot be changed in React Native anymore. So I put the nil check in. ## Changelog [iOS] [Fixed] - TextInput color has the same default (#000) on iOS whether in light or dark mode Pull Request resolved: https://github.com/facebook/react-native/pull/28708 Test Plan: I have manually tested the following: - The default text color in light mode is black - The default text color in dark mode is black - The color can be changed using the `style.color` attribute - Setting the opacity to 0.5 results in the desired behavior, the whole TextInput becoming half the opacity. – Setting the `style.color` to rgba(0, 0, 0, 0.5) works as intended, creating a half-opaque text color. Differential Revision: D21186579 Pulled By: shergin fbshipit-source-id: ea6405ac6a0243c96677335169b214a2bb9ccc29 * Enable array buffers in JSCRuntime.cpp (#28961) Summary: The JavaScriptCore implementation of JSI [does not currently support array buffers](https://github.com/facebook/react-native/blob/master/ReactCommon/jsi/JSCRuntime.cpp#L925-L943). The comments in the code suggest the JSC version used by React Native does not work with array buffers, but this seems to be out of date since the current version of JSC used by React Native does indeed support array buffers. This change just enables array buffers in JSCRuntime.cpp. NOTE: See https://github.com/react-native-community/discussions-and-proposals/issues/91#issuecomment-632371219 for more background on this change. ## Changelog [General] [Added] - Support for array buffers in the JavaScriptCore implementation of JSI Pull Request resolved: https://github.com/facebook/react-native/pull/28961 Test Plan: To test these changes, I just made some temporary changes to RNTester to use JSI to inject a test function into the JS runtime that reads from and writes to an array buffer, and call that function from the JS of the RNTester app (see https://github.com/ryantrem/react-native/commit/28152ce3f4ae0fa906557415d106399b3f072118). For the JS side of this, specifically look at https://github.com/ryantrem/react-native/blob/28152ce3f4ae0fa906557415d106399b3f072118/RNTester/js/RNTesterApp.android.js#L13-L18 For the native side of this, specifically look at https://github.com/ryantrem/react-native/blob/28152ce3f4ae0fa906557415d106399b3f072118/RNTester/android/app/src/main/cpp/JSITest.cpp#L22-L38 Reviewed By: shergin Differential Revision: D21717995 Pulled By: tmikov fbshipit-source-id: 5788479bb33c24d01aa80fa7f509e0ff9dcefea6 * Fix font variant crash on Android < 4.4 (#29176) Summary: In RN 0.62 support for `fontVariant` was added on Android. Using that prop crashes the app on Android below KitKat (4.3 and below) To reproduce just add any Text with the `fontVariant` styling prop in the app: ```js <Text style={{fontVariant: ['tabular-nums']}}>This will crash</Text> ``` It will crash any device running Android below KitKat with the error: ![image](https://user-images.githubusercontent.com/4534323/85073452-18206b80-b1bb-11ea-8d7e-96f27fa1a320.png) This is caused by `java.utils.Objects` only being available on Android 4.4+ ## Changelog [Android] [Fixed] - Fix font variant crash on Android < 4.4 Pull Request resolved: https://github.com/facebook/react-native/pull/29176 Test Plan: [TextUtils.equals](https://developer.android.com/reference/android/text/TextUtils#equals) was added as soon as API level 1, so no compatibility issue here. Tested on Emulator running Android 4.1, no crash anymore. I've searched for other occurences of `java.utils.Objects` in the project, and this was the only one, so no need to remove other occurences ✅ Reviewed By: JoshuaGross Differential Revision: D22337316 Pulled By: mdvacca fbshipit-source-id: 5507b21b237a725d596d47b5c01e269895b16d4a * Fix LogBox.ignoreAllLogs used with no argument (#29310) Summary: When you call `LogBox.ignoreAllLogs()` it should ignore logs. This fixes a bug that made this equivalent to `LogBox.ignoreAllLogs(false)` ## Changelog [General] [Fixed] - LogBox.ignoreAllLogs() should ignore logs Pull Request resolved: https://github.com/facebook/react-native/pull/29310 Test Plan: Added tests Reviewed By: TheSavior Differential Revision: D22448436 Pulled By: rickhanlonii fbshipit-source-id: 6ba12b9d9c1f29cf3ac503946ac5ca0097425a7a * Pressable: Minimum Press Duration Summary: When a `Pressable` has a configured (or the default) `delayPressIn` and no (or the default) `delayPressOut`, tapping very quickly can lead to intantaneous invocation of `onPressIn` and `onPressOut`. The end result is that users may never experience any intended visual press feedback. This changes `Pressable` to accept (and be preconfigured with a default) **minimum press duration**. The minimum press duration ensures that even if the press is released before `delayPressIn` has elapsed, `onPressOut` will still wait the remaining time up to `minPressDuration` before firing. Note that setting a non-zero `delayPressOut` is insufficient because if a user holds down on a `Pressable` for longer than `delayPressIn`, we still want `onPressOut` to fire immediately when the press is released. Changelog: [General][Changed] - Added `minPressDuration` to `Pressable`. Reviewed By: TheSavior Differential Revision: D21614708 fbshipit-source-id: 502f3d8ad6a40e7762435b6df16809c8798dd92c * chore: bring back script to org shape * [0.63.1] Bump version numbers * Exclude okhttp from flipper dependency (#29260) Summary: This fixes https://github.com/facebook/react-native/issues/28481. As explained in [this comment](https://github.com/facebook/react-native/issues/28481#issuecomment-645546195), the flipper network plugin pulls a more recent version of okhttp (3.14), but only versions of okhttp up to 3.12 works on Android API 21 and less. This prevented being able to run the app in debug mode, it was still working fine in release mode. ## 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 --> [Android] [Fixed] - Fix unable to run in debug mode on Android API < 21 Pull Request resolved: https://github.com/facebook/react-native/pull/29260 Test Plan: Using `yarn react-native run-android` the app would instantly crash with this error in `adb logcat`: ``` E/AndroidRuntime( 5079): java.lang.RuntimeException: Unable to create application com.awesometsproject.MainApplication: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created E/AndroidRuntime( 5079): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4154) E/AndroidRuntime( 5079): at android.app.ActivityThread.access$1300(ActivityThread.java:130) E/AndroidRuntime( 5079): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1255) E/AndroidRuntime( 5079): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 5079): at android.os.Looper.loop(Looper.java:137) E/AndroidRuntime( 5079): at android.app.ActivityThread.main(ActivityThread.java:4745) E/AndroidRuntime( 5079): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 5079): at java.lang.reflect.Method.invoke(Method.java:511) E/AndroidRuntime( 5079): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) E/AndroidRuntime( 5079): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) E/AndroidRuntime( 5079): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 5079): Caused by: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:90) E/AndroidRuntime( 5079): at com.facebook.react.ReactInstanceManager.<init>(ReactInstanceManager.java:238) E/AndroidRuntime( 5079): at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:281) E/AndroidRuntime( 5079): at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:87) E/AndroidRuntime( 5079): at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:39) E/AndroidRuntime( 5079): at com.awesometsproject.MainApplication.onCreate(MainApplication.java:47) E/AndroidRuntime( 5079): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:999) E/AndroidRuntime( 5079): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4151) E/AndroidRuntime( 5079): ... 10 more E/AndroidRuntime( 5079): Caused by: java.lang.reflect.InvocationTargetException E/AndroidRuntime( 5079): at java.lang.reflect.Constructor.constructNative(Native Method) E/AndroidRuntime( 5079): at java.lang.reflect.Constructor.newInstance(Constructor.java:417) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:80) E/AndroidRuntime( 5079): ... 17 more E/AndroidRuntime( 5079): Caused by: java.lang.NoClassDefFoundError: java.util.Objects E/AndroidRuntime( 5079): at okhttp3.CertificatePinner.withCertificateChainCleaner(CertificatePinner.java:231) E/AndroidRuntime( 5079): at okhttp3.OkHttpClient.<init>(OkHttpClient.java:238) E/AndroidRuntime( 5079): at okhttp3.OkHttpClient$Builder.build(OkHttpClient.java:1015) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevServerHelper.<init>(DevServerHelper.java:132) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerImpl.<init>(DevSupportManagerImpl.java:183) E/AndroidRuntime( 5079): ... 20 more W/ActivityManager( 1456): Force finishing activity com.awesometsproject/.MainActivity ``` With this fix, the app launch successfully in debug mode, without having to remove flipper altogether from our config. Reviewed By: passy Differential Revision: D22521109 Pulled By: mdvacca fbshipit-source-id: 3c0263642438bd7c0d09b045e15a933bd8a26734 * Send key when onKeyPress event is fired from TextInput Summary: Changelog: [Internal] In `onKeyPress` event, we were not returning `key` property. This diff adds `key` property to `onKeyPress` event and removes other, redundant properties from `onKeyPress` event. The implementation has been translated from Paper. Reviewed By: shergin Differential Revision: D21250411 fbshipit-source-id: f1e31381667acb9dec02d0b33883df8f8f5b2a4b * Calling Paper TextInput setTextAndSelection view command now dirties layout Summary: Changelog: [Internal] Previously `setTextAndSelection` was not dirtying layout. This would cause an issue where `setTextAndSelection` causes layout change. For example calling setTextAndSelection with empty string on a multiline auto expanding text input. I changed one example in TextInputSharedExamples.js, "Live Re-Write (no spaces allowed) and clear" example is now multiline. This allows to test whether `setTextAndSelection` dirties layout. Enter multiline string to to the example text input and press clear. Observe that the text input shrinks to single line height. Reviewed By: shergin Differential Revision: D21182990 fbshipit-source-id: de8501ea0b97012cf4cdf8d5f658649139f92da6 * Remove setMostRecentEventCount from TextInput view commands Summary: Changelog: [Internal] We don't use view command `setMostRecentEventCount`, let's get rid of it. Reviewed By: JoshuaGross Differential Revision: D21016600 fbshipit-source-id: 6491c063e9d6a89252300cb47c010b248e473f4b * Restore Previous Behavior for StyleSheet Validation of Null/Undefined Styles (#29171) Summary: https://github.com/facebook/react-native/issues/27264 changed stylesheet validation to avoid enumerating properties on the prototype of a style. It introduces a secondary behavior change, where null/undefined styles used to be tolerated but now lead to an exception. This is because `for in undefined` will noop where `for of Object.keys(undefined)` will throw. This scenario of undefined/null styles seems to actually show up in practice and was previously well tolerated. E.g. `Button.js` has code that looks like this: ```jsx const styles = StyleSheet.create({ button: Platform.select({ ios: {}, android: { elevation: 4, // Material design blue from https://material.google.com/style/color.html#color-color-palette backgroundColor: '#2196F3', borderRadius: 2, }, }), ``` For non ios/Android platforms, that creates a style object which looks like: ```js { button: undefined, ... } ``` This previously meant that the component would be unstyled if created, but now means out-of-tree platforms throw if the builtin Button component is required. This change restores the previous `for in` loop but adds a `hasOwnProperty` check to avoid properties on prototypes. ## Changelog [General] [Fixed] - Restore Previous Behavior for StyleSheet Validation of Null/Undefined Styles Pull Request resolved: https://github.com/facebook/react-native/pull/29171 Test Plan: Validated that importing Buttons will no longer cause an exception, and that invalid properties are still caught. Reviewed By: JoshuaGross Differential Revision: D22118379 Pulled By: TheSavior fbshipit-source-id: 650c64b934ccd12a3dc1b75e95debc359925ad73 * Set windowTranslucentNavigation to false (#29399) Summary: This fixes https://github.com/facebook/react-native/issues/29397. Without this, apps that specify `android:windowTranslucentNavigation` draw the `LogBox` buttons underneath the soft navigation bar, making the buttons unpressable. Before | After :-------------------------:|:-------------------------: <img src="http://ashoat.com/AndroidTranslucentNavigationLogBox.png" width="300" /> | <img src="http://ashoat.com/AndroidTranslucentNavigationLogBoxFixed.png" width="300" /> ## Changelog [Android] [Fixed] - Set LogBox windowTranslucentNavigation to false Pull Request resolved: https://github.com/facebook/react-native/pull/29399 Test Plan: I tested this change on the [repo](https://github.com/Ashoat/LogBoxTest) I set up to reproduce the issue. I set it up to [build `ReactAndroid` from source](https://github.com/Ashoat/LogBoxTest/commit/3a2cdab8777ac381cd3be5a84a5bf3250751ac11) and then edited `node_modules/react-native/ReactAndroid/src/main/res/devsupport/values/styles.xml` directly. Reviewed By: rickhanlonii Differential Revision: D22602970 Pulled By: mdvacca fbshipit-source-id: 8c2adc149aa0157825075022f00bb695956d3121 * Fix image cannot show in iOS 14 (#29420) Summary: This PR is to fix https://github.com/facebook/react-native/issues/29279, which image cannot show in iOS 14 As https://github.com/facebook/react-native/issues/29279#issuecomment-658244428 mention, this issue can be fixed by calling ` [super displayLayer:layer];` it it is still image, to let `UIImageView` handle still image rendering ## Changelog [iOS] [Fixed] - Fix image cannot show in iOS 14 Pull Request resolved: https://github.com/facebook/react-native/pull/29420 Test Plan: Image can be shown in iOS 14 build with Xcode 12 beta, using ```js <Image source={require('./images/some_local_image.jpg')}/> ``` It may also need to test gif image is render correctly ```js <Image source={{uri: 'https://some_remote_gif_image.gif'}}/> ``` Reviewed By: p-sun Differential Revision: D22619448 Pulled By: shergin fbshipit-source-id: f4d0ad83af945a6b8099d4eaea5a5f1933c7bfd2 * [0.63.2] Bump version numbers * botched merge changes 1 * more hermes changes needed from upstream, botched merge? * [RCTPicker] Guard UIKit only API on macOS * [RCTSegmentedControl] Make UIKit agnostic * [RCTDisplayWeakRefreshable] Make platform agnostic * [RCTImageLoader] Make platform agnostic * [RCTDevLoadingView] Make platform agnostic * botched merge changes 2 * [RCTPushNotificationManager] Guard for macOS * v0.63 TODO * [RCTBaseTextInputViewManager] Make platform agnostic * [RCTBaseTextInputView] Make platform agnostic * [RNTester-macOS] Fix * [RCT-Folly] Fix build * [PlatformColorValueTypes] Add macOS shim * [package] Update CLI to no longer require config This makes a previous change more explicit: https://github.com/microsoft/react-native-macos/pull/602 * Fix iOS build failures. * Get RNTester to launch * [CODEOWNERS] Add myself * [flow] Remove deprecated rule in newer Flow https://github.com/facebook/flow/commit/759970c1b6dc0a25171d9969e34eaf5dae70f130 * [flow] Get iOS checks green * [PlatformColor] Duplicate iOS code for macOS This is a naive version of this change, there should likely be some code sharing happening between iOS and macOS. * [test] Make green with macOS fork changes * [test] Get macOS test bundle to build * [Color] Rename alternating colors to match to assumptions * [PlatformExample] Fix examples on macOS * [transform] Use iOS implementation for macOS * [circle] Fix config * [ci] Update metro config as per upstream * [ci] Ignore metro config in e2e tests * Revert "[ci] Ignore metro config in e2e tests" This reverts commit 25f7006bc9ba76b1e002b721954a823b3d710c5c. * Revert "[ci] Update metro config as per upstream" This reverts commit b47ca570be00394bbd92b349eab02083787301e7. * [ci] Only disable custom metro config in e2e test * [ci] Ignore metro config in e2e tests * [ci] Switch to experimental CocoaPods CDN * Revert "[ci] Switch to experimental CocoaPods CDN" This reverts commit 44a92f7f08397406429672b14930d44b6aa06b5e. * [ci] Skip Android tests in Apple PR on master * [rnm-init] Fix pod reference * [rnm-init] Update minimum iOS deployment target Co-authored-by: Christoph Nakazawa <cpojer@fb.com> Co-authored-by: Sergio Estevao <sergioestevao@gmail.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: Sam Mathias Weggersen <sawegger@microsoft.com> Co-authored-by: Tommy Nguyen <tonguye@microsoft.com> Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Héctor Ramos <hector@hectorramos.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Sebastian Markbage <sema@fb.com> Co-authored-by: generatedunixname89002005287564 <generatedunixname89002005287564@fb.com> Co-authored-by: Eddie Dugan <ejd@fb.com> Co-authored-by: Valentin Shergin <shergin@fb.com> Co-authored-by: Max Ovtsin <maxovtsin@fb.com> Co-authored-by: Alexander Kawrykow <akawry@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Spencer Ahrens <sahrens@fb.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Jack Wang <shoubowang@fb.com> Co-authored-by: Oleg Bogdanov <boguscoder@fb.com> Co-authored-by: Michael Bolin <mbolin@fb.com> Co-authored-by: Dan Abramov <gaearon@fb.com> Co-authored-by: Peter Argany <petetheheat@fb.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: George Zahariev <gkz@fb.com> Co-authored-by: Jason Safaiyeh <safaiyeh@protonmail.com> Co-authored-by: Pedro Barbiero <pedrobarbiero@gmail.com> Co-authored-by: Brian Vaughn <bvaughn@fb.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Martin Sherburn <mns@fb.com> Co-authored-by: Tom Underhill <tomun@microsoft.com> Co-authored-by: Ventsislav Dimitrov <4097884+vdmtrv@users.noreply.github.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: Lucas Bento <lucas.bsilva@outlook.com> Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com> Co-authored-by: Vojtech Novak <vonovak@gmail.com> Co-authored-by: Emilis Baliukonis <emilisb@wix.com> Co-authored-by: Jacob Bower <jbower@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: Marc Horowitz <mhorowitz@fb.com> Co-authored-by: Sidharth Guglani <sidharthguglani@fb.com> Co-authored-by: Andrew Coates (REDMOND) <acoates@microsoft.com> Co-authored-by: maciej simka <mcj.simka@gmail.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Pavlos Vinieratos <pvinis@gmail.com> Co-authored-by: Cristiano Santos <cristianomnsantos@gmail.com> Co-authored-by: Daniel Cohen Gindi <Danielgindi@gmail.com> Co-authored-by: Eli White <eliwhite@fb.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: jiggag <jiggag90@gmail.com> Co-authored-by: Emily Janzer <janzer@fb.com> Co-authored-by: Kacper Wiszczuk <kacperwiszczuk@gmail.com> Co-authored-by: Xiaoyu Yin <xyin@fb.com> Co-authored-by: Javier Cuevas <javi@diacode.com> Co-authored-by: Bruno Barbieri <brunobar79@gmail.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Will Holen <willholen@fb.com> Co-authored-by: Pritesh Nandgaonkar <prit91@fb.com> Co-authored-by: sunnylqm <sunnylqm@qq.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Tim Yung <yungsters@fb.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: Devon Deonarine <hello@devondeonarine.ca> Co-authored-by: Radek Czemerys <radko93@gmail.com> Co-authored-by: Hein Rutjes <IjzerenHein@users.noreply.github.com> Co-authored-by: zhongwuzw <zhongwuzw@qq.com> Co-authored-by: Jonny Burger <jonathanburger11@gmail.com> Co-authored-by: Ryan Tremblay <ryan.tremblay@microsoft.com> Co-authored-by: almouro <contact@almouro.com> Co-authored-by: Rick Hanlon <rickhanlonii@gmail.com> Co-authored-by: Matthieu Harlé <bonjour@matthieuharle.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Ashoat Tevosyan <ashoat@gmail.com> Co-authored-by: Tom Cheung <cheungch@gmail.com>
2020-09-30 19:38:06 +03:00
get PlatformColor(): PlatformColor {
return require('./Libraries/StyleSheet/PlatformColorValueTypes')
.PlatformColor;
},
get processColor(): processColor {
return require('./Libraries/StyleSheet/processColor');
v0.63 sync from upstream (#613) * Upgrade to Metro 0.59 Summary: Upgrades RN to Metro 0.59. Changelog: [Internal] Metro Upgrade Reviewed By: motiz88 Differential Revision: D20533864 fbshipit-source-id: 3c5fb8e37d2363edf0b9a1a8cfbdefba00763415 * Fix mock for TextInput (#28332) Summary: This PR adds the `isFocused` method to the mock of the TextInput component. My understanding some of the latest changes on the TextInput to make it use a forwardRef change the way this method is mock giving an error when trying to use in on a mock. The change suggested here fixes the issue. ## Changelog [JavaScript] [Fixed] - Fix the mock for TextInput to support the `isFocused` method Pull Request resolved: https://github.com/facebook/react-native/pull/28332 Reviewed By: cpojer Differential Revision: D20538044 Pulled By: TheSavior fbshipit-source-id: be734af105ab62ffdf9ed4017bd70845e207f8cd * Properly handle LogBox errors during tests Summary: This diff fixes an issue where errors in LogBox during tests would cause the tests to crash. The crash is due to the NativeExceptionsManager module not being mocked (as all native module need to be in tests). The fix is to properly mock the NativeExceptionManger. This fix exposed an infinite loop issue where failures in LogBox will be logged to the ExceptionManager, which logs to the console, which logs to LogBox, creating a loop. This diff also fixes that look by moving the LogBox internal error check to the top of the monkey patched console methods. Changelog: [Internal] Differential Revision: D20428590 fbshipit-source-id: 7289a480c99ba8dee67772178b7629afb40b330a * Back out "Track animations and flush them" Summary: Original commit changeset: b594d0e6e9b6 D20319824 introduced a problem in LayoutAnimations, which makes surfaced as the problem in T63911344. This diff reverts D20319824. Changelog: [Internal] Reviewed By: lunaleaps Differential Revision: D20541918 fbshipit-source-id: ff72b839f57d39051122920a38b2632cbb5ec362 * Consolidate "dispatchMountItems" reentrancy prevention code, and retry code, in one function Summary: Simplifying the dispatchMountItems reentrance and retry logic. Motivation: cleanup so I can work on dispatching ViewCommands before anything else. Importantly, this gives us the properties that: 1) Only one function is responsible for calling dispatchMountItems 2) Only one function is responsible for deciding if we shouldn't call dispatchMountItems due to reentrance 3) Only one function is responsible for all cleanup 4) Only one function maintains all of the relevant flags (except dispatchPreMountItems... two total now, instead of 4 before) Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20437035 fbshipit-source-id: 5370366790eb25f653bee6c1950e747458374a61 * Only retry ViewCommand mount items if exception is marked as "Retryable" Summary: Instead of just blindly retrying all ViewCommands if they fail - which could be dangerous, since it's arbitrary imperative commands we'd be executing twice, potentially with bad app state - we only retry if the ViewCommand throws a "RetryableMountingLayerException". Changelog: [Internal] Optimization to ViewCommands Reviewed By: mdvacca Differential Revision: D20529985 fbshipit-source-id: 0217b43f4bf92442bcc7ca48c8ae2b9a9e543dc9 * Introduce early dispatch of ViewCommands in FabricUIManager Summary: Earlier this week I introduced a change in the old, non-Fabric renderer (D20378633 D20427803) that (gated behind a feature-flag) executes ViewCommands before all other types of commands, as a perf optimization and (I think) a potential fix for a category of race conditions. I've added more details in comments here. The Fabric renderer uses the same feature-flag that I introduced for the non-Fabric renderer. Changelog: [Internal] Fabric Reviewed By: mdvacca Differential Revision: D20449186 fbshipit-source-id: bb3649f565f32c417a6247369902333989a043aa * Change nightly build from hourly to nightly (daily at 00:00) (#28346) Summary: We initially added the nightly build test to run every hour, in order to more quickly validate it. Now that it has been validated we can run it every night as it is intended to do. cc hramos ## Changelog [General] [Changed] - Change nightly build from hourly to nightly Pull Request resolved: https://github.com/facebook/react-native/pull/28346 Reviewed By: cpojer Differential Revision: D20550143 Pulled By: hramos fbshipit-source-id: 9487c6785684ad6ea7e877290d50a33118090a7f * Add diffing to app bundle size reports (#28284) Summary: Add diffing to app bundle size reports. ## Changelog [Internal] [Changed] - Add diffing to app bundle size reports Pull Request resolved: https://github.com/facebook/react-native/pull/28284 Test Plan: - App bundle size reports should now display a diff where available - Right now, the database contains only one entry for the last known good iOS build - Triggering a new build should not create additional comments Reviewed By: cpojer Differential Revision: D20450158 Pulled By: hramos fbshipit-source-id: 720772275f24d3ff0a49705f4dada2efe2e99bd3 * feat: improve monorepo support by removing redundant PROJECT_ROOT (#28354) Summary: Historically, React Native didn't support a lot of custom project structures apart from the standard flat directory with `ios` and `android` folders. The CLI had to be explicitly started from the project root, otherwise Metro didn't work right. In order to resolve the project root in the most accurate way, React Native assumed that project root is always `../../` from its location in `node_modules` - this is not true when the installation gets hoisted (e.g. in a monorepo). To address that, janicduplessis brought support for custom [`PROJECT_ROOT`](https://github.com/facebook/react-native/commit/9ccde378b6e6379df61f9d968be6346ca6be7ead) that allowed overriding the `../../` in case it wasn't true. Today, CLI is able to automatically resolve the project root, no matter where it's started. It will traverse the tree of the directories upwards and stop as soon as it meets `package.json`. As a result, it doesn't really matter from where we start the CLI anymore as a part of `react-native-xcode.sh`. By replacing the default value of `$REACT_NATIVE_DIR/../../` with `$PWD, that is default for all Xcode scripts, we can make the setup for monorepo easier - nobody will need to set `$PROJECT_ROOT` in order to override the incorrect defaults. By default, all scripts defined in Xcode run from `$PWD` directory, which is the location of the iOS project. In the future, we will be able to remove `cd` entirely. To better understand this PR, let's look a few hypothetical structures as an example: #### Monorepo: > tl;dr works out of the box, no need to mess around with paths ``` - package.json - packages/ - my-app/ - index.js - package.json - ios/ - MyApp.xcodeproj ``` **Before this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $REACT_NATIVE_DIR/../../ node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - Because we change the directory to the root of monorepo, CLI throws an error. All in all, there's no `react-native` dependency at the workspace root. - Some users turn `no hoist` in an act of troubleshooting the errors, which resolves the problem - `react-native` is moved under `my-app/node_modules` which makes this mechanism resolve properly. - Some users find out about `PROJECT_ROOT` and set it to overwrite the default value. For example, setting `export PROJECT_ROOT = "$PWD/../` will set the directory to `my-app`, which has a dependency on `react-native` in a `package.json` and makes the CLI happy. **After this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $PWD node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - The `$PWD` is `packages/my-app/ios/` because that's where the Xcode project is located. CLI will automatically set the root to `../` because that's where it finds `package.json` with `react-native` dependency. It will pass that root to Metro, unless users have set a different one themselves. Thanks to that, all paths to JavaScript files remain working and unaffected. - No need to set `PROJECT_ROOT` anymore. - We don't rely on the location of `node_modules`, which is cleaner and future proof. #### Standard: > tl;dr no changes ``` - ios/ - MyApp.xcodeproj - index.js - package.json ``` **Before this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $REACT_NATIVE_DIR/../../ node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - Everything works fine. Path from `react-native` inside `node_modules` is correct - the project root is set right to `/` **After this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $PWD node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - The root will be set to where Xcode project is located, which is `/ios`. This is the PWD for all Xcode scripts. CLI will look for the `package.json` going upwards from `ios` folder. Will stop at `/`, find out it has `react-native` dependency, load it and its commands and proceed further. ## Changelog [iOS] [Feature] - Better monorepo support when building release apk Pull Request resolved: https://github.com/facebook/react-native/pull/28354 Test Plan: - All projects (standard/monorepo) run without issues. - PROJECT_ROOT is not needed. CC: Titozzz (who wrote monorepo guide), alloy, bartolkaruza Reviewed By: cpojer Differential Revision: D20558005 Pulled By: hramos fbshipit-source-id: 2551120beadcfd4c2f1393ce8a2c2fa6b93c9290 * Fix `test_android`: Remove references to fbsource cell (#28363) Summary: Fixes https://github.com/facebook/react-native/issues/28361. ## Changelog [Internal] [CI] - Fix test_android Pull Request resolved: https://github.com/facebook/react-native/pull/28363 Test Plan: Prior to fix: ``` react-native $ ./scripts/circleci/buck_fetch.sh Guessing 168a69309928ba16065cdb33b1775a4af9f924a6 as the last one used version. Using additional configuration options from /Users/hramos/.buckconfig.d/experiments, /etc/buckconfig.d/fb_chef.ini, /etc/buckconfig.d/fb_chef_override.ini Invalidating internal cached state: Watchman failed to start. This may cause slower builds. Parsing buck files: finished in 1.5 sec Buck wasn't able to parse /Users/hramos/git/react-native/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK: IOError: [Errno 2] No such file or directory: '/Users/hramos/git/react-native/tools/build_defs/platform_defs.bzl' Call stack: File "/Users/hramos/git/react-native/.buckd/resources/168a69309928ba16065cdb33b1775a4af9f924a6/buck_server/buck_parser/profiler.py", line 507, in wrapped return func(*args, **kwargs) File "/Users/hramos/git/react-native/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK", line 1 load("//tools/build_defs:platform_defs.bzl", "ANDROID") File "/Users/hramos/git/react-native/.buckd/resources/168a69309928ba16065cdb33b1775a4af9f924a6/buck_server/buck_parser/profiler.py", line 507, in wrapped return func(*args, **kwargs) This error happened while trying to get dependency '//ReactAndroid/src/main/java/com/facebook/fbreact/specs:FBReactNativeSpec' of target '//ReactAndroid/src/main/java/com/facebook/react/devsupport:devsupport' ``` After fix: ``` react-native $ ./scripts/circleci/buck_fetch.sh + buck fetch ReactAndroid/src/test/java/com/facebook/react/modules Guessing 168a69309928ba16065cdb33b1775a4af9f924a6 as the last one used version. Using additional configuration options from /Users/hramos/.buckconfig.d/experiments, /etc/buckconfig.d/fb_chef.ini, /etc/buckconfig.d/fb_chef_override.ini Invalidating internal cached state: Watchman failed to start. This may cause slower builds. Parsing buck files: finished in 1.1 sec Configuration 'ANDROID_SDK' points to an invalid directory '/opt/android_sdk'. When creating rule //ReactAndroid/src/main/java/com/facebook/hermes/instrumentation:instrumentation. ``` > Note: I don't have the Android SDK configured in this machine. Verified on Circle CI. `test_android` is now green: https://circleci.com/gh/facebook/react-native/140682?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link Reviewed By: cpojer Differential Revision: D20564934 Pulled By: hramos fbshipit-source-id: 5d843b8f113c4db5391ee39addc3ff259d962290 * Fix TextInput left/right padding Summary: This fixes two things: 1) Currently it only respects Start and End padding, and if there's a Theme default, it will override Left/Right padding. Whoops. 2) Currently it doesn't respect when a TextInput starts with padding, but then is removed. This resolves both. It still does not account for RTL support. Changelog: [Internal] Fix AndroidTextInput padding Reviewed By: mdvacca Differential Revision: D20573151 fbshipit-source-id: e89791641b6699e728cde9dbd661a8c21485fbc8 * Validate selection range passed to setTextAndSelection Summary: Changelog: [Internal] # Fabric 1. If `start` and `end` parameters in `setTextAndSelection` are -1, we don't move the cursor. Previously the cursor would be moved to beginning of text input. 2. In view commands, do not validate `eventCount`. It is passed in as undefined from JS because Fabric's text input doesn't use `eventCount`. # Paper 1. If `start` and `end` parameters in `setTextAndSelection` are -1, we don't move the cursor. Previously the cursor would be moved to beginning of text input. Reviewed By: shergin Differential Revision: D20538290 fbshipit-source-id: c7aeddc25f58697254474058ce901df958321f7c * Remove ReactTypes from fbsource and React sync Summary: See https://github.com/facebook/react/pull/18366 This contains a fork of the upstream Flow types. We shouldn't be syncing this since these leads to conflicting types. As a result, these uses have already been codemodded away. Only the imports remained. Changelog: [React Core] - Remove ReactTypes from sync. Reviewed By: gaearon Differential Revision: D20583740 fbshipit-source-id: fc86a934cbdca8ff90fe90282b86ecc945a85e5f * Fix controlled TextInput with child nodes Summary: Changelog: [Internal] # There are three changes in this diff ## _stateRevision is replaced with a BOOL `_stateRevision` was protecting against setting attributed string that is already visible to the user. Previously this was ok because the change was only coming from native, any changes from JS were ignored. Imagine following scenario: 1. User taps key. 2. Update state is called on component initiated by native. 3. New state is created with incremented revision by one. 4. `_stateRevision` gets set to new state's revision + 1. 5. Now JS wants to change something because it just learnt that user tapped the key. 6. New state is created again with incremented revision by one. 7. Update state is called on the component, but the change isn't applied to the text view because `_state->getRevision()` will equal `_stateRevision`. By having a BOOL instead of number, we very explicitly mark the region in which we don't want state changes to be applied to text view. ## Calling [_backedTextInputView setAttributedText] move cursor to the end of text input This is prevented by storing what the current selection is and applying it after `[_backedTextInputView setAttributedText]` is called. This was previously invisible because JS wasn't changing contents of `_backedTextInputView`. ## Storing of previously applied JS attributed string in state This is the mechanism used to detect when value of text input changes come from JavaScript. JavaScript sends text input value changes through props and as children of TextInput. We compare what previously was set from JavaScript to what is currently being send from JavaScript and if they differ, this change is communicated to the component. Previously only first attributed string send from JavaScript was send to the component. # Problem If children are used to set text input's value, then there is a case in which we can't tell what source of truth should be. Let's take following example We have a text field that allows only 4 characters, again this is only a problem if those 4 characters come as children, not as value. This is a controller text input. 1. User types 1234. 2. User types 5th character. 3. JavaScript updates TextInput, saying that the content should stay 1234. 4. In `TextInputShadowNode` `hasJSUpdatedAttributedString` will be set to false, because previous JS value is the same as current JS value. Reviewed By: shergin Differential Revision: D20587681 fbshipit-source-id: 1b8a2efabbfa0fc87cba210570142d162efe61e6 * Daily `arc lint --take BUCKFORMAT` Reviewed By: zertosh Differential Revision: D20593906 fbshipit-source-id: b056947c698508119dc9d4d1bba202295b8f0fda * RN picker - implement background color Summary: add support to the android implementation of the Picker component for setting the background color. Changelog: [Android] [Added] - Support item background color in Dialog Picker Differential Revision: D20566131 fbshipit-source-id: d693b40803fa1051ec955c5728994c820fecd9e9 * Fabric: Modernizing Yoga Dirty flag test. Summary: Now we using TEST_F thing that allows consilidating initialization. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D20578788 fbshipit-source-id: 103bcb8fdeb3dbf297385cfe56415bd646e16791 * Fabric: Changing signature of `ComponentDescriptor::createState` Summary: This is pure syntactic change. Often we don't have a shared pointer to ShadowNodeFamily and only have just a reference. At the same time, `ComponentDescriptor::createState` does not have to accept a shared pointer. So, it's better to accept just a reference. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20578787 fbshipit-source-id: 905277001e096d41e75007575b59ea2ea15fbf4b * Fabric: View Test: Changing state should not dirty Yoga tree (in some most cases) Summary: Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D20578789 fbshipit-source-id: 4336165217bd39fc8065cfaeb96ef7753433d48a * Get ReactiveNative compiled with Clang 10 (#28362) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/28362 Fixed a few compilation errors emitted by Clang 10. Changelog: [iOS] [Fixed] - Get ready for Clang 10 Differential Revision: D20549970 fbshipit-source-id: dc36a85d90d3e43a05f045feb57c6ab6ded67da7 * Guard against null values in object parameters for bridged methods Summary: Handles the case when a value in an object parameter of a turbo module spec is null (even if the type is nullable). For example, given: ``` export interface Spec extends TurboModule { +myFunc: ({| foo: ?string, |}) => void; } ``` and calling `NativeModule.myFunc({foo: null})`, we see an error like: ``` JSON value '<null>' of type NSNull cannot be converted to NSString ``` Guarding against this by converting NSNull's to nils ## Changelog: [iOS] [Fixed] - Fix crash when passing null value in object parameter of bridged method Reviewed By: fkgozali Differential Revision: D20591590 fbshipit-source-id: fdb90f34131427a235f2e3c99147bf1e6a9c6732 * Modify pending deletion tags to be cross manageChildren Summary: Changelog: [Internal] Removing historic layout animations index adjustment (D20323928) broke the Dating Secret Crush screen. Since flushing animations (D20319824) had to be reverted due to issues with Saved + Privacy Shortcuts (https://fburl.com/tasks/eijtmifu) we need to track pending deletions across `manageChildren` operations. Reviewed By: JoshuaGross Differential Revision: D20601079 fbshipit-source-id: c6f116683750e97abe7f988cf361d2a6449e90e6 * Enable label-actions on the react-native repository (#28374) Summary: Enhance our issue management workflow by having the bot respond automatically whenever a label is applied to the issue. ## Changelog [Internal] - CI Pull Request resolved: https://github.com/facebook/react-native/pull/28374 Test Plan: Not tested. If needed, could be applied to a different, test repository. Reviewed By: cpojer Differential Revision: D20606887 Pulled By: hramos fbshipit-source-id: 874d1464527ea76bf51394a7d3e98e4fd8f69345 * Fix Animated Value initialized with undefined in ScrollView (#28349) Summary: When passing an object to contentOffset that doesn't have `y` prop set it causes the following error: ``` Error: AnimatedValue: Attempting to set value to undefined This error is located at: in ScrollView (at src/index.js:638) ... ``` This happens since a runtime check was added to the `AnimatedValue` constructor. (a3aaa471eca58b31597b9a0669f7ade385ccb175) According to flow types the object passed to contentOffset should always contain both x and y props but since it worked before when y is undefined I think its fine to patch the runtime behaviour defensively, especially since the code change is simple. ## Changelog [General] [Fixed] - Fix Animated Value initialized with undefined in ScrollView Pull Request resolved: https://github.com/facebook/react-native/pull/28349 Test Plan: Tested that the crash no longer reproduces when passing an empty object to contentOffset. Reviewed By: cpojer Differential Revision: D20601664 Pulled By: hramos fbshipit-source-id: b098a2dd1e702f995a9a92fa6e4e9a204187dac4 * xplat/js/react-native-github/ReactCommon/fabric/components/textinput/ Summary: Changelog: [Internal] Reviewed By: scottrice Differential Revision: D20619227 fbshipit-source-id: 674337e6ce585a4e96d020f9624b874ba86e2d80 * Seed ssh known hosts with github's public key (#28370) Summary: The [previous attempt](https://github.com/facebook/react-native/pull/28304) to fix the publish step failed, so now reverting to manually configuring things. This PR adds an entry to SSH’s `known_hosts` file using github.com’s public key that I have verified as per [these instructions](https://serverfault.com/a/807363): ``` ~/C/R/react-native [master] » nmap github.com --script ssh-hostkey Nmap scan report for github.com (140.82.118.4) rDNS record for 140.82.118.4: lb-140-82-118-4-ams.github.com PORT STATE SERVICE 22/tcp open ssh | ssh-hostkey: | 1024 ad:1c:08:a4:40:e3:6f:9c:f5:66:26:5d:4b:33:5d:8c (DSA) |_ 2048 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48 (RSA) ``` These fingerprints line up with [the ones posted by GitHub](https://help.github.com/en/github/authenticating-to-github/githubs-ssh-key-fingerprints), so my setup should be good and can be trusted to grab the public key from the right host: ``` ~/C/R/react-native [master] » ssh-keyscan -t rsa -H github.com # github.com:22 SSH-2.0-babeld-d48c3acd |1|If6MU203eXTaaWL678YEfWkVMrw=|kqLeIAyTy8pzpj8x8Ae4Fr8Mtlc= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== ``` ## Changelog [Internal] [Fixed] - Make automated publishing of packages from CI work again Pull Request resolved: https://github.com/facebook/react-native/pull/28370 Test Plan: I used the command being added in this PR in [a failed CI job](https://app.circleci.com/pipelines/github/facebook/react-native/4104/workflows/916127cb-177f-4583-9f90-cae5318041d8/jobs/140810). When I invoked the publish script manually I was not greeted by the blocking prompt and the package was successfully published: https://www.npmjs.com/package/react-native/v/0.0.0-56cf99a96 Reviewed By: cpojer Differential Revision: D20601527 Pulled By: hramos fbshipit-source-id: b1a4405228408cfc4a1b3b44ab88c79522af3a66 * Fix app bundle size diff not always being compared against latest commit (#28368) Summary: - Timestamp of entries in our Firebase instance sometimes get stored as number. This means that we may not always be diffing against the latest master commit. - Size report of Android and iOS gets overwritten depending on which build finishes first. ## Changelog [Internal] [Fixed] - App bundle size diff not always being compared against latest commit [Internal] [Fixed] - Android and iOS app bundle size diff overwrite each other Pull Request resolved: https://github.com/facebook/react-native/pull/28368 Test Plan: - We are now using Firebase's own [firebase.firestore.Timestamp.now](https://firebase.google.com/docs/reference/js/firebase.firestore.Timestamp#now) to ensure that we always get a timestamp in the preferred format. This has been tested locally but can only be verified when merged to master and we start getting new data. In the meantime, I'll manually fix up all the entries in the store. - There should be one app bundle size comment for Android and one for iOS in this PR. Reviewed By: cpojer Differential Revision: D20601620 Pulled By: hramos fbshipit-source-id: 0c3e4b78a74cbd659f1957a6aa74322b016e0646 * Hopefully fix so loading crashes Summary: Changelog: [Android][Internal] Fix potential initializer interruption threading crashes. Reviewed By: mdvacca Differential Revision: D20615755 fbshipit-source-id: 58b706deeb6df1998caff5bf2ae9ec60114313fe * Fix label-actions configuration Summary: Adds back a missing label key, fixes open source issue: https://github.com/facebook/react-native/issues/28378 Changelog: [Internal] [CI] - Fix label-actions config Reviewed By: cpojer Differential Revision: D20625887 fbshipit-source-id: 63c90db249aa9c15369a4b5bcab71cbe75c6d4b8 * Changing Order Of mOverrideColorScheme In Constructor Summary: Changelog: [Android] [Updated] mOverrideColorScheme should be assigned before the first colorSchemeForCurrentConfiguration call, so the initial setting of mColorScheme will reflect the override Reviewed By: zackargyle Differential Revision: D20630173 fbshipit-source-id: a2a2d174d3fc40c14f27dce6a7fa8e67203480c9 * hermes | inspector | Don't include posix headers on non-posix systems Summary: Changelog: [Internal] Hermes inspector includes pthreads, arpa and sys headers on all OSes that would break vanilla Windows builds. This diff adds a check for posix-compliance before inclusion (Note: this ignores all push blocking failures!) Reviewed By: dulinriley Differential Revision: D20564449 fbshipit-source-id: 8e264bc3104065dc4315bb291e8560609fe65184 * Upgrade Prettier from 1.17 to 2.0.2. Summary: This gets us on the latest Prettier 2.x: https://prettier.io/blog/2020/03/21/2.0.0.html Notably, this adds support for TypeScript 3.8, which introduces new syntax, such as `import type`. Reviewed By: zertosh Differential Revision: D20636268 fbshipit-source-id: fca5833d003804333a05ba16325bbbe0e06d6c8a * Back out "Upgrade Prettier from 1.17 to 2.0.2." Differential Revision: D20639755 fbshipit-source-id: 5028563f9cf0527a30b4259daac50cdc03934bfd * Fabric: Additional temporary checks in prop parsing infra Summary: While ViewConfig infra isn't perfect we need to check some value for correctness during prop-parsing. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D20639055 fbshipit-source-id: 193dcd0769bc7777bc8d60c964ede72ebdaa83e4 * Update React package Summary: This just updates the `react` package to the latest stable version. We updated it to experimental internally earlier so this brings the open source version to the latest before the branch cut. This doesn't include any breaking changes. Changelog: [General][Changed] - Update to React 16.13.1 Reviewed By: cpojer Differential Revision: D20642909 fbshipit-source-id: 68a4c74bfe72f1abdb33b0b9071a4f4e8e568318 * Fix sketchy null checks induced by new formatting in Prettier 2.0 Summary: Update code to prepare for Prettier 2.0, which will reformat `a || (b || c)` to `a || b || c`. Changelog: [Internal] prepare for Prettier 2.0 Reviewed By: kassens Differential Revision: D20639483 fbshipit-source-id: c2932b1495884684172ba9291d56c546f51711b8 * RN picker - fix types in AndroidDialogPickerManagerInterface Summary: according to [this crash report](https://our.intern.facebook.com/intern/logview/details/facebook_android_crashes/7ba7056481015482c6166d65cb97e49d/?trace_key=1506fe36a70dd5e50cdc8968f6317f27), `value` was throwing an NPE despite being null-checked. this is because it was an `int` rather than an `Integer`, so the null check wasn't working Changelog: Fix types in AndroidDialogPickerManagerInterface Reviewed By: mdvacca Differential Revision: D20646343 fbshipit-source-id: a27587e0a48f5782bcf5ffddb604018218e65206 * Remove RCTExportModule log spam Summary: The bridge complains if modules aren't exported, which isn't really helpful with lazily loaded modules and turbo modules. I considered only turning this off when TurboModules is enabled, but figured we'd be killing this soon anyways... If anyone feels strongly I can go that approach. Changelog: [iOS][Internal] Remove RCTExportModule log spam Reviewed By: shergin Differential Revision: D20629575 fbshipit-source-id: d32d9fe244c4d06acfee982fca7c7f63da294dc5 * De-jank DevLoadingView Summary: ## Problems Repro steps: 1. Disable Fabric (because CMD + R doesn't work with Fabric right now). 2. Open up Marketplace and hit `CMD + OPT + R` 3. **Observe:** The progress bar doesn't show up right away. It also doesn't actually show progress. https://pxl.cl/140g1 RN Support post: https://fb.workplace.com/groups/rn.support/permalink/3437652016283389/ ## Fixes The first problem is that progress bar doesn't actually show progress. **Fix:** Bundle load progress is updated in `RCTCxxBridge`, where we first require `RCTDevLoadingView`, and then call its `updateProgress` method. Previously, we wouldn't lazily load `RCTDevLoadingView`, it already didn't exist. Lazily loading `RCTDevLoadingView` causes the progress view to show up. Here: https://pxl.cl/140gt If you look at the above video, you'll notice there are two stages to the progress bar: stage 1 displays the actual progress. Stage 2 prompts that we're downloading the JS bundle. As you can see, stage 1 and stage 2 have different background colors, even though both of them are green. **Fix:** I adjusted the JS to match the Native color. Here: https://pxl.cl/140gT We're almost there, but the progress bar is dismissed twice? **Fix:** I dug into the code, and the reason why was because when we hit `CMD + R`, we invalidate the bridge, and immediately re-initialize it. This means that we asynchronously invalidate the old TurboModuleManager, and immediately create a brand new one. Therefore, two `RCTDevLoadingView` modules can (and do) exist at once. So, I moved `RCTDevLoadingView` to be an instance member of `FBReactModule`, to ensure that it doesn't get cleaned up and re-created when TurboModuleManager is deleted and re-created. This finally fixed the progress bar jank: https://pxl.cl/140hn Changelog: [iOS][Fixed] - Remove RCTDevLoadingView jank Reviewed By: rickhanlonii Differential Revision: D20607815 fbshipit-source-id: 05825c67adaf3cfda70be0fa2dc92d413dc8921b * Fix retaining self in block in LogBox impl Summary: Logbox has a retain cycle (see linked task for my deeper investigation). This diff doesn't fix the retain cycle, but it's just good practice to not retain self strongly in blocks. Changelog: [iOS][Internal] Fix retaining self in block in LogBox implementation Reviewed By: shergin Differential Revision: D20630693 fbshipit-source-id: cf399495e9bcd1917932fcc0e9c9d2d2a32bf6f0 * Flow type infoLog Summary: Changelog: [General][Internal] flow type infoLog Reviewed By: zackargyle Differential Revision: D20577939 fbshipit-source-id: eed4401b2ae0a6bf845fdcb54c6abe1fe98fe7c1 * Replace fbsource// with // in xplat/js/ files [1] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: scottrice Differential Revision: D20495655 fbshipit-source-id: a57b72f694c533e2e16dffe74eccb8fdec1f55f5 * Deploy Flow 0.121 to Xplat (#901) Summary: Deploy Flow 0.121 to Xplat bypass-lint allow-large-files Closes https://github.com/facebook/flipper/pull/901 Changelog: [Internal] Reviewed By: panagosg7 Differential Revision: D20570316 fbshipit-source-id: a76983d6f46c8b995ce2dd5cd1e014534790698a * Replace fbsource// with // in xplat/js/ files [3] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D20656211 fbshipit-source-id: deb91b917d349bc500acbb03d734ff621f6e1fc7 * Replace fbsource// with // in xplat/js/ files [4] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: JoshuaGross, shergin Differential Revision: D20656696 fbshipit-source-id: 10f02decb1dc969fd3491ac90d97f09e2bda59e7 * Add Needs: Repro bot action (#28397) Summary: Add automated response for Needs: Repro ## Changelog [Internal] [Added] - Add automated response for Needs: Repro Pull Request resolved: https://github.com/facebook/react-native/pull/28397 Test Plan: Bot should add a comment with the Needs: Repro label. Reviewed By: cpojer Differential Revision: D20665378 Pulled By: hramos fbshipit-source-id: 1c7d878faacf935a640849f74c81f119e5c7e92d * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D20666684 fbshipit-source-id: 32255ac7509e0257693969a7b4b044569af30df7 * ✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392) Summary: Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`. Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job. What was done in this PR: * The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use. * The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument. * The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument * The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument ## Changelog [Internal] [CI] - ✅ Green CI, disabled test infrastructure work Pull Request resolved: https://github.com/facebook/react-native/pull/28392 Test Plan: Verified on Circle CI Reviewed By: cpojer Differential Revision: D20665512 Pulled By: hramos fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726 * Upgrade internal packages to support ESLint >= 6 (#28393) Summary: Fixes https://github.com/facebook/react-native/issues/28293 I've tested it with https://github.com/react-native-community/react-native-template-typescript and it seems to be working as expected - no warnings, supports typescript 3.8. (note: I didn't upgrade the package version as I don't know how the releases work for this package) ## Changelog [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/28393 Reviewed By: hramos Differential Revision: D20647112 Pulled By: cpojer fbshipit-source-id: ca6b67971f625dc8125a58f9220dfcd86250ba94 * Fabric: Fixing a deadlock in RCTSurfacePresenter Summary: This is another attempt to fix an issue very similar to T59424871. The previous attempt was in D19249490. I don't know why we don't see production crashes (stalls) but it happened to me (and not to me) in the debugger. The previous attempt didn't work because we still could have a deadlock because we tried to acquired shared mutex already owned exclusively by the `suspend` method. Here is another approach: Instead of using one shared mutex, now we use two. One is similar to what we had and another that protects `suspend` and `resume`. Besides that, now we pass a Scheduler to functions that use that explicitly. This way we can be more explicit about acquiring mutexes and the overall flow of execution. The idea is: Now an arbitrary code that can be reentrant does not cover with mutexes, so the deadlock is not possible. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20639228 fbshipit-source-id: 98515742f00f2ae94b50b585c9f1f0611e169ebe * Update React Hooks Plugin Summary: Updates `eslint-plugin-react-hooks` to 3.0.0. This introduces a new lint error when you use a Hook inside a class. Changelog: [General][Changed] - Updated the React Hooks ESLint Plugin Reviewed By: cpojer Differential Revision: D20675528 fbshipit-source-id: d0cbe9748fd15df7a4c6de00bd1462610e0a43d6 * Upgrade React DevTools 4.0.6 -> 4.6.0 Summary: Upgrading the embedded version of React DevTools, primarily to pull in [this PR](https://github.com/facebook/react/pull/18397) which will reduce the impact of this package on `node_modules` size. # Update process Following a similar process as D15973709, I began by searching for [all of the references](https://our.intern.facebook.com/intern/biggrep/?corpus=xplat&filename=.json&case=false&view=default&extre=&s=%22react-devtools&engine=apr_strmatch&context=false&filter[uninteresting]=false&filter[intern]=false&filter[test]=false&grep_regex=) to the `react-devtools-core` package and updated all v4 usage to to point to the new 4.6.0 release: 1: Manually update "react-devtools-core" versions: ``` js/package.json js/react-native-github/package.json nuclide/package.json sonar/desktop/app/package.json sonar/desktop/plugins/reactdevtools/package.json vscode/modules/vscode-webview/package.json ``` 2: Setup Yarn proxy: ``` yarn config set proxy http://fwdproxy:8080/ yarn config set https-proxy http://fwdproxy:8080 ``` 3: Run "yarn" in each of the above directories. 4: Run the lockfile shell script: ``` ~/xplat/js/scripts/update-oss-yarn-lockfile.sh ``` 5: Update the generated `MOBILE_JS_NODE_MODULE_DEPS.bzl` by running ``` js1 build buckfiles ``` ## Changelog: [General] [Changed] - Upgrade embedded React DevTools backend from v4.0.6 to v4.6.0. Reviewed By: cpojer, gaearon Differential Revision: D20676091 fbshipit-source-id: 99865bdba9bce45e2a7d582d5fb550cfdbeeca3a * Make ScrollView use ForwardRef Summary: Have ScrollView use forwardRef so that the host component methods like `measure` and `measureLayout` are available without having to call `getNativeScrollRef`. Instead, you can use `<ScrollView ref={myRef} />` and directly call all methods of ScrollView and host components on `myRef`. Previous usage: ``` const myRef = React.createRef<React.ElementRef<typeof ScrollView>>(); <ScrollView ref={myRef} /> const innerViewRef = myRef.current.getNativeScrollRef(); innerViewRef.measure(); ``` New usage: ``` const myRef = React.createRef<React.ElementRef<typeof View>>(); <ScrollView ref={myRef} /> // now, myRef.current can be used directly as the ref myRef.current.measure(); myRef.current.measureLayout(); // Additionally, myRef still has access to ScrollView methods myRef.current.scrollTo(...); ``` Changes: * Added deprecation warnings to ScrollView methods `getNativeScrollRef`, `getScrollableNode`, and `getScrollResponder` * Added the forwardRef call to create `ForwardedScrollView` - this takes in `ref` and passes it into the class ScrollView as `scrollViewRef`. * Forwarded the ref to the native scroll view using `setAndForwardRef`. * Added statics onto `ForwardedScrollView` so that `ScrollView.Context` can still be accessed. * Added type `ScrollViewImperativeMethods`, which lists the public methods of ScrollView. * Converted all public methods of ScrollView to arrow functions. This is because they need to be bound to the forwarded ref. * Bound all public methods of ScrollView to the forwarded ref in the `setAndForwardRef` call. * Flow typed the final output (ForwardedScrollView) as an abstract component that takes in the props of the `ScrollView` class, and has all methods of both the inner host component (`measure`, `measureLayout`, etc) and the public methods (`scrollTo`, etc). Changes to mockScrollView: * Changed mockScrollView to be able to mock the function component instead of a class component * Updated necessary tests Changelog: [General] [Changed] - Make ScrollView use forwardRef Reviewed By: TheSavior Differential Revision: D19304480 fbshipit-source-id: 6c359897526d9d5ac6bc6ab6d5f9d82bfc0d8af4 * Fix issue with onEndReached Summary: onEndReached can be triggered twice when more items are added to the end of the list. This change makes it so that a second call to onEndReached won't happen until the user scrolls down to the new end of the list. Changelog: [General] [Fixed] - Fix double call to onEndReached in VirtualizedList Reviewed By: sahrens Differential Revision: D20066740 fbshipit-source-id: 129d7ae6bfd241eeea18fe0bb12b82be67735874 * Remove console warnings from ScrollView methods Summary: The newly added console warnings in D19304480 are adding a lot of warning noise due to missed infra callsites. Those callsites need to be updated before these warnings can be added. Changelog: [Removed] Remove console warnings from ScrollView methods Reviewed By: rickhanlonii Differential Revision: D20700917 fbshipit-source-id: cb618ee3a291d26e1942e4f91bbc02dee41fb78b * Upgrade react-docgen, jscodeshift and flow-parser Summary: In preparation for upgrading babel, I'm updating some of our source transform tools to the latest versions. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D20675201 fbshipit-source-id: fa4fee2652529c6677087e42cdd1325a8080e46f * Ship State Reconciliation 100% on all platforms Summary: State Reconciliation has been running 50/50 for a while and all metrics look stable. This is necessary for providing a good experience so we should ship to everyone unconditionally. Changelog: [Internal] Fabric diffing reconciliation process improvement Reviewed By: mdvacca Differential Revision: D20715694 fbshipit-source-id: 25b2635ecc29b67e2911679c9db66bc84d37dec1 * Core telemetry tests: update so they pass on my machine Summary: `std::this_thread::sleep_for` is not really precise and will attempt to sleep for "at least" that much time, but may sleep much longer depending on what CPUs are doing and scheduling policies. To get this to pass on my machine, I had to substantially increase the thresholds. Changelog: [Internal] Reviewed By: shergin Differential Revision: D20689571 fbshipit-source-id: f159420d24a95da2b5d95d49ed7882e783291e98 * Optimize diff algorithm to produce fewer remove+insert ("move") paired instructions Summary: An evolution of D20633188 but more performant. There are three optimized paths before the slow path. The first optimized path tries to pair identical nodes from old/new tree, and generate Update mutations, until we hit nodes that are different (indicating either a remove or an insert). This already existed. The next two optimizations, introduced by Tim in his JS pseudocode, were inspired by ReactJS's diffing algorithm. They work in cases where the rest of the nodes are (1) all removals/deletes or (2) all creates+inserts. Finally, if those final two optimized paths can't run, it's because there is a mix of delete+remove, create+insert, and "move" operations, mixed at the beginning, middle, and/or end of the list. This has slightly better average/best-case complexity as the previous implementation. In particularly pathological cases where all nodes are arbitrarily reordered, or reversed, for instance (ABCDE->EDCBA) the algorithm has the same complexity as the previous algorithm (quadratic). For now iOS is pinned to the older differ Changelog: [Internal] Experiment to optimize diffing algorithm in Fabric Reviewed By: shergin Differential Revision: D20684094 fbshipit-source-id: d29fba95a0328156c023e1c87804f23770ee1d91 * Unit test for V2 "minimal instruction" diffing algorithm Summary: This unit test is to verify that the new diffing algorithm generates a "minimal" instruction set, with regards to removes and inserts ("moves"). These unit tests are here to verify the expected behavior in this new algorithm, but these tests may be modified or deleted in the future if we decide we want to change this behavior. Changelog: [Internal] fabric unit test Reviewed By: mdvacca Differential Revision: D20706592 fbshipit-source-id: 5f9991498e0d788ecbf88d938bfe6d3f0f27af40 * Add ES Lint rules for `DynamicColorIOS()`and `ColorAndroid()` (#28398) Summary: The [PlatformColor PR](https://github.com/facebook/react-native/pull/27908) added support for iOS and Android to express platform specific color values. The primary method for an app to specify such colors is via the `PlatformColor()` method that takes string arguments. The `PlatformColor` method returns an opaque Flow type enforcing that apps use the PlatformColor method instead of creating Objects from scratch -- doing so would make it harder to write static analysis tools around Color values in the future. But in addition to `PlatformColor()`, iOS has a `DynamicColorIOS()` method that takes an Object. The Flow type for this Object cannot be opaque, but we still want to enforce that app code doesn't pass variables instead of Object literals or that values in the Objects are variables. To ensure `DynamicColorIOS()` can be statically analyzed this change adds an ESLint rule to enforce that `DynamicColorIOS()` takes an Object literal of a specific shape. A `ColorAndroid()` was also introduced not for practical use but just to test having platform specific methods for more than one platform in the same app. A second ESLint rule is created for `ColorAndroid` as well. ## Changelog [General] [Changed] - Add ES Lint rules for `DynamicColorIOS()`and `ColorAndroid()` Pull Request resolved: https://github.com/facebook/react-native/pull/28398 Test Plan: `yarn lint` passes. Reviewed By: cpojer Differential Revision: D20685383 Pulled By: TheSavior fbshipit-source-id: 9bb37ccc059e74282b119577df0ced63cb9b1f53 * fix: Android gradle config when bundling for release (#28415) Summary: This fix aims to address the issue when bundling an Android app for release and getting the error exhibited in https://github.com/facebook/react-native/issues/28002 which I also encountered myself. The config was changed sometime in November 2019 (as part of https://github.com/facebook/react-native/issues/26940, commit https://github.com/facebook/react-native/commit/a3b08048674e324dbe1f0ca816f35607e9e06a2f) to be very opinionated when it comes to the use of `npx` which Gradle itself cannot find anyway (I have `npx` installed globally and it didn't pick it up). Another issue that the use of `npx` creates is that Gradle should only ever use the currently installed react-native cli rather than a (possibly) higher version which may not always have backward compatibility. The proposed change simply throws a more descriptive error rather than defaulting to a tool which may or may not exist on the machine, be it CI or a development environment. I've also modified the RNTester app to reflect the correct config implementation relative to the RNTester app itself. In real projects, the config inside `android/app/build.gradle` should look similar to the following snippet: ``` project.ext.react = [ cliPath: "$rootDir/../node_modules/react-native/cli.js", entryFile: "index.js" ]; ``` ## Changelog [Android] [Fixed] - Gradle release config Pull Request resolved: https://github.com/facebook/react-native/pull/28415 Test Plan: - [x] Successfully bundled an Android release build with correct config - [x] Works with RNTester app Reviewed By: mdvacca Differential Revision: D20714372 Pulled By: hramos fbshipit-source-id: 4d66139249c6f840582a71a48c64e6a6595f7af0 * Reimplement D19965405: Small improvements in Differentiator/TinyMap Summary: Two things: 1) I reimplement Valentin's idea in D19965405, so that TinyMaps can be iterated over, with a couple of bugfixes (calling front() or back() on an empty vector will crash). 2) I now use TinyMap instead of better::map in the "optimized" diffing algorithm. 3) `erase` now actually removes elements from the vector, but only when more than half of elements have been erased. 4) If you repeatedly erase elements at the beginning of the vector, they will no longer be iterated over. This is a specific optimization for our heaviest TinyMap use-cases. These amount to some small but hopefully somewhat meaningful perf improvements. Changelog: [Internal] Fabric perf Reviewed By: shergin Differential Revision: D20718719 fbshipit-source-id: 91f4b2e2e0f6387ae484e43d5b0095103087baa6 * Remove LayoutInspectingPolicy.includeScrollViewContentOffset Summary: `LayoutInspectingPolicy` has two flags, `includeTransform` and `includeScrollViewContentOffset`. `includeScrollViewContentOffset` seems to be redundant for two reasons. # 1st From looking at callers, they have always the same value. I looked at all call sites, and they are either always both set to true or both set to false. # 2nd The way we include scroll view content offset, is through transformation, so setting `includeTransform` to true and `includeScrollViewContentOffset` to false will include content offset anyway. In order to make both flags work, we would need to introduce further changes to `getRelativeLayoutMetrics`. But since the flag isn't used anyway, I think it is better to get rid of it for now. If we need it in the future, we could re-introduce it. Reviewed By: shergin Differential Revision: D20622256 fbshipit-source-id: fb6156c66b752319ea928239fa723ff90688b0a0 * Add support for translation and rotation to operator * between Rect and Transform Summary: Changelog: [Internal] Until now `Rect operator*(Rect const &rect, Transform const &transform)` supported only scaling. Now it supports translation and rotation as well. Reviewed By: shergin Differential Revision: D20622876 fbshipit-source-id: 1b65393bd3fd6fd9a8941903e0f2681a10097e4a * Include transform property when calling getRelativeLayoutMetrics Summary: Changelog: [Internal] Current implementation of `measure` doesn't take transform into account.. So if you had a view which has width and height 100 and had `Scale(0.5, 0.5, 1)` (this will shrink view by half). Calling `getRelativeLayoutMetrics` would report its size being `{100, 100}`. This applies if view's parent has transformation as well, because transformation is applied to all subviews of the view as well. Reviewed By: mdvacca Differential Revision: D20621590 fbshipit-source-id: 2cf902a0494291c821ecada56f810c5e6620db5a * feat: migrate appveyor to circleci (#28245) Summary: This issue closes https://github.com/facebook/react-native/issues/28241 Migrated Windows test from AppVeyor to CircleCI ## Changelog [Internal] [Changed] - Migrated Windows test from AppVeyor to CircleCI Pull Request resolved: https://github.com/facebook/react-native/pull/28245 Test Plan: For CircleCI to Pass Reviewed By: cpojer Differential Revision: D20689163 Pulled By: hramos fbshipit-source-id: 285c762457ef00f7884ee9157b3f336044c0452f * Remove "Debug with Nuclide" option Summary: This is no longer needed. Reviewed By: cpojer Differential Revision: D20722274 fbshipit-source-id: 5bc3104e90811d724f42aadbf137ab8eff718ca0 * experiment to preload RN bridge after fb4a bookmarks render Summary: Changelog: [Android][Internal] add internal supermodule label Reviewed By: mdvacca Differential Revision: D20434200 fbshipit-source-id: fae50309cdd0df4a4523c2f88d1c8e01a7163575 * Fix CursorDrawable Color Tint for Android 10+ Summary: Accessing this field via reflection is explicitly blacklisted by Google in Android 10 and higher. They have provided a new API to change the color, which I have implemented here. [The old setColorFilter is deprecated](https://developer.android.com/reference/android/graphics/drawable/Drawable#setColorFilter(int,%20android.graphics.PorterDuff.Mode)) so I also updated that method call as well. Changelog: [General] [Fixed] Use new setTextCursorDrawable API for Android 10 Reviewed By: JoshuaGross Differential Revision: D20656068 fbshipit-source-id: 58a92b57c0a892c7c87fc5d735e4ceaa4e987ec7 * Early return on tinting CursorDrawable if no color supplied Summary: There's (potentially) a lot of expensive reflection calls here that, as best I can tell, end up being ignored if the supplied color is null. Better to early return. Changelog: [General] [Internal] Preclude reflection when setting cursor color if color is null Reviewed By: JoshuaGross Differential Revision: D20670594 fbshipit-source-id: 480a988355bbd79008002c4326d4b35035ec2a95 * Partial React Sync for Inspector Summary: Partial sync for React that includes: - https://github.com/facebook/react/pull/18388 - https://github.com/facebook/react/commit/dd7e5e4f5ac2ffac3171ef61daee2cb1edc69635 Created from this branch: https://github.com/facebook/react/compare/master...rickhanlonii:rh-partial-3-24?expand=1 Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20651395 fbshipit-source-id: 67baf7c407f75d9fd01c17f2203a77a38567100e * Enable inspector for Fabric Summary: ## Overview This diff refactors the Inspector, moving logic to look up view data for a touched view inside the renderer as `getInspectorDataForViewAtPoint`. We then implement that same function for Fabric in order to support the inspector in that renderer. Requires https://github.com/facebook/react/pull/18388 ## Motivation Reason one for this refactor is that, previously, the inspector held all of the logic to look up view data for a given x,y touch coordinate. To do this, it would take the React tag and coordinates, look up the native view tag, measure it, and then ask React internals for the Fiber information of that tag. All of this is deeply coupled to React internals, yet the logic is outside of React core in the Inspector. Reason two is that, for Fabric, the logic for getting the view data is different than Paper. In Fabric, we pass the x,y coordinates to native directly, which returns an instance handle. That handle can be used to measure the ShadowNode, or retrieve the Fiber information. By moving the logic into the renderer in React core, we decouple the implementation details of looking up view data for a tapped point and allow ourselves the ability to add and change renderer-specific code for the actual lookup without impacting outsiders like the Inspector. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D20291710 fbshipit-source-id: a125223f2e44a6483120c41dc6146ad75a0e3e68 * chore: update url of warning message from deprecated imports (#28452) Summary: Some of the repository name of Lean Core(https://github.com/facebook/react-native/issues/23313) libraries has been renamed. This PR updates the warning message to display the updated url. ## Changelog [General] [Changed] - Update warning message of deprecated imports Pull Request resolved: https://github.com/facebook/react-native/pull/28452 Test Plan: updated URL can be accessed. Reviewed By: cpojer Differential Revision: D20745184 Pulled By: TheSavior fbshipit-source-id: 2c3ed6a000b45022ca6c4862305aa567c4d18b2e * Add `upgrade-support` link on issue creation (#28411) Summary: This PR adds a https://github.com/react-native-community/upgrade-support link for the user when creating an issue. Changelog: [Internal] Pull Request resolved: https://github.com/facebook/react-native/pull/28411 Reviewed By: cpojer Differential Revision: D20714274 Pulled By: hramos fbshipit-source-id: 4ca42224a50e386b95f21f0fb236a917e1b6b982 * Update PixelRatio 'getFontScale' method description (#28407) Summary: Refs facebook/react-native-website#1776. Despite in-code description `PixelRatio.getFontScale()` is working properly on the iOS (it also reflects the user settings). This PR updates the in-code description to match current behaviour. I have decided to skip in the code information about additional setting in `Accessibility` menu and in `Control Centre`, but if you think it is important just let me know, I can update this PR. ## Changelog [Internal] [Fixed] - Fix PixelRatio getFontScale method description Pull Request resolved: https://github.com/facebook/react-native/pull/28407 Test Plan: N/A Differential Revision: D20750260 Pulled By: shergin fbshipit-source-id: c40ec2fd49cd60e2975351c3a1c453aab0045da4 * Remove allowDisablingImmediateExecutionOfScheduleMountItems feature flag Summary: No longer needed. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20747684 fbshipit-source-id: a8077519b7670d72e23267b1c1423556ec97be3f * RuntimeExecutor helpers that modify the way of the callback is being executed. Summary: Here we implement a bunch of helper methods that allow customizing the behavior of a RuntimeExecutor "on-demand" on the caller side. We will use it in the next diff(s). Changelog: [Internal] Fabric-specific internal change. Reviewed By: PeteTheHeat Differential Revision: D20551411 fbshipit-source-id: 51d3cd02b69753110c0e1155347c6e52eb882c7d * Fabric: Using `executeSynchronouslyOnSameThread_CAN_DEADLOCK` in MainRunLoopEventBeat Summary: We are replacing inline-ed implementation with practically the same one implemented as the helper method. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20551409 fbshipit-source-id: fcc6f497cd240af65fba534051c217fe5746ce82 * Set RootNodeKind trait in ModalHostViewShadowNode Summary: Changelog: [internal] `ModalHostViewShadowNode` didn't have `RootNodeKit` trait, therefore `getRelativeLayoutMetrics` was including nodes in ancestors that it shouldn't have. Reviewed By: shergin Differential Revision: D20735801 fbshipit-source-id: 6b81e3b174c2f82e530abc2bca2da8bebc2270b0 * mention RNTester app in contributor guide (#28042) Summary: motivation is following - the RNTester app is imho the best place to try out any changes that a contributor would make, yet it is not directly mentioned in the contributor guide. This fixes it. ## Changelog [Internal] - Docs Pull Request resolved: https://github.com/facebook/react-native/pull/28042 Test Plan: not necessary Reviewed By: TheSavior Differential Revision: D20401260 Pulled By: hramos fbshipit-source-id: 01c1b7dff56b59909c94b2feb609650f0baba1a9 * Buck: Use Android SDK 29 during build (#28455) Summary: Fixes `test_android` and `test_docker` build failures. Thanks to dulmandakh for identifying the fix. Changelog: [Internal] [Android] [Changed] - Use Android SDK 29 to build during CI tests Pull Request resolved: https://github.com/facebook/react-native/pull/28455 Test Plan: Circle CI shows `test_android` and `test_docker` passing: https://app.circleci.com/jobs/github/facebook/react-native/142273 Reviewed By: sturmen Differential Revision: D20766589 Pulled By: hramos fbshipit-source-id: 8ef8a8ce3a6e7353ae47425accb3bd26cf1608c4 * Assign orderIndex_ in ConcreteViewShadowNode constructor instead of ViewShadowNode's constructor Summary: Changelog: [Internal] `orderIndex_` was only being assigned for `ViewShadowNode`, not for other `ShadowNodes` that are later represented on the screen. Reviewed By: shergin Differential Revision: D20746477 fbshipit-source-id: c04c2cfea14b9141d22bc3d9e9bb4c0c59925754 * Implement nativePerformanceNow to improve Profiler API results (#27885) Summary: When experimenting with React Profiler API (https://reactjs.org/docs/profiler.html), I noticed that durations are integers without a debugger, but they are doubles with higher precision when debugger is attached. After digging into React Profiler code, I found out that it's using `performance.now()` to accumulate execution times of individual units of work. Since this method does not exist in React Native, it falls back to Javascript `Date`, leading to imprecise results. This PR introduces `global.nativePerformanceNow` function which returns precise native time, and a very basic `performance` polyfill with `now` function. This will greatly improve React Profiler API results, which is essential for profiling and benchmark tools. Solves https://github.com/facebook/react-native/issues/27274 ## Changelog [General] [Added] - Implement `nativePerformanceNow` and `performance.now()` Pull Request resolved: https://github.com/facebook/react-native/pull/27885 Test Plan: ``` const initialTime = global.performance.now(); setTimeout(() => { const newTime = global.performance.now(); console.warn('duration', newTime - initialTime); }, 1000); ``` ### Android + Hermes ![Screenshot_1580198068](https://user-images.githubusercontent.com/13116854/73245757-af0d6c80-41b5-11ea-8130-dde14ebd41a3.png) ### Android + JSC ![Screenshot_1580199089](https://user-images.githubusercontent.com/13116854/73246157-92256900-41b6-11ea-87a6-ac222383200c.png) ### iOS ![Simulator Screen Shot - iPhone 8 - 2020-01-28 at 10 06 49](https://user-images.githubusercontent.com/13116854/73245871-f136ae00-41b5-11ea-9e31-b1eff5717e62.png) Reviewed By: ejanzer Differential Revision: D19888289 Pulled By: rickhanlonii fbshipit-source-id: ab8152382da9aee9b4b3c76f096e45d40f55da6c * Save/restore IP when leaving the interpreter Summary: This diff implements the instruction pointer save/restore trick Tzvetan came up with; allowing us to observe and modify the IP from outside the interpreter loop with negligible overhead. From Tzvetan's internal post on the subject: > [Today] the interpreter IP is just a local variable in the interpreter function, so there is no way to get to its value from outside the function. It lives in a register and we don't want to make it a Runtime field since the overhead [of accessing it via memory in the interpeter loop] would kill us. > However, if you really think about it, it only lives in a register while the interpreter function is running. For the rest of the time, it is spilled by the C++ compiler onto the stack. So, precisely when we need it, it is actually stored in memory. The only problem is, we don't know where! Admittedly, that is an annoying problem, but it feels like it should be solvable. > What if, instead of relying on the compiler to spill the IP register, we manually spill it ourselves, to a known location? It works. Example: https://godbolt.org/z/ftSDnp This diff implements this approach across the whole interpreter loop: whenever we call out of the loop we capture/publish the IP and restore it again immediately after the external call returns. This means we can now see the IP outside the interpret loop and even change it. This is effectively "for free" as the compiler now skips spilling/restoring the IP behind the scenes. The immediate benefit of this is knowing the current IP allows us to have more accurate stack-traces during execution. In future this may enabled tricks like changing the IP before returning to the interpreter loop, allowing things outside the interpreter to affect program flow without adding logic to the interpreter loop. Reviewed By: tmikov Differential Revision: D20151091 fbshipit-source-id: 3814382639800208d8985a32ede31ba8f7ff7c80 * Plumb through memory allocation profiler feature to Chrome Inspector Summary: Changelog: Make allocation profiler feature of Chome Inspector work Reviewed By: dulinriley Differential Revision: D20383003 fbshipit-source-id: 8a10c310d5a639a6644763adb53f2f0017057587 * chore: update lint config in template (#28443) Summary: Updating the eslint config and metro-preset used in project template. ## Changelog [General] [Changed] - Upgrade eslint-config and metro-preset in project template Pull Request resolved: https://github.com/facebook/react-native/pull/28443 Test Plan: - Start new project with `npx react-native init TestLint` - upgrade lint and metro-config - run lint and start up emulator on iOS and android Reviewed By: cpojer Differential Revision: D20771048 Pulled By: hramos fbshipit-source-id: a6d387b8687cee348681bcb10d22c7e3de291ed7 * Apply buckformat in preparation for updating buildifier Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D20773287 fbshipit-source-id: 144bb13191312eef246646b99e1dc06304c6d210 * Circle CI Housekeeping: Windows, e2e (#28471) Summary: Circle CI Housekeeping: * Integrate Windows job into `tests` workflow * Add parametrized e2e tests command * Move js e2e tests out of the disabled test quarantine area * Parametrize and split `test_ios` job to reduce total execution time by ~13 minutes **Before:** Longest running iOS job at 39 minutes. | Setup Job Runtime | Job | Job Runtime | Total Runtime | | - | - | - | - | | 01:24 | test_ios | 38:04 | **39:28** | | 01:24 | test_ios_frameworks | 38:02 | 39:26 | ![Screen Shot 2020-03-31 at 12 40 29 PM](https://user-images.githubusercontent.com/165856/78068308-044c3280-734d-11ea-96bf-2e50691a0ef7.png) **After:** Longest running iOS job down to 26 minutes. | Setup Job Runtime | Job | Job Runtime | Total Runtime | | - | - | - | - | | 01:26 | test_ios_unit | 20:48 | 22:14 | | 01:26 | test_ios_unit_frameworks | 22:52 | 24:18 | | 01:26 | test_ios_detox | 24:35 | 39:28 | | 01:26 | test_ios_detox_frameworks | 24:54 | **26:20** | ![Screen Shot 2020-03-31 at 12 39 22 PM](https://user-images.githubusercontent.com/165856/78068294-fe565180-734c-11ea-96da-8836231d7747.png) ## Changelog [Internal] [CI] - CI Housekeeping Pull Request resolved: https://github.com/facebook/react-native/pull/28471 Test Plan: Circle CI Reviewed By: cpojer Differential Revision: D20774521 Pulled By: hramos fbshipit-source-id: 4a2f5a4083cd76dcb51d5ccaf726cd204fca222e * Fix bug in optimized differ Summary: The differ was still producing correct, but not minimal, instruction sets in some cases due to an optimization that was buggy. This affected cases where 2+ nodes were inserted at the beginning of a list. It would trigger the old behavior where all nodes after the first would be removed, deleted, then reinserted. See the test case (which was failing and now passed) and P128190998 (the 3->4 transition) for samples. Changelog: [Internal] Fabric differ Reviewed By: mdvacca Differential Revision: D20785729 fbshipit-source-id: 2fea6a816753066abb358ed7bb51003140cd5fc4 * Use `buildCodeFrameError` in babel-plugin-inline-view-configs Summary: The next version of Babel changes how it prints file names in errors. This diff fixes the test by using `/` as the `cwd` and switches the plagin to use `path.buildCodeFrameError` so errors will be more helpful for users. I renamed the `nodePath` variable to `path` because that's what babel plugins usually do. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D20781805 fbshipit-source-id: cc149dce6389aa9402ce70ea30035c74a6150ea3 * Swap left and right yoga position with start and end in RTL context Summary: Changelog: [Internal] Paper swaps right and left in RTL setting, this logic is in [RCTShadowView.m](https://our.intern.facebook.com/intern/diffusion/FBS/browse/master/xplat/js/react-native-github/React/Views/RCTShadowView.m?commit=cdd504cfbee66ae0659495604c4ff7b5764a1d9e&lines=529-549). For Fabric instead of doing it during yoga props assignment, I swap the left/right with start/end just before we pass yoga nodes to layout calculation. Reviewed By: shergin Differential Revision: D20420040 fbshipit-source-id: b777f2658f56c173743b2034b8b5059e3e0c9840 * Fix inline-view-configs test on Windows. Summary: *facepalm* The file path is platform specific. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D20793023 fbshipit-source-id: 4fbcbf982911ee449a4fa5067cc0c5d81088ce04 * Pass isRTL flag from FabricUIManager Fabric core Summary: Changelog: [Internal] Send `isRTL` flag and `doLeftAndRightSwapInRTL` flags from Java to Fabric Core. Reviewed By: JoshuaGross, mdvacca Differential Revision: D20776005 fbshipit-source-id: 946c239d9a11ebea958b0a6d04f2316b7cd77311 * Promote shadowColor to formsStackingContext property Summary: Changelog: [Internal] View with `ShadowColor` was getting flattened and therefore views didn't have shadow property set. This is fixed by promoting ShadowColor so in case it is set, it forms stacking context. Reviewed By: shergin Differential Revision: D20792201 fbshipit-source-id: 1033ac00e32047ffbb14e61b7c26348c578d132d * Get CallInvokers from the bridge Summary: ## Context For now, assume TurboModules doesn't exist. **What happens when we call an async NativeModule method?** Everytime JS calls an async NativeModule method, we don't immediately execute it. The legacy infra pushes the call into some queue managed by `MessageQueue.js`. This queue is "flushed" or "emptied" by the following events: - **Flushed:** A C++ -> JS call. NativeModule async methods can called with an `onSuccess` and/or `onFail` callback(s). Calling `NativeToJsBridge::invokeCallback` to invoke one of these callbacks is one way for ObjC++/C++/Java to call into JS. Another way is via JSModule method calls, which are initiated by `NativeToJsBridge::callFunction`. - **Flushed:** When `JSIExecutor::flush` is called. Since TurboModules don't exist, this only happens when we call `JSIExecutor::loadApplicationScript`. - **Emptied:** When more than 5 ms have passed, and the queue hasn't been flushed/emptied, on the next async NativeModule method call, we add to the queue. Afterwards, we empty it, and invoke all the NativeModule method calls. **So, what's the difference between flushed and emptied?** > Note: These are two terms I just made up, but the distinction is important. If the queue was "flushed", and it contained at least one NativeModule method call, `JsToNativeBridge` dispatches the `onBatchComplete` event. On Android, the UIManager module is the only module that listens to this event. This `onBatchComplete` event doesn't fire if the queue was "emptied". **Why does any of this matter?** 1. TurboModules exist. 2. We need the TurboModules infra to have `JsToNativeBridge` dispatch `onBatchComplete`, which depends on: - **Problem 1:** The queue being flushed on calls into JS from Java/C++/ObjC++. - **Problem 2:** There being queued up NativeModule async method calls when the queue is flushed. In D14656466, fkgozali fixed Problem 1 by making every C++/Java/Obj -> JS call from TurboModules also execute `JSIExecutor::flush()`. This means that, with TurboModules, we flush the NativeModule async method call queue as often as we do without TurboModules. So far, so good. However, we still have one big problem: As we convert more NativeModules to TurboModules, the average size of the queue of NativeModule method calls will become smaller and smaller, because more NativeModule method calls will be TurboModule method calls. This queue will more often be empty than not. Therefore, we'll end up dispatching the `onBatchComplete` event less often with TurboModules enabled. So, somehow, when we're about to flush the NativeModule method call queue, we need `JsToNativeBridge` to understand that we've executed TurboModule method calls in the batch. These calls would have normally been queued, which would have led the queue size to be non-zero. So if, during a batch, some TurboModule async method calls were executed, `JsToNativeBridge` should dispatch `onBatchComplete`. **So, what does this diff do?** 1. Make `Instance` responsible for creating the JS `CallInvoker`. 2. Make `NativeToJsBridge` responsible for creating the native `CallInvoker`. `Instance` calls into `NativeToJsBridge` to get the native `CallInvoker`. 3. Hook up `CatalystInstanceImpl`, the Android bridge, with the new JS `CallInvoker`, and the new native `CallInvoker`. This fixes `onBatchComplete` on Android. iOS work is pending. Changelog: [Android][Fixed] - Ensure `onBatchComplete` is dispatched correctly with TurboModules Reviewed By: mdvacca Differential Revision: D20717931 fbshipit-source-id: bc3ccbd6c135b7f084edbc6ddb4d1e3c0c7e0875 * Make HermesRuntime::description() always include "HermesRuntime" Summary: If name is passed in as part of RuntimeConfig, that is included in the description, too. Changelog: [Internal] Reviewed By: dulinriley Differential Revision: D20716320 fbshipit-source-id: f2fba6df32f496090dee787d8b7f55a6a4dd8ed8 * Fix Yoga flexshrink with min-width sizing issue Summary: While resolving the flexible items we calculate totalFlexShrinkScaledFactors which uses the flexBasis or initial width of node (Not min-width). At a later stage during distribution of space we are subtracting value from this which also takes care of min-width. For example If node has flexShrink 1 and width 100 and min-width 301 then totalFlexShrinkScaledFactors will become -1*100 = -100 but later we are subtracting -1 * 301 (min-width) = -301 which is ambiguous and causing layout inconsistencies with how web behaves. Fixed this by only using the flexBasis or width for these calculations. Changelog: [Internal][Yoga] Fix layout issue when flexShrink and min-width are used together Reviewed By: pasqualeanatriello Differential Revision: D20219419 fbshipit-source-id: 948fbc06ca541d4ad307c88c8a2df65d157778b1 * More consistent snapshots on windows (#28482) Summary: Get jest tests to be runnable on windows, and match current snapshots ## Changelog [Internal] [Fixed] - More consistent snapshots on windows Pull Request resolved: https://github.com/facebook/react-native/pull/28482 Test Plan: run `yarn test` on a windows machine, and hit the test_windows circleci tests Reviewed By: hramos Differential Revision: D20799002 Pulled By: cpojer fbshipit-source-id: da3db0171c34a43199c7d3dc17b622b37bc91701 * Improve component stack parsing Summary: Update the error log message parsing to fix missing component stacks in console.errors. Changelog: [Internal] Reviewed By: cpojer Differential Revision: D20801985 fbshipit-source-id: ae544200315a8c3c0310e8370bc38b0546734f38 * Implement RCTWarn equivalent on Android Summary: ## Overview This diff is an RFC to port a logging feature from iOS to Android. Changelog: [Internal] ## Motivation On iOS we have the following log functions and behaviors available for logging native warnings and errors: - **Warnings** (`RCTLogWarn`) - Log level 'warn' to console - Display warning in LogBox - **Errors** (`RCTLogError`) - Log level 'error' to console - Display a native RedBox (needs converted to show a LogBox if available) - **Logs** - We also have `RCTLog`, `RCTTrace`, `RCTAdvice`, `RCTInfo`, which just log to the console. In Java, we have: - **Warnings** - **None**, added in this diff - **Errors** (`DevSupportManager.showNewJavaError`) - Log level 'error' to console with `FLog.e` - Display a native RedBox (needs converted to show a LogBox if available - **Logs** - `ReactSoftException` (crashes the app??) - `ReactNoCrashSoftException` (only logs??) - Others? ## Details This diff adds a method to pair with `RCTLogWarn`, `DevSupportManager.showNewJavaWarning`, which will log to the console and show a LogBox warning if LogBox is available. ## Concerns I have a few concerns/questions about the state of logging on Android: - Should/can we move all of the logging to it's own class, like how RCTLog works? - Why does some logging happen on DevSupportManager and some in other classes? - If we moved it all to it's own class, how could we access the reactContext to call the RCTLog JS module Reviewed By: JoshuaGross Differential Revision: D20056394 fbshipit-source-id: 32d57e300685e46da8039fc77cb22b4084acf81a * Remove unused feature flag: useMapNativeAccessor Summary: useMapNativeAccessor isn't being used anywhere. Changelog: [Internal] Removing unused internal feature flags: mUseMapNativeAccessor and mUseArrayNativeAccessor Reviewed By: mdvacca Differential Revision: D20788147 fbshipit-source-id: bf670508326813602cb544f86d3d2164651d3394 * Remove unused Feature Flag: lazilyLoadViewManagers Summary: Remove unused feature flag. This is not used within Facebook and I'm not aware of usage outside of FB. Changelog: [Removed] Removing Android feature flag: lazilyLoadViewManagers Reviewed By: mdvacca Differential Revision: D20788210 fbshipit-source-id: 435316e3de7830d7cb7f14537351883e4fc6eeaa * Remove unused feature flag: enableExtraWebViewLogs Summary: Hard-coded to false everywhere, and write-only. We never read from this. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20788252 fbshipit-source-id: ae117ebc51db7045947b9713602527ff4220833e * Remove unused feature flag: logDroppedViews Summary: Remove unused internal feature flag, logDroppedViews. Changelog: [Internal] Reviewed By: lunaleaps Differential Revision: D20797353 fbshipit-source-id: 1bfea7fcce9e80cdb92cda59a89c7dd817d4a581 * Split loadApplicationScript into initializeRuntime and loadBundle (#27844) Summary: This is the first of three PRs related to enabling multi-bundle support in React Native. More details, motivation and reasoning behind it can be found in RFC [here](https://github.com/react-native-community/discussions-and-proposals/issues/152). Logic responsible for installing globals was pulled out from `loadApplicationScript` to `initializeRuntime` since it should be ran only once, what was left was renamed to `loadBundle`. It's based on dratwas work from [here](https://github.com/callstack/react-native/tree/feat/multibundle/split-load-application), but applied to current `master` to avoid rebasing 3-months old branch and issues that come with that. ## Changelog [Internal] [Changed] - split `loadApplicationScript` into `initializeRuntime` and `loadBundle` to enable multi-bundle support in the future Pull Request resolved: https://github.com/facebook/react-native/pull/27844 Test Plan: Initialized new RN app with CLI, set RN to build from source and verified the still app builds and runs OK using code from this branch. Reviewed By: rickhanlonii Differential Revision: D19888605 Pulled By: ejanzer fbshipit-source-id: 24ace48ffe8978796591fe7c6cf53a61b127cce6 * Back out "Fix controlled TextInput with child nodes" Summary: Changelog: [Internal] Original commit changeset: 1b8a2efabbfa Original diff D20587681 breaks non-controlled text input. Reviewed By: motiz88 Differential Revision: D20815935 fbshipit-source-id: 70577ed1e5701850ff0e30a6592945a31c2a8bec * Fixed crash in JSIExecutor::NativeModuleProxy Summary: JSIExecutor::NativeModuleProxy is an object created by JSIExecutor and essentially representing that in JavaScript world. Before this change, JSIExecutor::NativeModuleProxy had a raw reference to JSIExecutor which (I believe) caused a crash because JSIExecutor can be deallocated before JSIExecutor::NativeModuleProxy. Now, instead of storing a pointer to JSIExecutor, we store a weak pointer to JSINativeModules which we can safely validate before calling on it. Changelog: [Internal] Fixed crash in JSIExecutor Now the configuration looks like this: ``` + - - - - - - - - - - - - - - - - - - - - - Something else | | shared_ptr<jsi::Runtime> runtime --+ | | + - - - - - - - - - - - - - - - - - - - - - | | | +------------------------------------------+ | | | | | JSExecutorFactory | | +--------------------------------+-------------------------------+ | | +-----------------------+ | | | +------------------------------------------+ | | v | | | +------------------------------------------+ | +--------------------------+ | | | | | | | | ModuleRegistry | | v | | | | | +------------------------------------------+ | | +------------------------------------------+ | | HermesRuntimeImpl | | | | | | (jsi::Runtime) |--+ | | +->+------------------------------------------+ | | | | | | | |std::unordered_map<std::string, size_t> | | +------------------------------------------+ | | | | |modulesByName_ | | | | | | | | | | | | | +------------------------------------------+ | | | | +->+------------------------------------------+ | +-----------------------+ | | |std::vector<std::unique_ptr<NativeModule>>| | | | | |modules_ | | | | | | | | v | | +------------------------------------------+ | +------------------------------------------+ | | | | | | | | | JSIExecutor::NativeModuleProxy | | | | | | | | | +------------------------------------------+ | | | +------------------------------------------+ | | | | | | +->+------------------------------------------+ | | | | NativeToJsBridge | |shared_ptr<JSINativeModules> | | | | | | |nativeModules_ | | | | +------------------------------------------+ +------------------------------------------+--+-----+------------------------------------+ | | | | | | +->+------------------------------------------+ | | | | | |unique_ptr<JSExecutor> | | | | | | |m_executor | | | | | | |(`::destroy()` resets it.) | | | | | | +------------------------------------------+--------------------------------+ | | | | +->+------------------------------------------+ | | | | | | |shared_ptr<JsToNativeBridge> | | | | | | | |m_delegate | | | | | | | +------------------------------------------+--+ v | | | | +->+------------------------------------------+ | +------------------------------------------+ | | | | |shared_ptr<MessageQueueThread> | | | | | | | | |m_executorMessageQueueThread | | | HermesExecutor: JSIExecutor: JSExecutor | | | | | +------------------------------------------+ | | | | | | | | +------------------------------------------+ | | | | | | | | | | | +->+------------------------------------------+ | | | | | | |shared_ptr<jsi::Runtime> | | | | | | | |runtime_ | | | | | | | +------------------------------------------+--+ | | | | +->+------------------------------------------+ | | | | | |shared_ptr<JSINativeModules> | | | | | | |nativeModules_ | | | | | | +------------------------------------------+--------+------------------------------------+ | +--------------------------+ +->+------------------------------------------+ | | | | |std::shared_ptr<ExecutorDelegate> | | v | | |delegate_ | | +------------------------------------------+ | | +------------------------------------------+--+ | | | | | | | | JSINativeModules | | | | | | | | | | | +------------------------------------------+ | | | | | | | | | +-->+------------------------------------------+ | +-----------------------------------------------------------------------------------+ | |m_moduleRegistry | | | | |(shared_ptr) | | | | +------------------------------------------+--+ | | | | v | +------------------------------------------+ | | | | | JsToNativeBridge: ExecutorDelegate | | | | | +------------------------------------------+ | | | +->+------------------------------------------+ | |shared_ptr<ModuleRegistry> | | |m_registry | | +------------------------------------------+-----------------------------------------------------------------+ ``` Reviewed By: RSNara Differential Revision: D20817257 fbshipit-source-id: 9ae378dbe880aaabfef7ae783dae2f94ee4b0af5 * Fix crash caused by <Modal> trying to present view controller twice Summary: Changelog: [Internal] `_viewController` was being presented twice causing following exception ``` 'Application tried to present modally an active controller <FBReactRootViewController: 0x7fe741818b80; ``` Reviewed By: shergin Differential Revision: D20820395 fbshipit-source-id: 5c9489011e5f99d8bd37befbd544d2d55a650589 * Loosen up restrictions for internal changelogs (#28486) Summary: Do not nag on PRs that contain internal changelogs (meaning, the change doesn't need to be called out in release notes). ## Changelog [Internal] - This should be acceptable. Pull Request resolved: https://github.com/facebook/react-native/pull/28486 Test Plan: See PR. Reviewed By: cpojer Differential Revision: D20817454 Pulled By: hramos fbshipit-source-id: a7082c4db05ec53ad27349db7e5bce2cfffd6930 * Fix TextInlineViews when UIImplementation processes two roots at the same time Summary: This diff cleans the variable NativeViewHierarchyOptimizer.mTagsWithLayoutVisited right after all the view updates for a rootShadowNode have been processed by the UIImplementation class. This intends to fix the bug reported in the task: T61185028, which root cause seems related to the fact that the variable NativeViewHierarchyOptimizer.mTagsWithLayoutVisited is not cleaned up when updating multiple rootShadowNodes as part of the same batch changelog: [Android][internal] internal bug fix Reviewed By: JoshuaGross Differential Revision: D20812921 fbshipit-source-id: 28067ee29a931d7a9e9c33c90aceb4e3512dac1a * Add a React Feature Flag to control TextInlineView fix Summary: This diff adds a temporary Feature Flag to control a fix in TextInlineView (see previous diffs of the stack) changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D20812920 fbshipit-source-id: 90fece9b29ba173546d96e4d9baf1ccabb3031b2 * Pass native CallInvoker to ObjCTurboModule constructor Summary: This is necessary to integrate TurboModule async method dispatch with the bridge's `onBatchComplete` event. See D20717931 for more details. This diff is similar to D20480971. **Note:** This stack doesn't really make any functional changes, since the native CallInvoker is `nullptr` right now. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809199 fbshipit-source-id: bf465a3a51bdddb8b56d1e696ca510fdf071f9ec * Manual changes required to make ObjCTurboModule accept native CallInvoker Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809200 fbshipit-source-id: d540eec9a3360a031f75d76a6ab9fb15303f8af5 * Codemod all getTurboModuleWithJsInvoker methods to accept a native CallInvoker Summary: To make iOS TurboModules integrate with the bridge's onBatchComplete event, they need to use a native CallInvoker. This call invoker is created by the `NativeToJsBridge`, and ObjCTurboModule will use this native CallInvoker to dispatch TurboModule method calls. This diff makes sure that ObjCTurboModules are created with that native CallInvoker. ## Script ``` var withSpaces = (...args) => args.join('\s*') var regexString = withSpaces( '-', '\(', 'std::shared_ptr', '<', '(?<turboModuleClass>(facebook::react::|react::|::|)TurboModule)', '>', '\)', 'getTurboModuleWithJsInvoker', ':', '\(', 'std::shared_ptr', '<', '(?<callInvokerClass>(facebook::react::|react::|::|)CallInvoker)', '>', '\)', '(?<jsInvokerInstance>[A-Za-z0-9]+)', 'perfLogger', ':', '\(', 'id', '<', 'RCTTurboModulePerformanceLogger', '>', '\)', '(?<perfLoggerInstance>[A-Za-z0-9]+)', '{', 'return', 'std::make_shared', '<', '(?<specName>(facebook::react::|react::|::|)Native[%A-Za-z0-9]+SpecJSI)', '>', '\(', 'self', ',', '\k<jsInvokerInstance>', ',', '\k<perfLoggerInstance>', '\)', ';', '}', ) var replaceString = `- (std::shared_ptr<$<turboModuleClass>>) getTurboModuleWithJsInvoker:(std::shared_ptr<$<callInvokerClass>>)$<jsInvokerInstance> nativeInvoker:(std::shared_ptr<$<callInvokerClass>>)nativeInvoker perfLogger:(id<RCTTurboModulePerformanceLogger>)$<perfLoggerInstance> { return std::make_shared<$<specName>>(self, $<jsInvokerInstance>, nativeInvoker, $<perfLoggerInstance>); }` const exec = require('../lib/exec'); const abspath = require('../lib/abspath'); const relpath = require('../lib/relpath'); const readFile = (filename) => require('fs').readFileSync(filename, 'utf8'); const writeFile = (filename, content) => require('fs').writeFileSync(filename, content); function main() { const tmFiles = exec('cd ~/fbsource && xbgs -n 10000 -l getTurboModuleWithJsInvoker:').split('\n').filter(Boolean); tmFiles .filter((filename) => !filename.includes('microsoft-fork-of-react-native')) .map(abspath) .forEach((filename) => { const source = readFile(filename); const newSource = source.replace(new RegExp(regexString, 'g'), replaceString); if (source == newSource) { console.log(relpath(filename)); } writeFile(filename, newSource); }); } if (!module.parent) { main(); } ``` Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809202 fbshipit-source-id: 5d39b3cacdaa5681b70ce1803351d0432dd74550 * Make RCTTurboModuleManagerDelegate getTurboModule accept native CallInvoker and PerfLogger Summary: Might be worthwhile to just kill this method instead, since we're having all NativeModules provide their TurboModule jsi::HostObjects. But I'll leave that decision to a later time. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809201 fbshipit-source-id: ee73d4b5454a76460832a54f9b864841e5b2b9c0 * eslint-config: add version badge and add homepage for eslint-config (#28506) Summary: Add version badge to README of eslint-config, and add specific url for the homepage so people looking at the npm package can find out where the package is from. ## Changelog [Internal] [Changed] - Add version badge to README of eslint-config Pull Request resolved: https://github.com/facebook/react-native/pull/28506 Test Plan: Not required as the only changes are made in README and homepage prop of package.json Differential Revision: D20837085 Pulled By: cpojer fbshipit-source-id: 820d3b44b069780ec8764c6152d2e7fd5220933c * Rename Instance::getNativeCallinvoker to Instance::getDecoratedNativeCallInvoker Summary: Now, instead of accepting a `std::function` that schedules work, and returning a `CallInvoker`, `Instance::getDecoratedNativeCallInvoker` will accept a `CallInvoker` that schedules work, and return a decorated `CallInvoker`. I think this change will help with readability. It also clarifies that the bridge is adding additional behaviour to the native `CallInvoker`. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20826885 fbshipit-source-id: a2c5681d10a4544ee3d2a0d1f1cbd386ef06d0e6 * Add CallInvoker::invokeSync Summary: We'll be using a native CallInvoker to dispatch sync and async method calls to ObjC NativeModules. This native CallInvoker will hold a reference to the ObjC NativeModule's method queue. **Why is the native CallInvoker required for ObjC NativeModules?** In the case where the ObjC NativeModule neither provides nor requests a method queue, we must create a method queue for it. When we go to invoke a method from JS, for these NativeModules specifically, there is no way to access this method queue. A native CallInvoker is a convenient abstraction that holds on to that method queue. For async calls, we'll just call `CallInvoker::invokeAsync`, and for sync calls, we'll just call `CallInvoker::invokeSync`. **Why do we need sync call support for native `CallInvoker`?** In ObjC, sync NativeModule method calls block the JS thread, then execute synchronously on the NativeModule's method queue, and then unblock the JS thread. This is what'll be implemented by `CallInvoker::invokeSync`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20829955 fbshipit-source-id: efb9d5408a1ade81069a943c865f232d4d10acfe * Export Instance::getDecoratedNativeCallInvoker from RCTCxxBridge Summary: `RCTTurboModuleManager` will create a native `CallInvoker` for each ObjC NativeModule. This `CallInvoker` will be used to dispatch calls from JS to native. Before passing the native `CallInvoker` to the `ObjCTurboModule`, it'll first use `RCTCxxBridge decorateNativeCallInvoker` to get a bridge-aware decorated native `CallInvoker`. That way, the bridge remains informed about async TurboModule method calls that took place since the last time it was flushed. This ensures that we don't end up dispatching `onBatchComplete` any less with TurboModules on than we do with TurboModules off. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20831546 fbshipit-source-id: b2eb4e0097e0dabf8c4bd8fdc4c850a0858af699 * Add Author Feedback label automatically (#28484) Summary: Improve issue triage by automatically adding the "Needs: Author Feedback" label. NOTE: The old label-actions app should be disabled when this PR is merged: https://github.com/apps/label-actions/installations/7445225 ## Changelog [Internal] - Issue Triage Pull Request resolved: https://github.com/facebook/react-native/pull/28484 Test Plan: Verified the same `label-actions.yml` and workflow config on a private repo. Reviewed By: cpojer Differential Revision: D20817443 Pulled By: hramos fbshipit-source-id: 39732dd67509c9fb9cf6ff7306913f5ec088266d * docs: add README and specify file in package.json (#28507) Summary: Adding a README for `react-native-codegen` since the package was published. Also added a `files` prop in package.json so unused file won't be included in the package. ## Changelog [Internal] [Changed] - Add README for react-native-codegen. Pull Request resolved: https://github.com/facebook/react-native/pull/28507 Test Plan: verify js files to function correctly without including files other than `src` Reviewed By: rickhanlonii Differential Revision: D20836113 Pulled By: cpojer fbshipit-source-id: e860f14760e9c1dbe121f5fb95ccf72d4ddb2af1 * Make the link easier to copy. (#28516) Summary: Making a PR from GitHub, I need to copy-paste the link, and it would be easier to just triple-click a line with the URL rather than carefully selecting the URL from the text. <img width="723" alt="Screen Shot 2020-04-03 at 17 33 47" src="https://user-images.githubusercontent.com/100233/78378550-6c12af80-75d1-11ea-93a4-2eae568ce602.png"> ## Changelog [General] [Changed] - Make PR template easier to use with changelog URL. Pull Request resolved: https://github.com/facebook/react-native/pull/28516 Reviewed By: fkgozali Differential Revision: D20842238 Pulled By: hramos fbshipit-source-id: 3fef7a994f36a996bbbc52556600d468a56210a9 * Upgrade tests to Xcode 11.3.1 (#28498) Summary: Upgrade Sandcastle and Circle CI tests to use Xcode 11.3.1 across the board. Pull Request resolved: https://github.com/facebook/react-native/pull/28498 Pull Request resolved: https://github.com/facebook/react-native/pull/28501 Changelog: [Internal] - Use Xcode 11.3.1 in iOS tests Reviewed By: fkgozali Differential Revision: D20821844 fbshipit-source-id: b250ca82bdf2c9fb7faa765d3e2433eb46efd692 * Fixes iOS reload through metro "r" command key (#28477) Summary: This allows the iOS device to be reloaded through the metro command line, besides the fact that whenever packagerServerHost is called, it will only get the IP address once when debugging. ## Changelog [iOS] [Fixed] - Fixed connection of metro reload command to iOS device Pull Request resolved: https://github.com/facebook/react-native/pull/28477 Test Plan: - Build any react-native project in debug mode to an iOS device connected through USB - Press the “r” key on the terminal that is running metro - The device should now reload the project Reviewed By: cpojer Differential Revision: D20818462 Pulled By: TheSavior fbshipit-source-id: 6d9792447d205223dad8fbd955518885427cbba8 * Create method queues for NativeModules that neither provide nor request one Summary: ## Problem: Let `A` be the set of all ObjC NativeModules that neither provide nor reqeust a method queue. The TurboModule system dispatches all method calls to NativeModules in `A` synchronously to the JS thread. Here is the relevant logic: **RCTTurboModule.mm:** Link: https://fburl.com/diffusion/nz9gqje8 ``` jsi::Value performMethodInvocation( // ... ) { // ... dispatch_queue_t methodQueue = NULL; if ([instance_ conformsToProtocol:protocol(RCTBridgeModule)] && [instance_ respondsToSelector:selector(methodQueue)]) { methodQueue = [instance_ performSelector:selector(methodQueue)]; } if (methodQueue == NULL || methodQueue == RCTJSThread) { // This is the default mode of execution: on JS thread. block(); } else if (methodQueue == dispatch_get_main_queue()) { ``` **Why does this end up happening?** 1. NativeModules that request a method queue have `synthesize methodQueue = _methodQueue` in their `implementation` section. This generates a `methodQueue` getter for the NativeModule, and also creates an ivar to back that getter. The TurboModule system generates a `dispatch_queue_t` and uses ObjC's KVC API to write to the ivar. So in the above logic, for NativeModules that provide a method queue, methodQueue will neither be `NULL` nor `RCTJSThread`, so we don't dispatch synchronously to the JS thread. 2. NativeModules that provide a method queue will return something that is not `NULL` or something that is `RCTJSThread`. If they return `NULL`, the infra will throw an error early. If they return `RCTJSThread`, we'll dispatch synchronously to the JS thread, as we should (...wait. For async NativeModule methods that dispatch to `RCTJSThread`, should we dispatch asynchronously to the JS thread, via jsInvoker? **Edit:** Nope: https://fburl.com/diffusion/ivt9b40s.). In all other cases, we dispatch to appropriately to the respective method queue. 3. For NativeModules that neither provide nor request a method queue (i.e: NativeModules in `A`), they don't implement the `methodQueue` selector. Therefore, we dispatch synchronously to the JS thread. ## The fix (Part 1): The first step towards fixing this problem is to generate `dispatch_queue_t`s for NativeModules in `A`. That's what this diff accomplishes. Changelog: [iOS][Fixed] - Create method queue for NativeModules that don't provide nor request one. Reviewed By: fkgozali Differential Revision: D20821054 fbshipit-source-id: 17a73550ad96766c5c7e719e28e1cc879e36465c * Rename duplicate name `<ScrollView>` example on RNTester (#28515) Summary: Tiny change. When searching for `scro` in the RNTester, two `<ScrollView>`s come up, from different example files. One is the "simple" one and the other is the "regular" one. Before: <img width="370" alt="Screen Shot 2020-04-03 at 17 14 01" src="https://user-images.githubusercontent.com/100233/78377338-c6ab0c00-75cf-11ea-9c45-2dcdd6460f6d.png"> After: <img width="369" alt="Screen Shot 2020-04-03 at 17 13 38" src="https://user-images.githubusercontent.com/100233/78377371-cf034700-75cf-11ea-89ea-aa3ff2f3988c.png"> ## Changelog [Internal] [Changed] - Rename the "simple" ScrollView example in RNTester to "ScrollSimpleView". Pull Request resolved: https://github.com/facebook/react-native/pull/28515 Test Plan: - Try to search for `scro` in RNTester. Reviewed By: fkgozali Differential Revision: D20842264 Pulled By: hramos fbshipit-source-id: 3db54a826ae774108e62690e7f154e85b541520f * Fix Fabric SSTs, so they actually run in Fabric instead of Paper, convert ServerSnapshotTestsAppImpl to functional component Summary: Update instrumentation test infra for Fabric tests. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D19961919 fbshipit-source-id: 17264b6308712dddece730effd57832817e148cf * Fixed scrollview inset when RN view is embedded in another view (#27607) Summary: I'm using RNN, which embeds RN view inside native view controllers. On iOS 13, a modal view controller is "floating" and is offset from the top of the screen. This causes the calculation of inset in `KeyboardAvoidingView` incorrect as it mixes local view controller coordinate space, with keyboard's screen coordinate space. ## Changelog [iOS] [Fixed] - Fixed `KeyboardAvoidingView` inset in embedded views (i.e modal view controllers on iOS 13) Pull Request resolved: https://github.com/facebook/react-native/pull/27607 Test Plan: 1. Tested before and after in a simple view controller (should stay the same) 2. Tested before and after in a modal view controller (should be offset before, and fixed after) 3. Repeated no. 2 with each device rotation (upsideDown, landscapeLeft, landscapeRight) Reviewed By: cpojer Differential Revision: D20812231 Pulled By: TheSavior fbshipit-source-id: fbd72739fb7152655028730e284ad26ff4a5da73 * Bump react-native-codegen to 0.0.2 Summary: Changelog: [Internal] Reviewed By: cpojer Differential Revision: D20843514 fbshipit-source-id: c611bf91d311c6ce8a7e469d267a0417b2ee58e5 * Rename ScrollViewSimpleExample Summary: Changelog: [Internal] - Rename ScrollViewSimpleExample in RNTester Reviewed By: fkgozali Differential Revision: D20846977 fbshipit-source-id: 397589cb0a17beaf37a25b91ad8efa4a2bc62358 * Remove console warnings for innerViewNode/Ref Summary: Remove these warnings until the methods in ScrollResponder have been moved into ScrollView, so that unactionable warnings aren't firing. Changelog: [General][Removed] Remove console warnings for innerViewNode/Ref in ScrollView Reviewed By: TheSavior Differential Revision: D20850624 fbshipit-source-id: ce90988e204c3cc3b93536842ec3caa12cf6994e * Make TurboModules dispatch method calls via native CallInvoker Summary: This diff: 1. Has ObjC NativeModules use the native `CallInvoker` to invoke JS -> native sync/async calls. 2. Integrates the native `CallInvoker` for each ObjC NativeModule with the bridge. This way, the bridge is informed of all JS -> native TurboModule method calls, and dispatches `onBatchComplete` appropriately. Changelog: [iOS][Fixed] Integrate ObjC TurboModules async method calls with the bridge Reviewed By: fkgozali Differential Revision: D20831545 fbshipit-source-id: da1cbb4ecef4cae85841ca7ef625ab8e380760cd * add ripple config object to Pressable (#28156) Summary: Motivation is to support ripple radius just like in TouchableNativeFeedback, plus borderless attribute. See https://github.com/facebook/react-native/pull/28009#issuecomment-589489520 In the current form this means user needs to pass an `android_ripple` prop which is an object of this shape: ``` export type RippleConfig = {| color?: ?ColorValue, borderless?: ?boolean, radius?: ?number, |}; ``` Do we want to add methods that would create such config objects - https://facebook.github.io/react-native/docs/touchablenativefeedback#methods ? ## Changelog [Android] [Added] - support borderless and custom ripple radius on Pressable Pull Request resolved: https://github.com/facebook/react-native/pull/28156 Test Plan: Tested locally in RNTester. I noticed that when some content is rendered after the touchables, the ripple effect is "cut off" by the boundaries of the next view. This is not specific to Pressable, it happens to TouchableNativeFeedback too but I just didn't notice it before in https://github.com/facebook/react-native/pull/28009. As it is an issue of its own, I didn't investigate that. ![pressable](https://user-images.githubusercontent.com/1566403/75098762-785f2200-55ba-11ea-8842-e648317610e3.gif) I changed the Touchable example slightly too (I just moved the "custom ripple radius" up to show the "cutting off" issue), so just for completeness: ![touchable](https://user-images.githubusercontent.com/1566403/75098763-81e88a00-55ba-11ea-9528-e0343d1e054b.gif) Reviewed By: yungsters Differential Revision: D20071021 Pulled By: TheSavior fbshipit-source-id: cb553030934205a52dd50a2a8c8a20da6100e23f * Make TurboModule creation thread-safe Summary: NativeModules can be created from any number of threads. In the legacy system, `ModuleHolder`, the class responsible for creating NativeModules, has built-in concurrency control to ensure that NativeModule creation is thread-safe. This diff introduces that thread-safety to the TurboModule infra. Basically, after this diff, if `n` threads race to create a TurboModule x, only the first thread will create x. All other threads will wait until x is created. Changelog: [Android][Fixed] - Make TurboModule creation thread-safe Reviewed By: mdvacca Differential Revision: D20659799 fbshipit-source-id: 2b720fe1ea49e40ae0d6dae50d422f23a6f45520 * Remove unused fields from error dialog Summary: Removed in https://github.com/facebook/react/pull/18487 Changelog: [React Core] Logging changes Reviewed By: gaearon Differential Revision: D20853086 fbshipit-source-id: 4b0002f21269f415769a2ac8305ba5750245f7d1 * Fix crash when enabling Performance Monitor on iOS 13.4 (#28512) Summary: This PR fixes a crash when opening the Performance Monitor on iOS 13.4. Detailed info: https://github.com/facebook/react-native/issues/28414 ## Changelog `[iOS] [Fixed] - Fix crash when enabling Performance Monitor on iOS 13.4` ## How This PR prevents the JavaScriptCore option from being set altogether. This ensures that the performance monitor keeps working, but on iOS 13.4 and higher, it will no longer crash trying to show the GC usage. Pull Request resolved: https://github.com/facebook/react-native/pull/28512 Test Plan: Tested on iOS 13.4 (simulator): ![image](https://user-images.githubusercontent.com/6184593/77903803-c6370c00-7283-11ea-8b71-b6b6546c82f6.png) Tested on iOS 13.1 (simulator) ![image](https://user-images.githubusercontent.com/6184593/77903499-41e48900-7283-11ea-9d14-83f67a3b7b77.png) - Verified that the `setOption` was called, but the Performance Monitor didn't show any GC usage regardless. - Identical PR https://github.com/expo/react-native/pull/21 has been shipped and tested in Expo Client 37 Fixes https://github.com/facebook/react-native/issues/28414 Reviewed By: PeteTheHeat Differential Revision: D20851131 Pulled By: TheSavior fbshipit-source-id: ff96301036e8487db59f95947bbe6841fe230e1e * Modify warning message (#28514) Summary: Modify deprecation warning message for `AccessibilityInfo.fetch` - https://reactnative.dev/docs/accessibilityinfo#isscreenreaderenabled - https://github.com/facebook/react-native/commit/523ab8333800afbfb169c6fd70ab6611fe07cc2a ## Changelog [Internal] [Changed] - Modify deprecation warning message for `AccessibilityInfo.fetch` Pull Request resolved: https://github.com/facebook/react-native/pull/28514 Test Plan: Try using `AccessibilityInfo.fetch` and check log Reviewed By: cpojer Differential Revision: D20850223 Pulled By: TheSavior fbshipit-source-id: e21bb20b7a02d9f2ed6e27e2bfecbac0aebf9e09 * Set _borderLayer.frame when border changes Summary: Changelog: [Internal] Setting `_borderLayer.frame` inside `-[RCTViewComponentView layoutSubviews]` causes unwanted animation because it is not wrapped in `CATransaction`. Moving it to `-[RCTViewComponentView updateLayoutMetrics]` which is called inside `CATransaction`. Reviewed By: shergin Differential Revision: D20836890 fbshipit-source-id: 2048a25fd2edb8109f6275c1186c0adae4b9f504 * Add API for getting sourceURL directly from ReactContext Summary: In bridgeless mode, the CatalystInstance doesn't exist, but we still need to be able to access the sourceURL in SourceCodeModule (which is needed to render the images in LogBox warnings and errors). This diff adds a new API for getting the sourceURL directly from ReactContext, instead of having to call context.getCatalystInstance().getSourceURL(), and updates SourceCodeModule to use it. Changelog: [Internal] Reviewed By: RSNara Differential Revision: D20848700 fbshipit-source-id: 3ecda81a17121178b76bbb3e9b0f27f103c1961a * imp: Remove unused `npx` reference (#28544) Summary: Recently we removed `npx` usage from `react-native-cli` flow. After checking usages in this repo I found unused reference. ## 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] [Removed] - Remove unused `npx` reference Pull Request resolved: https://github.com/facebook/react-native/pull/28544 Test Plan: Tests pass Reviewed By: cpojer Differential Revision: D20873090 Pulled By: hramos fbshipit-source-id: 12e05e9635a83f19439024766817e4599320af98 * Add debug logs to track down T62192299 exception source Summary: Add debug logs to track down T62192299 exception source Changelog: [Internal] Reviewed By: RSNara Differential Revision: D20878063 fbshipit-source-id: 94acd56c45d4b529a695d1b4d2bfd10d8f725e63 * Back out "Fixed scrollview inset when RN view is embedded in another view" Summary: Original commit changeset: fbd72739fb71 Changelog: Back out "[react-native][PR] Fixed scrollview inset when RN view is embedded in another view" Reviewed By: TheSavior Differential Revision: D20878607 fbshipit-source-id: 0d77b9fb08c637f7894c399a219a242e472b0700 * Fail silently in AppStateModule.sendEvent if CatalystInstance is not available Summary: According to our logs, 80% of these warnings are coming from AppStateModule. It's not particularly interesting or surprising that the CatalystInstance would be torn down when there's some app event, so let's stop taking up DB space with a useless message. Reviewed By: ejanzer, mdvacca Differential Revision: D20879426 fbshipit-source-id: b1182461aed4a66d82cb34bbd4b12782af6ed7b3 * Move DebugEnvironment helper to open source Summary: This is an internal only module that we use to detect whether we are in async debugging mode. Changelog: [Internal] Reviewed By: yungsters Differential Revision: D20879780 fbshipit-source-id: 5915f4e1c54a3fda0cf607c77f463120264fdbc4 * Fix Appearance module when using Chrome Debugger Summary: The appearance module uses sync native module methods which doesn't work with the chrome debugger. This broke in 0.62: https://github.com/facebook/react-native/issues/26705 This fix makes the appearance module return 'light' when using the chrome debugger. Changelog: [Fixed] Appearance `getColorScheme` no longer breaks the debugger Reviewed By: yungsters Differential Revision: D20879779 fbshipit-source-id: ad49c66226096433bc9f270e004ad4a6f54fa8c2 * Extend Android ImageViewManager to support analyticsTag prop Summary: This diff extends the Android Image View manager to support the new analyticsTag prop. this prop is going to be used to track performance for images in android changelog: [Android][Added] Add analyticsTag prop into ImageView component Reviewed By: JoshuaGross Differential Revision: D20880602 fbshipit-source-id: e302e8fa83706e6517b228d44a3094a1686830f7 * Extend Image.android to support analyticsTag prop Summary: Quick diff to extend Image.android component to support analytics tag prop changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D20880601 fbshipit-source-id: 99bc11f36ce46953c00480f7c8d628cf6c0a9263 * Create ImageContext object to allow udpating the analyticsTag prop for RN sections Summary: As part of this diff I create the new ImageContext object that will be used to allow the update of the analyticsTag prop for components that contain multiple images in their view hierarchy changelog: [JS][Added] Add ImageContext object, this object can be used to update the Imageview's analyticsTag prop on RN components that contain multiple images in their view hierarchy Reviewed By: JoshuaGross Differential Revision: D20880603 fbshipit-source-id: f2094bfd3ab1c867cf7c107e678a098aab7e94a8 * Ez cleanup in ImageProps Summary: Ez cleanup in ImageProps, this import is not being used anymore changelog: [internal] internal change Reviewed By: JoshuaGross Differential Revision: D20880600 fbshipit-source-id: 7d903b5a6e16c37e61dec661b6bd1f9a6b442cc3 * Exclude all FlipperKit transitive dependencies from iOS Release builds (#28504) Summary: The `:configuration` option from `pod` only affects the specified pod and not its dependencies [1]. Therefore in order to avoid all transitive dependencies being linked in the resulting Release IPA we need to list them in the `Podfile`. Note that this will still build Flipper's pods when doing a Release, but it won't link it in the resulting IPA. [1] https://guides.cocoapods.org/syntax/podfile.html#pod Fixes https://github.com/react-native-community/upgrade-support/issues/28 Related https://github.com/CocoaPods/CocoaPods/issues/9658 ## Changelog * [iOS] [Fixed] - Exclude Flipper from iOS Release builds Pull Request resolved: https://github.com/facebook/react-native/pull/28504 Test Plan: Create a new React Native 0.62 project, run `pod install`, then diff: ``` ProjectName/ios/Pods/Target Support Files/Pods-ProjectName/Pods-ProjectName.debug.xcconfig` ``` and ``` ProjectName/ios/Pods/Target Support Files/Pods-ProjectName/Pods-ProjectName.relaese.xcconfig ``` ![image](https://user-images.githubusercontent.com/855995/78337679-a3fa0280-7591-11ea-8142-6f82cbc6be58.png) Reviewed By: passy Differential Revision: D20894406 Pulled By: priteshrnandgaonkar fbshipit-source-id: 680780f0f5a85fd8423b85a271a499bd12f06d00 * Fix crash in FabricUIManager.onMeasure Summary: Changelog: [Internal] The cause of crash was `NullPointerException`, which happened because of `mReactContextForRootTag.get(rootTag)` returning `null`. This is solved by checking whether it returns `null` before passing it to `I18nUtil`. Reviewed By: mdvacca Differential Revision: D20890623 fbshipit-source-id: c884c6838b83b944a5438375a4c060c1f5b1dc6e * Fix flow types of ImageContext Summary: ez diff to Fix flow types of ImageContext changelog: [internal] internal change to update flow types of ImageContext Reviewed By: TheSavior Differential Revision: D20883647 fbshipit-source-id: 6dba83ab431e56a71f96c39005ebcccf39a7da9a * Avoid passing analyticsTag prop to native if this is set to null Summary: This diff avoids passing the analyticsTag prop to native if this is set to null changelog: [internal] internal optimization Reviewed By: TheSavior Differential Revision: D20904498 fbshipit-source-id: f1ea1e5aa3199ef073668df86ca7cf6e20f70c5b * Rename analyticsTag -> internal_analyticsTag in ImageView component Summary: This diff renames the analyticsTag prop for the intenral_analyticsTag in ImageView component changelog: [internal] Creation of internal_analyticTag prop in ImageView, for now this prop is meant to be used internally. Reviewed By: TheSavior Differential Revision: D20904497 fbshipit-source-id: 2a28f746772ee0f9d657ec71549020c1f3e9d674 * Make Vibration.vibrate compatible with TurboModules (#27951) Summary: This PR fixes a compatibility issue with the Vibration module and TurboModules. The TurboModules spec doesn't allow nullable arguments of type Number, causing the following problem: ![IMG_3758](https://user-images.githubusercontent.com/1247834/73803879-10be6f80-4790-11ea-92d4-a008f0007681.PNG) ## Changelog [iOS] [Fixed] - Make Vibration library compatible with TurboModules. Pull Request resolved: https://github.com/facebook/react-native/pull/27951 Test Plan: Just submitted a PR to my own app to fix the issue [here](https://github.com/rainbow-me/rainbow/pull/340) The problem should be reproducible on RNTester due to this line: https://github.com/facebook/react-native/blob/91f139b94118fe8db29728ea8ad855fc4a13f743/RNTester/js/examples/Vibration/VibrationExample.js#L66 and should be working on this branch. Reviewed By: TheSavior Differential Revision: D19761064 Pulled By: hramos fbshipit-source-id: 84f6b62a2734cc09d450e906b5866d4e9ce61124 * Fix Cocoapods builds Summary: ## Problem For some reason, D20831545 broke the `use_frameworks!` build of RNTester. ## Building RNTester ``` pushd ~/fbsource/xplat/js/react-native-github/RNTester && USE_FRAMEWORKS=1 pod install && open RNTesterPods.xcworkspace && popd; ``` ## Error I built RNTester locally, and the error was this: ``` Undefined symbols for architecture x86_64: "facebook::jsi::HostObject::set(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&, facebook::jsi::Value const&)", referenced from: vtable for facebook::react::ObjCTurboModule in RCTImageEditingManager.o vtable for facebook::react::ObjCTurboModule in RCTImageLoader.o vtable for facebook::react::ObjCTurboModule in RCTImageStoreManager.o "facebook::jsi::HostObject::getPropertyNames(facebook::jsi::Runtime&)", referenced from: vtable for facebook::react::ObjCTurboModule in RCTImageEditingManager.o vtable for facebook::react::ObjCTurboModule in RCTImageLoader.o vtable for facebook::react::ObjCTurboModule in RCTImageStoreManager.o ld: symbol(s) not found for architecture x86_64 ``` ## Fix It looked like libraries that depend on "ReactCommon/turbomodule/core" weren't linking to JSI correctly. So, I modified all such Podspecs to also depend on "React-jsi": ``` arc rfr ' s.dependency "ReactCommon/turbomodule/core", version' ' s.dependency "ReactCommon/turbomodule/core", version\n s.dependency "React-jsi", version' ``` This seemed to do the trick. In buck, we'd fix this problem using exported_dependencies. I skimmed through cocoapods, and couldn't find such a configuration option there. So, I guess this will have to do? Changelog: [iOS][Fixed] - Fix Cocoapods builds of RNTester Reviewed By: fkgozali, hramos Differential Revision: D20905465 fbshipit-source-id: 60218c8274ec165752a428f2a7a9a546607c8fec * Add minimumSize to RCTRootView & RCTRootShadowView Summary: This adds a `minimumSize` property to RCTRootView, and forwards any changes to it's shadow view. This **does not** change any default behaviour, as the default minimum size is `CGSizeZero` before & after this diff. Changelog: [iOS][Internal] Add minimumSize to RCTRootView & RCTRootShadowView Reviewed By: RSNara Differential Revision: D20905456 fbshipit-source-id: a03f880e782891f60ef86b9c898965e05a5e796e * Make RCTNativeAnimatedModule into a TurboModule Summary: D20831545 integrated TurboModules with the bridge's `onBatchComplete` event. This fixed the RCTNativeAnimatedModule jank, so I'm re-converting RCTNativeAnimatedModule into a TurboModule. Changelog: [iOS][Fixed] - Make RCTNativeAnimatedModule TM-compatible Reviewed By: PeteTheHeat Differential Revision: D20850744 fbshipit-source-id: bb85a1bb27963e7d39bf149d0a3d7b71c88175da * upgrade to flow 0.122.0 Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D20919782 fbshipit-source-id: 3d5dc54ea4daafb8a1d96cad6c35a2dab4c24097 * Switch order of onSelectionChange and onChange events send from native Summary: Changelog: [Internal] UIKit uses either `UITextField` or `UITextView` as its UIKit element for `<TextInput>`. `UITextField` is for single line entry, `UITextView` is for multiline entry. There is a problem with order of events when user types a character. In `UITextField` (single line text entry), typing a character first triggers `onChange` event and then `onSelectionChange`. JavaScript depends on this order of events because it uses `mostRecentEventCount` from this even to communicate to native that it is in sync with changes in native. In `UITextView` (multi line text entry), typing a character first triggers `onSelectionChange` and then `onChange`. As JS depends on the correct order of events, this can cause issues. An example would be a TextInput which changes contents based as a result of `onSelectionChange`. Those changes would be ignored as native will throw them away because JavaScript doesn't have the newest version. Reviewed By: JoshuaGross Differential Revision: D20836195 fbshipit-source-id: fbae3b6c0d388fc059ca2541ae980073b8e5f6c7 * Maintain selection and cursor location when setting string on TextInput Summary: Changelog: [Internal] Calling `_backedTextInputView.attributedText = attributedString` causes cursor to be moved to the end of text input. This applies to both, `UITextField` and `UITextView`. This is not desired as when JS sets a new text, we don't want the cursor to be moved to the end of text input. JS has the option to use view commands if it wishes to move cursor somewhere. Reviewed By: JoshuaGross Differential Revision: D20836201 fbshipit-source-id: 9234e54cfbc5fc206f723626988e505275788aae * Implement event count for TextInput Summary: Changelog: [Internal] Implementation of event count for Fabric's Text input. Reviewed By: JoshuaGross Differential Revision: D20800185 fbshipit-source-id: 988692cb2fc786649821cccb06e629b40b9b0479 * Migrate setNativeProps to commands in iOS text input Summary: Changelog: Move from setNativeProps to ViewCommands. Reviewed By: JoshuaGross Differential Revision: D20843018 fbshipit-source-id: 9be9d2bbee01f2e15279e3c3ae785c1a5b163765 * Update default Podfile to not depend on a path (#28572) Summary: Recently, a default Podfile has been modified to not contain all the React Native pods, but use a helper method `use_react_native!`. While this is great, it assumes a hardcoded path of `../node_modules/react-native` to be always the correct location of the React Native. https://github.com/facebook/react-native/blob/d4d8887b5018782eeb3f26efa85125e6bbff73e4/scripts/autolink-ios.rb#L7-L9 Unfortunately, due to the way Ruby works, this completely hides the path away from the users. Before, they could have seen the wrong path explicitly in a Podfile and knew to update it to resolve path-related issues. With the current version in `master`, I can see a lot of issues where developers wonder how to resolve the path issues and how to pass the path itself. https://github.com/facebook/react-native/blob/4118d798265341061105f3a53550db83c66a71cb/template/ios/Podfile#L5-L10 This PR uses React Native CLI configuration (that is already used to link 3rd party dependencies) to explicitly define the correct path to the React Native. As a result, we don't have to change the paths here whether we're running monorepo or not. ## Changelog [IOS] [INTERNAL] - Always provide an explicit path to React Native Pull Request resolved: https://github.com/facebook/react-native/pull/28572 Differential Revision: D20945194 Pulled By: TheSavior fbshipit-source-id: 010f9754f2ed78ef62fd52f4d201f296f5af6d27 * chore: update CLI * fix: do not throw on missing `cliPath`, use the default value (#28625) Summary: The `cliPath` has always been optional value and in fact, even had its default value hardcoded in the React gradle file. In this PR, I am just taking use of it and remove throwing an error, which is going to be a really annoying breaking change. ## Changelog [ANDROID] [INTERNAL] - Don't require `cliPath` Pull Request resolved: https://github.com/facebook/react-native/pull/28625 Test Plan: Run Android project, everything works. Provide custom `cliPath`, it gets respected Reviewed By: cpojer Differential Revision: D21044222 Pulled By: TheSavior fbshipit-source-id: 8029f988d92abb9f64f30e05932c0d407d0c997e * chore: remove Kotlin version from the default template * (eslint-config) update community eslint plugin in eslint config (#28642) Summary: Updating the community eslint-plugin used in the eslint-config to the latest version. expecting new eslint-config version to be released with this change so that it can be included in new project template for 0.63 https://github.com/react-native-community/releases/issues/186 ## 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] - Update community eslint plugin in the eslint config Pull Request resolved: https://github.com/facebook/react-native/pull/28642 Test Plan: yarn lint passes Differential Revision: D21048976 Pulled By: cpojer fbshipit-source-id: 2c3ec0ef450cf357d8c88db7873f4ca1154b2034 * [0.63.0-rc.0] Bump version numbers * Upgrade Hermes dependency to 0.5.0 Summary: Use the latest published release of hermes-engine. Update RN to invoke `hermesc` instead of `hermes`. Changelog: [Android] [Changed] - Upgraded to Hermes 0.5.0 allow-large-files Reviewed By: mhorowitz Differential Revision: D20998564 fbshipit-source-id: 4824e273bcb044029a5a7e9379f168d3da47da50 * Remove the post install step (#28651) Summary: Removes the post install step for Flipper, as the latest version of YogaKit is compatible with swift 5. cc alloy ## 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 --> [Flipper] [Template] - Remove the post install step for Flipper Pull Request resolved: https://github.com/facebook/react-native/pull/28651 Test Plan: Tested a newly created RN app without post install step and it built successfully. Reviewed By: passy Differential Revision: D21064653 Pulled By: priteshrnandgaonkar fbshipit-source-id: da56d0754d918e30a0ebe480c77590f0139d48ac * Allow iOS PlatformColor strings to be ObjC or Swift UIColor selectors (#28703) Summary: Per discussion in https://github.com/react-native-community/releases/issues/186 the iOS `PlatformColor()` function is documented to use the semantic color names provided by the system. The referenced HIG documentation itself links to the `UIColor` documentation for semantic colors names. However, these names differ depending on if you are viewing the new Swift API docs or the Objective C docs. The current Objective C implementation in react-native assumes Objective C UIColor selector names that are suffixed 'Color'. But in Swift, Apple provides a Swift Extension on UIColor that makes aliases without the the 'Color' suffix and then makes the original selectors invalid presumably via `NS_UNAVAILABLE_SWIFT`. Since both selector names are valid depending on if you are using Objective C or Swift, let's make both forms be legal for `PlatformColor()`. In `RCTConvert.m` there is a dictionary of legal selector names. The code already supports the ability to have names be aliases of other selectors via a RCTSelector metadata key. The change adds code to the initialization of the map: it iterates over the keys in the map, which are all ObjC style UIColor selectors, and creates aliases by duplicating the entries, creating key names by stripping off the ObjC "Color" suffix, adds the RCTSelector key referring to the original and then appends these new Swift aliases to the map. ## Changelog [iOS] [Changed] - Allow iOS PlatformColor strings to be ObjC or Swift UIColor selectors Pull Request resolved: https://github.com/facebook/react-native/pull/28703 Test Plan: The PlatformColorExample.js is updated to use the new, shorter Swift selector names. There are still other examples in the same file and in unit tests that exercise the ObjC selector names. <img width="492" alt="PlatformColor" src="https://user-images.githubusercontent.com/30053638/79809089-89ab7d00-8324-11ea-8a9d-120b92edeedf.png"> Reviewed By: shergin Differential Revision: D21147404 Pulled By: TheSavior fbshipit-source-id: 0273ec855e426b3a7ba97a87645859e05bcd4126 * Fix folly::dynamic crash when attaching a debugger to Hermes Summary: folly_futures was compiled with and exported -DFOLLY_MOBILE=1, while folly_json did not. This flag disables fancy F14 data structures for folly::dynamic in favor of a simple std::unordered_map. This caused inlined/templated code from modules depending on folly_futures to disagree with the implementations in folly_json, leading to a crash. The only such libraries were libhermes-inspector and (transitively) libhermes-executor-debug, and these only use folly::dynamic for CDP serialization, which is why the problem was not more apparent. Changelog: [Internal] Fix crash when attaching a Hermes debugger Reviewed By: mhorowitz Differential Revision: D21193307 fbshipit-source-id: 2b795bb6f4f7f991e2adaacec62d62616117322b * Update react.gradle (#28776) Summary: Running `./gradlew assembleRelease` fails as the path to the CLI contains a new line at the end. We don't run this command in `debug` mode, hence it passed the testing. My bad. Fixed, checked in both `debug` with `bundleInDebug: true` and `release`. Fixes https://github.com/facebook/react-native/issues/28700 ## Changelog [INTERNAL] [ANDROID] - Fix `React.gradle` to build Android apps in production Pull Request resolved: https://github.com/facebook/react-native/pull/28776 Test Plan: Running `./gradlew assembleRelease` works Reviewed By: hramos Differential Revision: D21287789 Pulled By: TheSavior fbshipit-source-id: dc3ec8eef7a919b072b562d2bd455e2f704bc083 * Revert D21064653: Remove the post install step Differential Revision: D21064653 Original commit changeset: da56d0754d91 fbshipit-source-id: 1086cfdeca9aa3830370ea115ba7b5f05d3fb124 * Bump @react-native-community/eslint-config in new app template Summary: Changelog: [Changed][General] Update react-native-community/eslint-config to 1.1.0, adding the new color rule Reviewed By: rickhanlonii Differential Revision: D21342153 fbshipit-source-id: ac1367353d4d3e69b6df29dc16f9fcb60cde3519 * [0.63.0-rc.1] Bump version numbers * Upgrade Flipper to 0.37.0 (#28545) Summary: Bump flipper to 0.37 for both iOS and Android [Android] [Changed] - Upgrade Flipper to 0.37.0 [iOS] [Changed] - Upgrade Flipper to 0.37.0 Pull Request resolved: https://github.com/facebook/react-native/pull/28545 Test Plan: RNTester build pass Reviewed By: rickhanlonii Differential Revision: D20930069 Pulled By: hramos fbshipit-source-id: a7cb719da3e51e6a42d27d5e64bc664398d0d3c5 * Enable with CocoaPods `:configuration` (#28796) Summary: ~~⚠️ Depends on https://github.com/facebook/flipper/pull/1086 and a new Flipper release.~~ Fixes https://github.com/facebook/react-native/commit/17f025bc26da13da795845a3f7daee65563420c0#commitcomment-38831234 Currently user’s are being told to add a definition of the `FB_SONARKIT_ENABLED` macro and examples, including those in stock React Native templates, set this for the user by making use of a `post_install` hook in the user’s `Podfile`. This leads to confusion, fragile code [when a user’s project dir structure deviates from vanilla], and is ultimately not necessary as CocoaPods already has dedicated mechanisms to: * specify build settings (through the `xcconfig` property); * and selectively include certain pods only in certain build configurations (e.g. debug). ## 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] [Changed] - Entirely control Flipper being enabled through inclusion in Podfile and optionally limiting to certain build configurations using the `:configuration` directive. Pull Request resolved: https://github.com/facebook/react-native/pull/28796 Test Plan: Tested using the changes of https://github.com/facebook/flipper/pull/1086 in a new app that uses RN `master`. Reviewed By: priteshrnandgaonkar Differential Revision: D21449754 Pulled By: passy fbshipit-source-id: 9ff7c7f4ffc32b364b1edd82b94e0b80c3997625 * Pressable: Rename pressRectOffset to pressRetentionOffset to be consistent with other touchables Summary: Text and the other Touchables have this prop called pressRetentionOffset. Pressable should be consistent with that. Changelog: [Breaking][General]: Pressable: Rename pressRectOffset to pressRetentionOffset to be consistent with other touchables Reviewed By: yungsters Differential Revision: D21552255 fbshipit-source-id: 31e64bad9e48ac98e4934dd2f4c0a7f526de5cb6 * iOS: Fix Animated image crash when CADisplayLink target in RCTWeakProxy is nil Summary: When self is nil, this may crash in RCTUIImageViewAnimated.m. ``` _displayLink = [CADisplayLink displayLinkWithTarget:[RCTWeakProxy weakProxyWithTarget:self] selector:selector(displayDidRefresh:)]; ``` Replace `RCTWeakProxy` with a concrete class `RCTDisplayWeakRefreshable` that has the displayDidRefresh method, that calls the displayDidRefresh method in its weak target. https://github.com/facebook/react-native/pull/28070#issuecomment-619295254 Changelog: [iOS] [Fixed] - Fix Animated image crash when CADisplayLink target in RCTWeakProxy is nil Reviewed By: shergin Differential Revision: D21419385 fbshipit-source-id: da7c3c38f81ea54f633da7f59359e07680ea2faf * Pressable: Add Support for Inspector Overlay Summary: Adds support for the debug overlay (enabled via the Inspector) that the legacy touchable components supported. Changelog: [General][Added] - Added Inspector overlay support for Pressable Reviewed By: TheSavior Differential Revision: D21614412 fbshipit-source-id: b884e04f8dba1bfd35e61de25d33d6d47bc34b03 * Changed iOS LaunchScreen from xib to storyboard (#28239) Summary: > Starting April 30, 2020, all apps submitted to the App Store must use an Xcode storyboard to provide the app’s launch screen and all iPhone apps must support all iPhone screens. Updated iOS Launch screen as per [App Store policy change](https://developer.apple.com/news/?id=03042020b). Community discussion: https://github.com/react-native-community/discussions-and-proposals/issues/209 ## Changelog Changed iOS Launch Screen from a `xib` to `storyboard`. The `LaunchScreen.xib` file has been replaced with `LaunchScreen.storyboard`. Xcode automatically picks up the new Launch Screen no additional change is required. [iOS] [Deleted] - Deleted LaunchScreen.xib [iOS] [Added] - Added LaunchScreen.storyboard Pull Request resolved: https://github.com/facebook/react-native/pull/28239 Test Plan: Build the Xcode project under `template/iOS` and verify that the new launch screen is identical to the previous one. Reviewed By: cpojer Differential Revision: D20408892 Pulled By: hramos fbshipit-source-id: 9c38df58d1304088a23f3d73e0fbd87675804f1a * Fix debugging on android for 0.63 (#29204) Summary: Currently on react native 0.63-rc.0 and 0.63-rc.1 enabling debugging throws an exception. It looks like something may have been missed in unregistering JSDevSupport in this commit c20963e ![crash](https://user-images.githubusercontent.com/14797029/85500252-2acae400-b5b1-11ea-938a-674b55e649b2.gif) This should fix https://github.com/facebook/react-native/issues/28746 and https://github.com/facebook/react-native/issues/29136 ## Changelog [Android] [Fixed] - Fix crash when enabling debug Pull Request resolved: https://github.com/facebook/react-native/pull/29204 Test Plan: To recreate the bug: npx react-native init RN063 --version 0.63.0-rc.1 react-native start react-native run-android Enable debug mode from react native dev menu After this commit, the crash no longer occurs ![non crash](https://user-images.githubusercontent.com/14797029/85500241-269ec680-b5b1-11ea-8cfe-85bfda4dd222.gif) Reviewed By: TheSavior Differential Revision: D22395406 Pulled By: RSNara fbshipit-source-id: 046df77ae1c1de96870fb46f409d59e7d6a68c0d * [0.63.0] Bump version numbers * Add ProGuard rule for hermes (#28571) Summary: This adds a ProGuard for `hermes` rule so it does not have to be added by users manually. https://github.com/facebook/react-native/issues/28270 ## 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 --> [Android] [Added] - ProGuard rule for hermes Pull Request resolved: https://github.com/facebook/react-native/pull/28571 Test Plan: 1. Create a project with/without hermes. 2. Enable proguard. Reviewed By: cpojer Differential Revision: D20947095 Pulled By: hramos fbshipit-source-id: 79b166ad2dd060f20041d9f5cfe2f794c754843d * Fix rounded border drawing when border-radius is smaller than border-width (#28358) Summary: This PR fixes the drawing of the border rounded edges when the border-radius is small than the border-width. The current implementation capped the possible border-radius making it impossible to set smaller border-radii when using thicker borders. After inspection it was found that the rounded-rect calculation is incorrect. ## Changelog `[Android] [Fixed] - Fix rounded border-drawing when border-radius is smaller than border-width` Pull Request resolved: https://github.com/facebook/react-native/pull/28358 Test Plan: **Faulty situation:** As you can see, when the border-radius becomes very low, the border is stuck at a minimum value. Only after setting the border-radius fully to 0 is it again rendered correctly. ![ezgif com-video-to-gif (2)](https://user-images.githubusercontent.com/6184593/77183540-c3435b00-6ace-11ea-950d-29a0ea1757bd.gif) **After the fix:** ![ezgif com-video-to-gif (3)](https://user-images.githubusercontent.com/6184593/77183619-e837ce00-6ace-11ea-93a5-910127d352b7.gif) Differential Revision: D21124739 Pulled By: shergin fbshipit-source-id: cefd1776b77b5b9fb335e95fd7fdd7f345579dc4 * Fix border-stroke drawing after resetting border-radius (#28356) Summary: This PR fixes incorrect drawing of the View borders on Android, after changing the border-radius back to 0 *(and when no background-color is defined)*. This happens because the `drawRoundedBackgroundWithBorders` function in ReactViewBackgroundDrawable changes the style on the Paint object to `STROKE`. This style is however never reverted back to `FILL`. This change ensures that the Paint style is set to `FILL` for the full execution of the `drawRectangularBackgroundWithBorders` function. ## Changelog `[Android] [Fixed] - Fix border-drawing when changing border-radius back to 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28356 Test Plan: **Faulty situation:** ![ezgif com-video-to-gif](https://user-images.githubusercontent.com/6184593/77153163-9759b280-6a99-11ea-82bb-33a1e0a4934c.gif) **After the fix:** ![ezgif com-video-to-gif (1)](https://user-images.githubusercontent.com/6184593/77153825-c91f4900-6a9a-11ea-8e0c-a4280b9e72b8.gif) Differential Revision: D21124741 Pulled By: shergin fbshipit-source-id: 2044f8e8ad59a58df42b64d7ee8c4ad1d3b562f1 * Fixes TextInput shaking when typing Chinese (#28805) Summary: Fixes https://github.com/facebook/react-native/issues/28488. ## Changelog [iOS] [Fixed] - Fixes TextInput shaking when typing Chinese Pull Request resolved: https://github.com/facebook/react-native/pull/28805 Test Plan: Demo see https://github.com/facebook/react-native/issues/28488. Differential Revision: D21376803 Pulled By: shergin fbshipit-source-id: b1fe6cc5f67d42ef98a6c12b8ab9990feac0e2a7 * Set black as default text color for <TextInput/> on iOS (#28708) Summary: This is a follow-up pull request to https://github.com/facebook/react-native/issues/28280 (reviewed by shergin). This pull request tried to solve the problem of the default color in a TextInput in dark mode on iOS being white instead of black. I got suggested to solve the problem not on the level of RCTTextAttributes, but on the level of RCTUITextField. Setting `self.textColor = [UIColor black];` in the constructor did not work, because it gets overwritten by nil in `RCTBaseTextInputView.m`. There I implemented the logic that if NSForegroundColorAttributeName color is nil then the color is being set to black. I think the `defaultTextAttributes` property confuses here, because it ends up being the effective text attributes, e.g. if I unconditionally set the default text color to black, it cannot be changed in React Native anymore. So I put the nil check in. ## Changelog [iOS] [Fixed] - TextInput color has the same default (#000) on iOS whether in light or dark mode Pull Request resolved: https://github.com/facebook/react-native/pull/28708 Test Plan: I have manually tested the following: - The default text color in light mode is black - The default text color in dark mode is black - The color can be changed using the `style.color` attribute - Setting the opacity to 0.5 results in the desired behavior, the whole TextInput becoming half the opacity. – Setting the `style.color` to rgba(0, 0, 0, 0.5) works as intended, creating a half-opaque text color. Differential Revision: D21186579 Pulled By: shergin fbshipit-source-id: ea6405ac6a0243c96677335169b214a2bb9ccc29 * Enable array buffers in JSCRuntime.cpp (#28961) Summary: The JavaScriptCore implementation of JSI [does not currently support array buffers](https://github.com/facebook/react-native/blob/master/ReactCommon/jsi/JSCRuntime.cpp#L925-L943). The comments in the code suggest the JSC version used by React Native does not work with array buffers, but this seems to be out of date since the current version of JSC used by React Native does indeed support array buffers. This change just enables array buffers in JSCRuntime.cpp. NOTE: See https://github.com/react-native-community/discussions-and-proposals/issues/91#issuecomment-632371219 for more background on this change. ## Changelog [General] [Added] - Support for array buffers in the JavaScriptCore implementation of JSI Pull Request resolved: https://github.com/facebook/react-native/pull/28961 Test Plan: To test these changes, I just made some temporary changes to RNTester to use JSI to inject a test function into the JS runtime that reads from and writes to an array buffer, and call that function from the JS of the RNTester app (see https://github.com/ryantrem/react-native/commit/28152ce3f4ae0fa906557415d106399b3f072118). For the JS side of this, specifically look at https://github.com/ryantrem/react-native/blob/28152ce3f4ae0fa906557415d106399b3f072118/RNTester/js/RNTesterApp.android.js#L13-L18 For the native side of this, specifically look at https://github.com/ryantrem/react-native/blob/28152ce3f4ae0fa906557415d106399b3f072118/RNTester/android/app/src/main/cpp/JSITest.cpp#L22-L38 Reviewed By: shergin Differential Revision: D21717995 Pulled By: tmikov fbshipit-source-id: 5788479bb33c24d01aa80fa7f509e0ff9dcefea6 * Fix font variant crash on Android < 4.4 (#29176) Summary: In RN 0.62 support for `fontVariant` was added on Android. Using that prop crashes the app on Android below KitKat (4.3 and below) To reproduce just add any Text with the `fontVariant` styling prop in the app: ```js <Text style={{fontVariant: ['tabular-nums']}}>This will crash</Text> ``` It will crash any device running Android below KitKat with the error: ![image](https://user-images.githubusercontent.com/4534323/85073452-18206b80-b1bb-11ea-8d7e-96f27fa1a320.png) This is caused by `java.utils.Objects` only being available on Android 4.4+ ## Changelog [Android] [Fixed] - Fix font variant crash on Android < 4.4 Pull Request resolved: https://github.com/facebook/react-native/pull/29176 Test Plan: [TextUtils.equals](https://developer.android.com/reference/android/text/TextUtils#equals) was added as soon as API level 1, so no compatibility issue here. Tested on Emulator running Android 4.1, no crash anymore. I've searched for other occurences of `java.utils.Objects` in the project, and this was the only one, so no need to remove other occurences ✅ Reviewed By: JoshuaGross Differential Revision: D22337316 Pulled By: mdvacca fbshipit-source-id: 5507b21b237a725d596d47b5c01e269895b16d4a * Fix LogBox.ignoreAllLogs used with no argument (#29310) Summary: When you call `LogBox.ignoreAllLogs()` it should ignore logs. This fixes a bug that made this equivalent to `LogBox.ignoreAllLogs(false)` ## Changelog [General] [Fixed] - LogBox.ignoreAllLogs() should ignore logs Pull Request resolved: https://github.com/facebook/react-native/pull/29310 Test Plan: Added tests Reviewed By: TheSavior Differential Revision: D22448436 Pulled By: rickhanlonii fbshipit-source-id: 6ba12b9d9c1f29cf3ac503946ac5ca0097425a7a * Pressable: Minimum Press Duration Summary: When a `Pressable` has a configured (or the default) `delayPressIn` and no (or the default) `delayPressOut`, tapping very quickly can lead to intantaneous invocation of `onPressIn` and `onPressOut`. The end result is that users may never experience any intended visual press feedback. This changes `Pressable` to accept (and be preconfigured with a default) **minimum press duration**. The minimum press duration ensures that even if the press is released before `delayPressIn` has elapsed, `onPressOut` will still wait the remaining time up to `minPressDuration` before firing. Note that setting a non-zero `delayPressOut` is insufficient because if a user holds down on a `Pressable` for longer than `delayPressIn`, we still want `onPressOut` to fire immediately when the press is released. Changelog: [General][Changed] - Added `minPressDuration` to `Pressable`. Reviewed By: TheSavior Differential Revision: D21614708 fbshipit-source-id: 502f3d8ad6a40e7762435b6df16809c8798dd92c * chore: bring back script to org shape * [0.63.1] Bump version numbers * Exclude okhttp from flipper dependency (#29260) Summary: This fixes https://github.com/facebook/react-native/issues/28481. As explained in [this comment](https://github.com/facebook/react-native/issues/28481#issuecomment-645546195), the flipper network plugin pulls a more recent version of okhttp (3.14), but only versions of okhttp up to 3.12 works on Android API 21 and less. This prevented being able to run the app in debug mode, it was still working fine in release mode. ## 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 --> [Android] [Fixed] - Fix unable to run in debug mode on Android API < 21 Pull Request resolved: https://github.com/facebook/react-native/pull/29260 Test Plan: Using `yarn react-native run-android` the app would instantly crash with this error in `adb logcat`: ``` E/AndroidRuntime( 5079): java.lang.RuntimeException: Unable to create application com.awesometsproject.MainApplication: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created E/AndroidRuntime( 5079): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4154) E/AndroidRuntime( 5079): at android.app.ActivityThread.access$1300(ActivityThread.java:130) E/AndroidRuntime( 5079): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1255) E/AndroidRuntime( 5079): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 5079): at android.os.Looper.loop(Looper.java:137) E/AndroidRuntime( 5079): at android.app.ActivityThread.main(ActivityThread.java:4745) E/AndroidRuntime( 5079): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 5079): at java.lang.reflect.Method.invoke(Method.java:511) E/AndroidRuntime( 5079): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) E/AndroidRuntime( 5079): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) E/AndroidRuntime( 5079): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 5079): Caused by: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:90) E/AndroidRuntime( 5079): at com.facebook.react.ReactInstanceManager.<init>(ReactInstanceManager.java:238) E/AndroidRuntime( 5079): at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:281) E/AndroidRuntime( 5079): at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:87) E/AndroidRuntime( 5079): at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:39) E/AndroidRuntime( 5079): at com.awesometsproject.MainApplication.onCreate(MainApplication.java:47) E/AndroidRuntime( 5079): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:999) E/AndroidRuntime( 5079): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4151) E/AndroidRuntime( 5079): ... 10 more E/AndroidRuntime( 5079): Caused by: java.lang.reflect.InvocationTargetException E/AndroidRuntime( 5079): at java.lang.reflect.Constructor.constructNative(Native Method) E/AndroidRuntime( 5079): at java.lang.reflect.Constructor.newInstance(Constructor.java:417) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:80) E/AndroidRuntime( 5079): ... 17 more E/AndroidRuntime( 5079): Caused by: java.lang.NoClassDefFoundError: java.util.Objects E/AndroidRuntime( 5079): at okhttp3.CertificatePinner.withCertificateChainCleaner(CertificatePinner.java:231) E/AndroidRuntime( 5079): at okhttp3.OkHttpClient.<init>(OkHttpClient.java:238) E/AndroidRuntime( 5079): at okhttp3.OkHttpClient$Builder.build(OkHttpClient.java:1015) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevServerHelper.<init>(DevServerHelper.java:132) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerImpl.<init>(DevSupportManagerImpl.java:183) E/AndroidRuntime( 5079): ... 20 more W/ActivityManager( 1456): Force finishing activity com.awesometsproject/.MainActivity ``` With this fix, the app launch successfully in debug mode, without having to remove flipper altogether from our config. Reviewed By: passy Differential Revision: D22521109 Pulled By: mdvacca fbshipit-source-id: 3c0263642438bd7c0d09b045e15a933bd8a26734 * Send key when onKeyPress event is fired from TextInput Summary: Changelog: [Internal] In `onKeyPress` event, we were not returning `key` property. This diff adds `key` property to `onKeyPress` event and removes other, redundant properties from `onKeyPress` event. The implementation has been translated from Paper. Reviewed By: shergin Differential Revision: D21250411 fbshipit-source-id: f1e31381667acb9dec02d0b33883df8f8f5b2a4b * Calling Paper TextInput setTextAndSelection view command now dirties layout Summary: Changelog: [Internal] Previously `setTextAndSelection` was not dirtying layout. This would cause an issue where `setTextAndSelection` causes layout change. For example calling setTextAndSelection with empty string on a multiline auto expanding text input. I changed one example in TextInputSharedExamples.js, "Live Re-Write (no spaces allowed) and clear" example is now multiline. This allows to test whether `setTextAndSelection` dirties layout. Enter multiline string to to the example text input and press clear. Observe that the text input shrinks to single line height. Reviewed By: shergin Differential Revision: D21182990 fbshipit-source-id: de8501ea0b97012cf4cdf8d5f658649139f92da6 * Remove setMostRecentEventCount from TextInput view commands Summary: Changelog: [Internal] We don't use view command `setMostRecentEventCount`, let's get rid of it. Reviewed By: JoshuaGross Differential Revision: D21016600 fbshipit-source-id: 6491c063e9d6a89252300cb47c010b248e473f4b * Restore Previous Behavior for StyleSheet Validation of Null/Undefined Styles (#29171) Summary: https://github.com/facebook/react-native/issues/27264 changed stylesheet validation to avoid enumerating properties on the prototype of a style. It introduces a secondary behavior change, where null/undefined styles used to be tolerated but now lead to an exception. This is because `for in undefined` will noop where `for of Object.keys(undefined)` will throw. This scenario of undefined/null styles seems to actually show up in practice and was previously well tolerated. E.g. `Button.js` has code that looks like this: ```jsx const styles = StyleSheet.create({ button: Platform.select({ ios: {}, android: { elevation: 4, // Material design blue from https://material.google.com/style/color.html#color-color-palette backgroundColor: '#2196F3', borderRadius: 2, }, }), ``` For non ios/Android platforms, that creates a style object which looks like: ```js { button: undefined, ... } ``` This previously meant that the component would be unstyled if created, but now means out-of-tree platforms throw if the builtin Button component is required. This change restores the previous `for in` loop but adds a `hasOwnProperty` check to avoid properties on prototypes. ## Changelog [General] [Fixed] - Restore Previous Behavior for StyleSheet Validation of Null/Undefined Styles Pull Request resolved: https://github.com/facebook/react-native/pull/29171 Test Plan: Validated that importing Buttons will no longer cause an exception, and that invalid properties are still caught. Reviewed By: JoshuaGross Differential Revision: D22118379 Pulled By: TheSavior fbshipit-source-id: 650c64b934ccd12a3dc1b75e95debc359925ad73 * Set windowTranslucentNavigation to false (#29399) Summary: This fixes https://github.com/facebook/react-native/issues/29397. Without this, apps that specify `android:windowTranslucentNavigation` draw the `LogBox` buttons underneath the soft navigation bar, making the buttons unpressable. Before | After :-------------------------:|:-------------------------: <img src="http://ashoat.com/AndroidTranslucentNavigationLogBox.png" width="300" /> | <img src="http://ashoat.com/AndroidTranslucentNavigationLogBoxFixed.png" width="300" /> ## Changelog [Android] [Fixed] - Set LogBox windowTranslucentNavigation to false Pull Request resolved: https://github.com/facebook/react-native/pull/29399 Test Plan: I tested this change on the [repo](https://github.com/Ashoat/LogBoxTest) I set up to reproduce the issue. I set it up to [build `ReactAndroid` from source](https://github.com/Ashoat/LogBoxTest/commit/3a2cdab8777ac381cd3be5a84a5bf3250751ac11) and then edited `node_modules/react-native/ReactAndroid/src/main/res/devsupport/values/styles.xml` directly. Reviewed By: rickhanlonii Differential Revision: D22602970 Pulled By: mdvacca fbshipit-source-id: 8c2adc149aa0157825075022f00bb695956d3121 * Fix image cannot show in iOS 14 (#29420) Summary: This PR is to fix https://github.com/facebook/react-native/issues/29279, which image cannot show in iOS 14 As https://github.com/facebook/react-native/issues/29279#issuecomment-658244428 mention, this issue can be fixed by calling ` [super displayLayer:layer];` it it is still image, to let `UIImageView` handle still image rendering ## Changelog [iOS] [Fixed] - Fix image cannot show in iOS 14 Pull Request resolved: https://github.com/facebook/react-native/pull/29420 Test Plan: Image can be shown in iOS 14 build with Xcode 12 beta, using ```js <Image source={require('./images/some_local_image.jpg')}/> ``` It may also need to test gif image is render correctly ```js <Image source={{uri: 'https://some_remote_gif_image.gif'}}/> ``` Reviewed By: p-sun Differential Revision: D22619448 Pulled By: shergin fbshipit-source-id: f4d0ad83af945a6b8099d4eaea5a5f1933c7bfd2 * [0.63.2] Bump version numbers * botched merge changes 1 * more hermes changes needed from upstream, botched merge? * [RCTPicker] Guard UIKit only API on macOS * [RCTSegmentedControl] Make UIKit agnostic * [RCTDisplayWeakRefreshable] Make platform agnostic * [RCTImageLoader] Make platform agnostic * [RCTDevLoadingView] Make platform agnostic * botched merge changes 2 * [RCTPushNotificationManager] Guard for macOS * v0.63 TODO * [RCTBaseTextInputViewManager] Make platform agnostic * [RCTBaseTextInputView] Make platform agnostic * [RNTester-macOS] Fix * [RCT-Folly] Fix build * [PlatformColorValueTypes] Add macOS shim * [package] Update CLI to no longer require config This makes a previous change more explicit: https://github.com/microsoft/react-native-macos/pull/602 * Fix iOS build failures. * Get RNTester to launch * [CODEOWNERS] Add myself * [flow] Remove deprecated rule in newer Flow https://github.com/facebook/flow/commit/759970c1b6dc0a25171d9969e34eaf5dae70f130 * [flow] Get iOS checks green * [PlatformColor] Duplicate iOS code for macOS This is a naive version of this change, there should likely be some code sharing happening between iOS and macOS. * [test] Make green with macOS fork changes * [test] Get macOS test bundle to build * [Color] Rename alternating colors to match to assumptions * [PlatformExample] Fix examples on macOS * [transform] Use iOS implementation for macOS * [circle] Fix config * [ci] Update metro config as per upstream * [ci] Ignore metro config in e2e tests * Revert "[ci] Ignore metro config in e2e tests" This reverts commit 25f7006bc9ba76b1e002b721954a823b3d710c5c. * Revert "[ci] Update metro config as per upstream" This reverts commit b47ca570be00394bbd92b349eab02083787301e7. * [ci] Only disable custom metro config in e2e test * [ci] Ignore metro config in e2e tests * [ci] Switch to experimental CocoaPods CDN * Revert "[ci] Switch to experimental CocoaPods CDN" This reverts commit 44a92f7f08397406429672b14930d44b6aa06b5e. * [ci] Skip Android tests in Apple PR on master * [rnm-init] Fix pod reference * [rnm-init] Update minimum iOS deployment target Co-authored-by: Christoph Nakazawa <cpojer@fb.com> Co-authored-by: Sergio Estevao <sergioestevao@gmail.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: Sam Mathias Weggersen <sawegger@microsoft.com> Co-authored-by: Tommy Nguyen <tonguye@microsoft.com> Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Héctor Ramos <hector@hectorramos.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Sebastian Markbage <sema@fb.com> Co-authored-by: generatedunixname89002005287564 <generatedunixname89002005287564@fb.com> Co-authored-by: Eddie Dugan <ejd@fb.com> Co-authored-by: Valentin Shergin <shergin@fb.com> Co-authored-by: Max Ovtsin <maxovtsin@fb.com> Co-authored-by: Alexander Kawrykow <akawry@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Spencer Ahrens <sahrens@fb.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Jack Wang <shoubowang@fb.com> Co-authored-by: Oleg Bogdanov <boguscoder@fb.com> Co-authored-by: Michael Bolin <mbolin@fb.com> Co-authored-by: Dan Abramov <gaearon@fb.com> Co-authored-by: Peter Argany <petetheheat@fb.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: George Zahariev <gkz@fb.com> Co-authored-by: Jason Safaiyeh <safaiyeh@protonmail.com> Co-authored-by: Pedro Barbiero <pedrobarbiero@gmail.com> Co-authored-by: Brian Vaughn <bvaughn@fb.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Martin Sherburn <mns@fb.com> Co-authored-by: Tom Underhill <tomun@microsoft.com> Co-authored-by: Ventsislav Dimitrov <4097884+vdmtrv@users.noreply.github.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: Lucas Bento <lucas.bsilva@outlook.com> Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com> Co-authored-by: Vojtech Novak <vonovak@gmail.com> Co-authored-by: Emilis Baliukonis <emilisb@wix.com> Co-authored-by: Jacob Bower <jbower@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: Marc Horowitz <mhorowitz@fb.com> Co-authored-by: Sidharth Guglani <sidharthguglani@fb.com> Co-authored-by: Andrew Coates (REDMOND) <acoates@microsoft.com> Co-authored-by: maciej simka <mcj.simka@gmail.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Pavlos Vinieratos <pvinis@gmail.com> Co-authored-by: Cristiano Santos <cristianomnsantos@gmail.com> Co-authored-by: Daniel Cohen Gindi <Danielgindi@gmail.com> Co-authored-by: Eli White <eliwhite@fb.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: jiggag <jiggag90@gmail.com> Co-authored-by: Emily Janzer <janzer@fb.com> Co-authored-by: Kacper Wiszczuk <kacperwiszczuk@gmail.com> Co-authored-by: Xiaoyu Yin <xyin@fb.com> Co-authored-by: Javier Cuevas <javi@diacode.com> Co-authored-by: Bruno Barbieri <brunobar79@gmail.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Will Holen <willholen@fb.com> Co-authored-by: Pritesh Nandgaonkar <prit91@fb.com> Co-authored-by: sunnylqm <sunnylqm@qq.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Tim Yung <yungsters@fb.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: Devon Deonarine <hello@devondeonarine.ca> Co-authored-by: Radek Czemerys <radko93@gmail.com> Co-authored-by: Hein Rutjes <IjzerenHein@users.noreply.github.com> Co-authored-by: zhongwuzw <zhongwuzw@qq.com> Co-authored-by: Jonny Burger <jonathanburger11@gmail.com> Co-authored-by: Ryan Tremblay <ryan.tremblay@microsoft.com> Co-authored-by: almouro <contact@almouro.com> Co-authored-by: Rick Hanlon <rickhanlonii@gmail.com> Co-authored-by: Matthieu Harlé <bonjour@matthieuharle.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Ashoat Tevosyan <ashoat@gmail.com> Co-authored-by: Tom Cheung <cheungch@gmail.com>
2020-09-30 19:38:06 +03:00
},
// [TODO(macOS GH#774)
get DynamicColorMacOS(): DynamicColorMacOS {
return require('./Libraries/StyleSheet/PlatformColorValueTypesMacOS')
.DynamicColorMacOS;
}, // [TODO(macOS GH#774)
// [TODO(macOS GH#750)
get ColorWithSystemEffectMacOS(): ColorWithSystemEffectMacOS {
return require('./Libraries/StyleSheet/PlatformColorValueTypesMacOS')
.ColorWithSystemEffectMacOS;
}, // ]TODO(macOS GH#750)
Introduce flow type to differentiate between HostComponent, NativeMethodsMixin, and NativeComponent Summary: In React Native there are three types of "Native" components. ``` createReactClass with NativeMethodsMixin ``` ``` class MyComponent extends ReactNative.NativeComponent ``` ``` requireNativeComponent('RCTView') ``` The implementation for how to handle all three of these exists in the React Native Renderer. Refs attached to components created via these methods provide a set of functions such as ``` .measure .measureInWindow .measureLayout .setNativeProps ``` These methods have been used for our core components in the repo to provide a consistent API. Many of the APIs in React Native require a `reactTag` to a host component. This is acquired by calling `findNodeHandle` with any component. `findNodeHandle` works with the first two approaches. For a lot of our new Fabric APIs, we will require passing a ref to a HostComponent directly instead of relying on `findNodeHandle` to tunnel through the component tree as that behavior isn't safe with React concurrent mode. The goal of this change is to enable us to differentiate between components created with `requireNativeComponent` and the other types. This will be needed to be able to safely type the new APIs. For existing components that should support being a host component but need to use some JS behavior in a wrapper, they should use `forwardRef`. The majority of React Native's core components were migrated to use `forwardRef` last year. Components that can't use forwardRef will need to have a method like `getNativeRef()` to get access to the underlying host component ref. Note, we will need follow up changes as well as changes to the React Renderer in the React repo to fully utilize this new type. Changelog: [Internal] Flow type to differentiate between HostComponent and NativeMethodsMixin and NativeComponent Reviewed By: jbrown215 Differential Revision: D17551089 fbshipit-source-id: 7a30b4bb4323156c0b2465ca41fcd05f4315becf
2019-09-25 20:10:48 +03:00
get requireNativeComponent(): <T>(
uiViewClassName: string,
) => HostComponent<T> {
return require('./Libraries/ReactNative/requireNativeComponent');
},
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
get RootTagContext(): RootTagContext {
Merge from upstream through 2020-04-24 (#803) * Update default Podfile to not depend on a path (#28572) Summary: Recently, a default Podfile has been modified to not contain all the React Native pods, but use a helper method `use_react_native!`. While this is great, it assumes a hardcoded path of `../node_modules/react-native` to be always the correct location of the React Native. https://github.com/facebook/react-native/blob/d4d8887b5018782eeb3f26efa85125e6bbff73e4/scripts/autolink-ios.rb#L7-L9 Unfortunately, due to the way Ruby works, this completely hides the path away from the users. Before, they could have seen the wrong path explicitly in a Podfile and knew to update it to resolve path-related issues. With the current version in `master`, I can see a lot of issues where developers wonder how to resolve the path issues and how to pass the path itself. https://github.com/facebook/react-native/blob/4118d798265341061105f3a53550db83c66a71cb/template/ios/Podfile#L5-L10 This PR uses React Native CLI configuration (that is already used to link 3rd party dependencies) to explicitly define the correct path to the React Native. As a result, we don't have to change the paths here whether we're running monorepo or not. ## Changelog [IOS] [INTERNAL] - Always provide an explicit path to React Native Pull Request resolved: https://github.com/facebook/react-native/pull/28572 Differential Revision: D20945194 Pulled By: TheSavior fbshipit-source-id: 010f9754f2ed78ef62fd52f4d201f296f5af6d27 * Upgrade Prettier in Xplat to version 1.19.1 Summary: Upgrades Prettier in Xplat to 1.19.1 Ignores upgrading packages on already on versions greater than 1.19.1 Changelog: [Internal] allow-large-files bypass-lint (Note: this ignores all push blocking failures!) Reviewed By: gkz, cpojer Differential Revision: D20879147 fbshipit-source-id: 0deee7ac941e91e1c3c3a1e7d3d3ed20de1d657d * Stop using get_fbobjc_enable_exception_lang_compiler_flags_DEPRECATED in xplat Summary: Old deprecated function. Changelog: [Internal] Reviewed By: nlutsenko Differential Revision: D20148856 fbshipit-source-id: 79d6fb97824b059e50f67ff5a0b4c38ec7a19469 * Add ProGuard rule for hermes (#28571) Summary: This adds a ProGuard for `hermes` rule so it does not have to be added by users manually. https://github.com/facebook/react-native/issues/28270 ## 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 --> [Android] [Added] - ProGuard rule for hermes Pull Request resolved: https://github.com/facebook/react-native/pull/28571 Test Plan: 1. Create a project with/without hermes. 2. Enable proguard. Reviewed By: cpojer Differential Revision: D20947095 Pulled By: hramos fbshipit-source-id: 79b166ad2dd060f20041d9f5cfe2f794c754843d * Move CheckBox JS files to FB Internal Summary: Move CheckBox JS files to FB internal ## Changelog: [General] [Removed] This diff removes the CheckBox export from React Native. Internally, we are requiring CheckBox directly now and externally people will have to use the community maintained module. Reviewed By: cpojer Differential Revision: D20910775 fbshipit-source-id: 809e135dc3f68911ac0a004e6eafa8488f0d5327 * fix: ripple should be applied even when borderless == false (#28526) Summary: With current master, when you render `<Pressable android_ripple={{borderless: false}}>`, there is no ripple effect at all. I think the expected behavior is to have ripple with default color and radius, just not borderless. This was how it was done (by me) in https://github.com/facebook/react-native/pull/28156/files but in the import process, the implementation was changed: https://github.com/facebook/react-native/commit/bd3868643d29e93610e19312571a9736df2cbdf8 so either this PR is a fix or you can just close it (but I'd be curious why). ## 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 --> [Android] [fixed] - ripple should be applied even when borderless == false Pull Request resolved: https://github.com/facebook/react-native/pull/28526 Test Plan: `<Pressable android_ripple={{borderless: false}}>` on master ![SVID_20200404_123614_1](https://user-images.githubusercontent.com/1566403/78424971-6b315a80-7671-11ea-8be4-5fea428bc556.gif) `<Pressable android_ripple={{borderless: false}}>` in this PR ![SVID_20200404_122754_1](https://user-images.githubusercontent.com/1566403/78424986-8bf9b000-7671-11ea-9804-37cd58dbb61e.gif) Differential Revision: D20952026 Pulled By: TheSavior fbshipit-source-id: df2b95fc6f20d7e958e91805b1a928c4f85904f1 * Remove ColorAndroid function as it adds no value over PlatfromColor (#28577) Summary: This change removes the `ColorAndroid` API. It was added more as a validation tool than as something useful to a developer. When making the original [PlatformColor PR](https://github.com/facebook/react-native/pull/27908) we felt it was valuable and useful to have working platform specific methods for the two platforms in core to test that the pattern worked in app code (PlatformColorExample.js in RNTester) and that the Flow validation worked, etc. Practically `PlatformColor()` is more useful to a developer on Android than `ColorAndroid()`. Now that the construct has served its purpose, this PR removes the `ColorAndroid` function and its related tests and other collateral. ## 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 --> [Android] [Removed] - Remove ColorAndroid function as it adds no value over PlatfromColor Pull Request resolved: https://github.com/facebook/react-native/pull/28577 Test Plan: RNTester in both iOS and Android was tested. Jest tests, Flow checks, Lint checks all pass. Reviewed By: cpojer Differential Revision: D20952613 Pulled By: TheSavior fbshipit-source-id: 7d2cbaa2a347fffe59a1f3a26a210676008fdac0 * iOS: mark some old NativeModule targets with depslint_never_remove Summary: Label some BUCK targets properly. Changelog: [Internal] Reviewed By: shergin Differential Revision: D20960917 fbshipit-source-id: 42fa2266105b6c3dd5108a1b56035a19a95cd61f * Update Gradle Wrapper to 6.3 (#28173) Summary: ``` Welcome to Gradle 6.3! Here are the highlights of this release: - Java 14 support - Improved error messages for unexpected failures For more details see https://docs.gradle.org/6.3/release-notes.html ``` ## Changelog [Android] [Changed] - Update Gradle Wrapper to 6.3 Pull Request resolved: https://github.com/facebook/react-native/pull/28173 Test Plan: Build project Differential Revision: D20958894 Pulled By: mdvacca fbshipit-source-id: a02ab0eb6aff97148c12b844fdd1f9f2617ae53f * Fix crash inside RCTRedBox when trying to present same UIViewController twice Summary: Calling `-[RCTRedBox showErrorMessage]` twice causes a crash We used `-[UIViewController isBeingPresented]` to tell whether view controller is already presented. But from the documentation: > A Boolean value indicating whether the view controller is being presented. Source: https://developer.apple.com/documentation/uikit/uiviewcontroller/2097564-beingpresented?language=objc# --- So this means that if you present it, wait until presentation animation is finished and then call `-[RCTRedBox showErrorMessage]` again, following exception will be thrown. ``` *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present modally an active controller <UIViewController: 0x7fc33e422f50>.' ``` Changelog: Fix crash caused by presenting view controller twice from RCTRedBox Reviewed By: PeteTheHeat Differential Revision: D20946645 fbshipit-source-id: 763066e37db4e56efb0118b2e7867ad0724bae81 * Animated: Early detection of division by zero in AnimatedDivision Summary: We currently see a lot of errors happens because of division by zero in `AnimatedDivision` module. We already have a check for that in the module but it happens during the animation tick where the context of execution is already lost and it's hard to find why exactly it happens. Adding an additional check to the constructor should trigger an error right inside render function which should make the error actionable. Changelog: [Internal] Early crash in AnimatedDivision in case of division by zero. Reviewed By: mdvacca Differential Revision: D20969087 fbshipit-source-id: 0d98774b79be2cc56d468a4f56d2d7c8abf58344 * Fabric: Controlling DifferentiatorMode via ReactNativeConfig Summary: Now we can control the differentiator mode via MC. Changelog: [Internal] Fabric-specific internal change. Reviewed By: fkgozali Differential Revision: D20978857 fbshipit-source-id: 13264948762f02f874d8d051c873d378062d6db4 * Upgrade Hermes dependency to 0.5.0 Summary: Use the latest published release of hermes-engine. Update RN to invoke `hermesc` instead of `hermes`. Changelog: [Android] [Changed] - Upgraded to Hermes 0.5.0 allow-large-files Reviewed By: mhorowitz Differential Revision: D20998564 fbshipit-source-id: 4824e273bcb044029a5a7e9379f168d3da47da50 * Set width/height also to Undefined when we change the measure mode to Undefined Summary: Make sure width/height is always passed as Undefined when measure mode is changed to Undefined. Changelog: [Internal][Yoga] Set width and height as Undefined when we change measure mode to Undefined Reviewed By: alickbass Differential Revision: D20029838 fbshipit-source-id: b9931f6ddb13ffd1565889535ade5bbffbe0c304 * Remove redundant input from TextInput Summary: `const ReactNative` is assigned to but never used. Let's get rid of it. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D21016502 fbshipit-source-id: afcb0cfc501adf07e0c4d4452a831160e1cda088 * Update RNTester AppDelegate for changes made to SurfacePresenter API (#28580) Summary: This pull request updates RNTester's AppDelegate's Fabric mode to reflect changes made to the SurfacePresenter APIs. It now makes use of `RCTSurfacePresenterBridgeAdapter` to create its `SurfacePresenter`. ## Changelog [Internal] [Fixed] - Fixed outdated API usage in RNTester's AppDelegate Pull Request resolved: https://github.com/facebook/react-native/pull/28580 Test Plan: `RNTester/RNTester/AppDelegate.mm` now compiles without error when `RN_FABRIC_ENABLED` is enabled. Reviewed By: hramos Differential Revision: D20966067 Pulled By: mdvacca fbshipit-source-id: 8d0168d468240cff61554f2f2df799aaf5d876c1 * Retryable ViewCommand exceptions shouldn't crash Summary: Early ViewCommand Dispatch will solve this category of crashes by going through an entirely different codepath. For users not in that experiment, it might be good to have a mitigation that prevents non-critical issues from crashing (like "blur" failing). Currently, "blur" failures cause lots of screens to crash. There's no useful signal and those crashes aren't super actionable, so seems better to swallow. If/when early viewcommand dispatch ships as the default/only mode, we can remove this try/catch entirely. The only concern I have with landing this is the perf implications of putting a try/catch inside this loop. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D21023213 fbshipit-source-id: 310fe2d55a44bc424692a2365ccd5882f35f9d82 * Remove setMostRecentEventCount from TextInput view commands Summary: Changelog: [Internal] We don't use view command `setMostRecentEventCount`, let's get rid of it. Reviewed By: JoshuaGross Differential Revision: D21016600 fbshipit-source-id: 6491c063e9d6a89252300cb47c010b248e473f4b * label-actions: Add canned response for upgrade issues Summary: Enhance the label-actions config and support a "Type: Upgrade Issue" label. - Point to the Upgrade Support repository whenever the Type: Upgrade Issue label is applied. - Close the issue. Changelog: [Internal] label-actions: Add canned response for upgrade issues Reviewed By: cpojer Differential Revision: D20974607 fbshipit-source-id: 3cd7890aaeb1e57baf2acc5ca85a9b3ae5117c56 * Yoga Podspec: Export YGNode and YGStyle headers (#997) Summary: This pull request adds `YGNode.h` and `YGStyle.h` to the headers exported by Yoga's podspec. They are required by the new Fabric architecture of React Native. The modulemap and its umbrella header automatically generated by Cocoapods adds all exported headers to the `modulemap`. Having YGNode and YGStyle exported through here has problems, because they are only available in environments that have C++ available, and will produce errors otherwise. This pull request fences off the contents of those headers in an `#ifdef __cplusplus` block, so they will not cause errors when imported into environments where C++ isn't available. I had considered adding a custom modulemap to the podspec as part of this pull request, but this way seems the least "invasive", and this way you are able to add and remove exported headers in the podspec without needing to worry about updating the umbrella header at the same time. Changelog: [Internal] - Yoga Podspec: Export YGNore and YGStyle headers Pull Request resolved: https://github.com/facebook/yoga/pull/997 Reviewed By: hramos Differential Revision: D20966075 Pulled By: mdvacca fbshipit-source-id: 5f5caa6b639d11e660b968d681da9a4de6c0eb8e * Add logging to catch null TurboModules Summary: We're still seeing NativeModule eager-init crashes in T46487253. So, just to be extra careful, in case this diff doesn't fix the problem, I'm adding logging into `TurboModuleManager.getModule(moduleName)` to see why TurboModules are showing up as `null`. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D21027984 fbshipit-source-id: 74ee62aeac09a4fdb29547e90ef4fa7c07de17a6 * Remove module cache from ReactPackageTurboModuleManagerDelegate Summary: This cache is unnecessary, because: 1. TurboModuleManager caches all created TurboModules 2. TurboModuleManager calls into the TurboModuleManagerDelegate at most once per NativeModule `moduleName`. This diff also makes ReactPackageTurboModuleManager thread-safe, which should help get rid of the crashes in T46487253. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D21027998 fbshipit-source-id: c9b5ccc3da7b81787b749e70aa5e55883317eed7 * Control concurrent calls into TMMDelegate from TMM Summary: In D20659799, I improved `TurboModuleManager.getModule(moduleName)` thread-safety by ensuring that if two threads race to require the same NativeModule, only one thread creates the NativeModule, while the other one waits until it's created. ## The problem: What I failed to realize was that when two threads race to require two different NativeModules, we can get concurrent calls into `TurboModuleManagerDelegate.getModule(moduleName)`, and `TurboModuleManagerDelegate.getLegacyCxxModule(moduleName)`, which don't have any thread-safe guarantees. ## The fix `TurboModuleManagerDelegate` is supposed to be an input to the TurboModule system. So, rather than expecting that all TurboModuleManagerDelegates are thread-safe, which might be a reasonable ask (see T65532092), this diff has `TurboModuleManager` acquire the delegate's lock before calling into it. This ensures that we don't get concurrent access into the delegate, which could be reading from, or writing to, some data structure in these method calls. (This was the case with `ReactPackageTurboModuleManagerDelegate`, which is what Fb4a and Workplace use under the hood). Changelog: [Android][Fixed] - Control concurrent calls into TMMDelegate from TurboModuleManager Reviewed By: mdvacca Differential Revision: D21025965 fbshipit-source-id: d22c4abfe87f9e534717a06f186dde87d3cd24df * Bump eslint-plugin-react-native-community version to 1.1.0 Summary: This release will include the new platform-colors rule. Changelog: [Internal] (Note: this ignores all push blocking failures!) Reviewed By: cpojer Differential Revision: D21022163 fbshipit-source-id: 65c831b3c820e44f75631b935118b043180ab3c7 * Update Babel to 7.8.x/7.9.x Reviewed By: motiz88 Differential Revision: D20697095 fbshipit-source-id: ef35d02da0916109ce528d3026f7ca0956911dda * fix: do not throw on missing `cliPath`, use the default value (#28625) Summary: The `cliPath` has always been optional value and in fact, even had its default value hardcoded in the React gradle file. In this PR, I am just taking use of it and remove throwing an error, which is going to be a really annoying breaking change. ## Changelog [ANDROID] [INTERNAL] - Don't require `cliPath` Pull Request resolved: https://github.com/facebook/react-native/pull/28625 Test Plan: Run Android project, everything works. Provide custom `cliPath`, it gets respected Reviewed By: cpojer Differential Revision: D21044222 Pulled By: TheSavior fbshipit-source-id: 8029f988d92abb9f64f30e05932c0d407d0c997e * Fix CIRCLE_PR_NUMBER may not always be set (#28640) Summary: This fixes build failures where `CIRCLE_PR_NUMBER` is not set. This can happen if the PR did not come from a fork. ## Changelog [Internal] [Fixed] - Fix CIRCLE_PR_NUMBER may not always be set Pull Request resolved: https://github.com/facebook/react-native/pull/28640 Test Plan: Report bundle size step should pass on both this PR and https://github.com/facebook/react-native/issues/28641. Reviewed By: cpojer Differential Revision: D21045553 Pulled By: TheSavior fbshipit-source-id: fdfcb1bb88a96345b78ca69c49623df71d4cd608 * Add "Open Debugger" and "Open React DevTools" to iOS dev menu Summary: This diff introduces a new "Open Debugger" menu item for VMs that support on device debugging and for opening the React DevTools in Flipper. Provided so that we don't drift too far from the Android code. Changelog: [Internal] Reviewed By: RSNara Differential Revision: D20784270 fbshipit-source-id: 6bb16431d25a6c093a583e2e041b8cffa6765ddd * Changed iOS LaunchScreen from xib to storyboard (#28239) Summary: > Starting April 30, 2020, all apps submitted to the App Store must use an Xcode storyboard to provide the app’s launch screen and all iPhone apps must support all iPhone screens. Updated iOS Launch screen as per [App Store policy change](https://developer.apple.com/news/?id=03042020b). Community discussion: https://github.com/react-native-community/discussions-and-proposals/issues/209 ## Changelog Changed iOS Launch Screen from a `xib` to `storyboard`. The `LaunchScreen.xib` file has been replaced with `LaunchScreen.storyboard`. Xcode automatically picks up the new Launch Screen no additional change is required. [iOS] [Deleted] - Deleted LaunchScreen.xib [iOS] [Added] - Added LaunchScreen.storyboard Pull Request resolved: https://github.com/facebook/react-native/pull/28239 Test Plan: Build the Xcode project under `template/iOS` and verify that the new launch screen is identical to the previous one. Reviewed By: cpojer Differential Revision: D20408892 Pulled By: hramos fbshipit-source-id: 9c38df58d1304088a23f3d73e0fbd87675804f1a * Switch over to JavaTurboModule::InitParams Summary: ## Problem Every time we want to add, remove, or change the data passed to JavaTurboModule's constructor, we have to modify the C++ TurboModule codegen. (The same is true of `ObjCTurboModule`). **Why was this necessary?** - `JavaTurboModule` is effectively an abstract class whose constructor is always invoked by code-generated C++ classes. These C++ code-generated class constructors accept an argument list, and manually foward each and every item in that list to `JavaTurboModule::JavaTurboModule`. ## The fix In this diff, I introduce a struct `JavaTurboModule::InitParams`, to represent a bag of arguments: ``` class JSI_EXPORT JavaTurboModule : public TurboModule { public: struct InitParams { std::string moduleName; jni::alias_ref<JTurboModule> instance; std::shared_ptr<CallInvoker> jsInvoker; std::shared_ptr<CallInvoker> nativeInvoker; }; ``` All `JavaTurboModules` will be created with an instance of this `InitParams` struct, instead of a list of arguments. Our code-generated C++ `jsi::HostObject` sublcasses will simply accept `InitParams` in their constructor, and forward it to `JavaTurboModule`'s constructor. This way, the codegen remains oblivious to what arguments JavaTurboModule requires. ## Okay, but why do we need this change now? In the future, I plan to modify the constructor for `JavaTurboModule` to accept a performance logger, and a `RuntimeExecutor`. Similar modifications are planned for ObjC. For this reason, to avoid these four codemods, and any potential other codemods that occur because we're making modifications to `JavaTurboModule` or `ObjCTurboModule`, I'm launching this codemod, and the codemods in this stack. ## Misc Fix - Previously, we were generating the TurboModule name from the Spec filename. This is incorrect because that name represents the spec name. Now, the name will be forwarded from TurboModuleManager in the `JavaTurboModule::InitParams` struct. ## Alternative implementations I initially considered using `ContextContainer`, but decided against it because: 1. There are no type-safety guarantees. 2. I think it's a bit overkill for this scenario. We just need an opaque bag of data, and for our purposes a simple struct does the job fine. ## Commands run Reviewed By: fkgozali Differential Revision: D21035208 fbshipit-source-id: 9542cafea192081bc34d337ab3a7a783083eb06c * RN: Shrinkwrap Text Layout (Android) Summary: When text is in a constrained parent view using `maxWidth`, long text may wrap. When the text wraps, the final width is dependent on the word breaking strategy and text content. This means that the text width is not necessarily `maxWidth`. However, the current way that we compute text layout does not shrinkwrap the text width as much as possible. This leads to visual gaps to the end-side of wrapped text. This changes the text layout slightly so that we use the length of the longest line. This bug only exists on Android. After this change, Android behaves like iOS. Changelog: [Android] [Fixed] - Fixed excessive space in Text view with word-wrapping Reviewed By: JoshuaGross, mdvacca Differential Revision: D21056031 fbshipit-source-id: e9b7793f2632caafcce69bc15bac61330b0ed958 * (eslint-config) update community eslint plugin in eslint config (#28642) Summary: Updating the community eslint-plugin used in the eslint-config to the latest version. expecting new eslint-config version to be released with this change so that it can be included in new project template for 0.63 https://github.com/react-native-community/releases/issues/186 ## 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] - Update community eslint plugin in the eslint config Pull Request resolved: https://github.com/facebook/react-native/pull/28642 Test Plan: yarn lint passes Differential Revision: D21048976 Pulled By: cpojer fbshipit-source-id: 2c3ec0ef450cf357d8c88db7873f4ca1154b2034 * chore: update CLI to the latest version (#28623) Summary: Bumps CLI to the latest version, needed by https://github.com/facebook/react-native/pull/28572 to work. ## Changelog [INTERNAL] - Bump CLI to latest Pull Request resolved: https://github.com/facebook/react-native/pull/28623 Reviewed By: hramos Differential Revision: D21017766 Pulled By: cpojer fbshipit-source-id: 62a873923c58f8752edb0394db7e6dfceed92485 * Add "Open Debugger" and "Open React DevTools" to Android dev menu Summary: This diff introduces a new "Open Debugger" menu item for VMs that support on device debugging and for opening the React DevTools in Flipper. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20784279 fbshipit-source-id: caecdace00007224692d994a75c106842c8b2acb * Remove the post install step (#28651) Summary: Removes the post install step for Flipper, as the latest version of YogaKit is compatible with swift 5. cc alloy ## 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 --> [Flipper] [Template] - Remove the post install step for Flipper Pull Request resolved: https://github.com/facebook/react-native/pull/28651 Test Plan: Tested a newly created RN app without post install step and it built successfully. Reviewed By: passy Differential Revision: D21064653 Pulled By: priteshrnandgaonkar fbshipit-source-id: da56d0754d918e30a0ebe480c77590f0139d48ac * Revert D21064653: Remove the post install step Differential Revision: D21064653 Original commit changeset: da56d0754d91 fbshipit-source-id: 1086cfdeca9aa3830370ea115ba7b5f05d3fb124 * Remove out of date TODO Summary: No longer relevant. Changelog: [Internal] Reviewed By: mhorowitz Differential Revision: D21070955 fbshipit-source-id: 11b0384501b2780f5ac41899b5e8bbb4f7a4d730 * RNTester LayoutAnimation example: add more options Summary: Add more options to the LayoutAnimation example so it's easier to test more features of LayoutAnimations. 1) Add an option to animate reordering of views 2) Make animations slower, so it's easier to see what's going on and easier to trigger race conditions 3) Add options to mutate without animation, to test interrupting existing animations Changelog: [Internal] Updated Catalyst RNTester LayoutAnimation example with additional options Reviewed By: mdvacca Differential Revision: D21050309 fbshipit-source-id: 1daba4fd487693c34a2d40eb39a68c7d03c24f93 * Add a "reparenting" LayoutAnimation example that animates flattening/unflattening Summary: Simple test to see what it looks like when view flattening/unflattening is animated with LayoutAnimations. Changelog: [Internal] adding another example to LayoutAnimations example Reviewed By: mdvacca Differential Revision: D21074805 fbshipit-source-id: 551ed740f0ab5c5adcb19f5c35e932b8983cd108 * Fix jsi cmake include dirs (#207) Summary: I'm trying to use JSI for a React Native custom module. I saw these existing examples where the JSI API is used in the context of a CMakeLists.txt: https://github.com/terrysahaidak/host-object-test/blob/master/libs/android-jsi/test-jsi/src/main/cpp/CMakeLists.txt https://github.com/ericlewis/react-native-hostobject-demo/pull/4/files#diff-834320be1b4e4016bac27c05dcd17fb9 In both cases, they manually grab the include directories and jsi.cpp from node_modules/react-native, but I also saw that node_modules/react-native/ReactCommon/jsi/jsi already has a CMakeLists.txt that appears to be intended to provide a jsi static lib, so I tried to pull this into my own CMakeLists.txt like this: ``` add_subdirectory(${RN_DIR}/ReactCommon/jsi/jsi ${CMAKE_CURRENT_BINARY_DIR}/jsi) ... target_link_libraries(MyLib jsi) ``` Unfortunately when doing this, the consuming project still doesn't see the correct include directories. The change I'm proposing here is to use `target_include_directories` and declare that `..` is a public (to consumers) include directory for the library named `jsi`. With this change, you can do what I showed above to consume the jsi lib by just pulling in the CMakeLists.txt file into your own CMakeLists.txt file. Changelog: [General][Fixed] Fix jsi cmake include dirs Pull Request resolved: https://github.com/facebook/hermes/pull/207 Reviewed By: willholen Differential Revision: D21074270 Pulled By: tmikov fbshipit-source-id: 7d9ec3255f57a16c0b2be489dffa4540727738a1 * Resolve `kind-of` vulnerability by bumping to 6.0.3 Summary: https://github.com/advisories/GHSA-6c8f-qphg-qjgp Changelog: [General][Changed] Updated transitive dependency kind-of to 6.0.3 to resolve vulnerability (Note: this ignores all push blocking failures!) Reviewed By: cpojer Differential Revision: D21077747 fbshipit-source-id: d5c19b21b665130c6423f5caeddcd6378bac7dcb * Move CheckBox Android files to FB internal (#28658) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/28658 This moves the Java files to FB internal and updates all the buck files. ## Changelog: [Android] [Removed] This diff removes the CheckBox export from React Native. Internally, we are requiring CheckBox directly now and externally people will have to use the community maintained module. Reviewed By: cpojer Differential Revision: D21066998 fbshipit-source-id: 76821fcae899ff7342697ea7dd4737ef3b008213 * Part 1: Update ObjC++ codegen classes to use ObjCTurboModule::InitParams Summary: ## Summary Please check out D21035208. ## Changes - `ObjCTurboModule::ObjCTurboModule` changed to accept a bag of arguments `const ObjCTurboModule::InitParams` instead of an argument list. - TurboModule iOS codegen scripts updated to generated `ObjCTurboModule` subclasses that accept a `const ObjCTurboModule::InitParams` object in their constructor, and forward it to `ObjCTurboModule::ObjCTurboModule`. - All manually checked in code-generated ObjC++ classes (i.e: RCTNativeSampleTurboModule, RCTTestModule, FBReactNativeSpec) are updated. ## Rationale This way, the code-gen can remain constant while we add, remove, or modify the arguments passed to ObjCTurboModule. ## Commands run ``` function update-codegen() { pushd ~/fbsource && js1 build oss-native-modules-specs -p ios && js1 build oss-native-modules-specs -p android && popd; } > update-codegen ``` Changelog: [iOS][Changed] Update ObjCTurboModule to use ObjCTurboModule::InitParams Reviewed By: PeteTheHeat Differential Revision: D21036266 fbshipit-source-id: 6584b0838dca082a69e8c14c7ca50c3568b95086 * Part 2: Update ObjC++ codegen classes to use ObjCTurboModule::InitParams Summary: ## Summary Please check out D21035209. ## Changes - Codemod all ObjC NativeModule `getTurboModuleWithJsInvoker:nativeInvoker:perfLogger` methods to `getTurboModule:(const ObjCTurboModule::Args)` ## Script ``` var withSpaces = (...args) => args.join('\s*') var regexString = withSpaces( '-', '\(', 'std::shared_ptr', '<', '(?<turboModuleClass>(facebook::react::|react::|::|)TurboModule)', '>', '\)', 'getTurboModuleWithJsInvoker', ':', '\(', 'std::shared_ptr', '<', '(?<fbNamespace>(facebook::react::|react::|::|))CallInvoker', '>', '\)', '(?<jsInvokerInstance>[A-Za-z0-9]+)', 'nativeInvoker', ':', '\(', 'std::shared_ptr', '<', '(facebook::react::|react::|::|)CallInvoker', '>', '\)', '(?<nativeInvokerInstance>[A-Za-z0-9]+)', 'perfLogger', ':', '\(', 'id', '<', 'RCTTurboModulePerformanceLogger', '>', '\)', '(?<perfLoggerInstance>[A-Za-z0-9]+)', '{', 'return', 'std::make_shared', '<', '(?<specName>(facebook::react::|react::|::|)Native[%A-Za-z0-9]+SpecJSI)', '>', '\(', 'self', ',', '\k<jsInvokerInstance>', ',', '\k<nativeInvokerInstance>', ',', '\k<perfLoggerInstance>', '\)', ';', '}', ) var replaceString = `- (std::shared_ptr<$<turboModuleClass>>) getTurboModule:(const $<fbNamespace>ObjCTurboModule::InitParams &)params { return std::make_shared<$<specName>>(params); }` const exec = require('../lib/exec'); const abspath = require('../lib/abspath'); const relpath = require('../lib/relpath'); const readFile = (filename) => require('fs').readFileSync(filename, 'utf8'); const writeFile = (filename, content) => require('fs').writeFileSync(filename, content); function main() { const tmFiles = exec('cd ~/fbsource && xbgs -n 10000 -l getTurboModuleWithJsInvoker:').split('\n').filter(Boolean); tmFiles .filter((filename) => !filename.includes('microsoft-fork-of-react-native')) .map(abspath) .forEach((filename) => { const source = readFile(filename); const newSource = source.replace(new RegExp(regexString, 'g'), replaceString); if (source == newSource) { console.log(relpath(filename)); } writeFile(filename, newSource); }); } if (!module.parent) { main(); } ``` ## Re-generating diff ``` > hg revert -r .^ --all > node index.js # run script ``` Changelog: [iOS][Changed] - Make all ObjC NativeModules create TurboModules using ObjCTurboModule::Args Reviewed By: PeteTheHeat Differential Revision: D21036265 fbshipit-source-id: 404bcc548d1775ef23d793527606d02fe384a0a2 * Part 3: Update RCTTurboModuleManagerDelegate to use ObjCTurboModule::InitParams Summary: ## Summary Please check out D21035208. ## Changes - Update `RCTTurboModuleManagerDelegate getTurboModule:instance:jsInvoker:nativeInvoker:perfLogger` to use `RCTTurboModuleManagerDelegate getTurboModule:(const ObjCTurboModule::InitParams)` - Update all implementations of `RCTTurboModuleManagerDelegate` in accordance with this API change Changelog: [iOS][Changed] - Make RCTTurboModuleManagerDelegate create TurboModules via ObjCTurboModuleManager::InitParams Reviewed By: PeteTheHeat Differential Revision: D21036272 fbshipit-source-id: c16002c47db26e2ba143fc1080afe9e2fe1e7816 * chore: update `./scripts/test-manual-e2e.sh` (#28653) Summary: Recent changes broke the script - wrong path to open `RNTesterPods.xcworkspace` and other scripts - we change dir with `cd`. Another change is incorrect use of `RNTesterProject.xcodeproj` instead of a `xcworkspace`. This PR is a simple and short fix to make it run. ## Changelog [INTERNAL] - chore: update `./scripts/test-manual-e2e.sh` Pull Request resolved: https://github.com/facebook/react-native/pull/28653 Test Plan: Run `./scripts/test-manual-e2e.sh`. Things work. Differential Revision: D21079792 Pulled By: hramos fbshipit-source-id: 6bdb8be016f044852ed216ec53f80db40c84b5fd * use default value of enums YGDirection and YGMeasureMode instead of -1 Summary: Changelog: [Internal][Yoga] YGDirection variable was initialized incorrectly by casting -1 to YGDirection. Changing it to default value of direction Same for YGMeasureMode. Reviewed By: pasqualeanatriello Differential Revision: D20869042 fbshipit-source-id: 7bfe490193321baae875ef6fb49a938851950c9f * fix typo as there is no file called YGJNI.cpp (#990) Summary: fix typo in `YogaJNIBase.java` as there is no such file called `YGJNI.cpp` Pull Request resolved: https://github.com/facebook/yoga/pull/990 Reviewed By: pasqualeanatriello Differential Revision: D20735102 Pulled By: SidharthGuglani fbshipit-source-id: 3f9f4d78ba390feae3451330f997a221ab4ec70e * Remove unused packages from xplat/js/package.json Summary: We have a large amount of small packages that are completely unused, or only have one call site. This diff cleans up a lot of them and reduces node_modules by 12 MiB (down to 187). Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D21088213 fbshipit-source-id: 5fa7d3da5cbe744b0d9d3e3450d6135c1488ee79 * Make ColorValue public in StyleSheet.js Summary: This diff makes the ColorValue export "official" by exporting it from StyleSheet in order to encourage its use in product code. Changelog: Moved ColorValue export from StyleSheetTypes to StyleSheet Reviewed By: TheSavior Differential Revision: D21076969 fbshipit-source-id: 972ef5a1b13bd9f6b7691a279a73168e7ce9d9ab * Fabric: `LayoutableShadowNode:getLayoutMetrics` is not a virtual method anymore Summary: We don't use it as vitrual anymore (setLayoutMetrics is a non-virtual method already), so it does not need to be marker virtual. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D21028572 fbshipit-source-id: 99f86fdd4cf2f5972034d9058d7b82bdc8680187 * Fabric: Proper traits for `ImageShadowNode` and `ViewShadowNode` Summary: * <Image> must be a leaf node; having a proper trait will fail earlier in case of misuse (mounting something inside). * <View> must have a `View` trait because it's for what that trait is. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D21028573 fbshipit-source-id: 457716d4661333eb2357f34316f3e495ab4fda24 * Fabric: "Attempt to mutate a sealed object." is now an assert (not exception) Summary: This is a debug-only feature that simply should be an assert. When it triggers in debugger and bubbles to some random exception catch block which makes it impossible to understand was exactly it happens. Making it an assert will stop debugger exactly where it happens. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D21028571 fbshipit-source-id: 3df4ec0da922026bb9df61081cb71113577e06e9 * Fabric: Implementation of `getDebugDescription` for `std::array` Summary: Yoga uses `std::array` a lot (and `std::array` is not a `std::vector`), so it's useful for printing Yoga values. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D21028570 fbshipit-source-id: c6bf114d5362f085ea201ecdc5b7d59646b33ebd * Fabric: `componentregistry` module was decoupled from `uimanager` Summary: We need to break up the `uimanager` module in order to solve circular dependencies problem (which future diff would have otherwise). Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D20885163 fbshipit-source-id: 08eb1ba1d408fc0948e8d0da62380786a40973af * Fabric: `scheduler` module was decoupled from `uimanager` Summary: We need to break up the `uimanager` module in order to solve circular dependencies problem (which future diff would have otherwise). Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D20885645 fbshipit-source-id: 8148bd934879802b076261ed86fa78acf0a07ed3 * Fabric: `templateprocessor` module was decoupled from `uimanager` Summary: We need to break up the `uimanager` module in order to solve circular dependencies problem (which future diff would have otherwise). Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D20885646 fbshipit-source-id: b8e3199c0eacc57a5be1481595cf97c84f972293 * Migrate deprecated frameInterval to preferredFramesPerSecond (#28675) Summary: [frameInterval](https://developer.apple.com/documentation/quartzcore/cadisplaylink/1621231-frameinterval) was deprecated in favor of [preferredFramesPerSecond](https://developer.apple.com/documentation/quartzcore/cadisplaylink/1648421-preferredframespersecond). This migrates the deprecated call over. ## 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] - Migrate frameInterval to preferredFramesPerSecond Pull Request resolved: https://github.com/facebook/react-native/pull/28675 Test Plan: Xcode should no longer throw warnings about the deprecated call. Differential Revision: D21109710 Pulled By: shergin fbshipit-source-id: 772b9f625d3e22cd4d8cd60bddad57ff8611af54 * Fabric: Fix case of Glog include in MountingTest.cpp (#28616) Summary: This pull request changes the include of Glog from `<Glog/logging.h>` to `<glog/logging.h>` in `MountingTest.cpp`. This fixes building on a case-sensitive filesystem. ## Changelog [Internal] [Fixed] - Fabric: Fix case of Glog include in MountingTest.cpp Pull Request resolved: https://github.com/facebook/react-native/pull/28616 Test Plan: The `include` of Glog no longer causes issues with building `MountingTest.cpp` on a case-sensitive filesystem. Differential Revision: D21118085 Pulled By: shergin fbshipit-source-id: c958c54bf88333fd5001127779c855ce8c2666c3 * Fabric: Add Unicode prefix to AttachmentCharacter (#28617) Summary: This pull request adds a Unicode `u8` prefix to the string literal returned in `AttributedString.cpp`'s `Fragment::AttachmentCharacter()`. This fixes the following error when building on MSVC: ``` react\attributedstring\AttributedString.cpp(21): error C4566: character represented by universal-character-name '\uFFFC' cannot be represented in the current code page (1252) ``` ## Changelog [Internal] [Fixed] - Fabric: Add Unicode prefix to AttachmentCharacter Pull Request resolved: https://github.com/facebook/react-native/pull/28617 Test Plan: The Fabric test suite has been ran on a Clang-based build of Fabric on macOS, and no regressions in it have been noted. Differential Revision: D21118078 Pulled By: shergin fbshipit-source-id: c105de5e4edb67fed97ce44153a75d9d380bf588 * Fabric: Fixed incorrect early-return in `UIView+ComponentViewProtocol::updateLayoutMetrics` Summary: Before the change, an incorrect (NaN or Inf) values in LayoutMetrics might force an early return in the `updateLayoutMetrics:oldMetrics:` method implementation. This was not correct because the rest of the method also didn't run in this case, so it might force some value to stale. E.g., imagine we have an instruction that contains NaN size and `display: none`. Previously, the function might just return right before applying sizes and progress the stored "already applied" value of LayoutMetrics which will cause the view being visible even if it should not. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D21110644 fbshipit-source-id: 501319d7b1dcd5c18f27e0ceca3c8d207485c49b * Fix border-stroke drawing after resetting border-radius (#28356) Summary: This PR fixes incorrect drawing of the View borders on Android, after changing the border-radius back to 0 *(and when no background-color is defined)*. This happens because the `drawRoundedBackgroundWithBorders` function in ReactViewBackgroundDrawable changes the style on the Paint object to `STROKE`. This style is however never reverted back to `FILL`. This change ensures that the Paint style is set to `FILL` for the full execution of the `drawRectangularBackgroundWithBorders` function. ## Changelog `[Android] [Fixed] - Fix border-drawing when changing border-radius back to 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28356 Test Plan: **Faulty situation:** ![ezgif com-video-to-gif](https://user-images.githubusercontent.com/6184593/77153163-9759b280-6a99-11ea-82bb-33a1e0a4934c.gif) **After the fix:** ![ezgif com-video-to-gif (1)](https://user-images.githubusercontent.com/6184593/77153825-c91f4900-6a9a-11ea-8e0c-a4280b9e72b8.gif) Differential Revision: D21124741 Pulled By: shergin fbshipit-source-id: 2044f8e8ad59a58df42b64d7ee8c4ad1d3b562f1 * Fabric: Using proper clock in MountingTelemetryTest Summary: Apparently, `std::this_thread::sleep_for` uses a different clock to measure time which causes ofter misalignment with the clock which Telemery uses which makes the test flaky. Using the same clock should fix it. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D21116058 fbshipit-source-id: 52dde2e325776d365431a2a957dcc12dfe53f890 * Fix rounded border drawing when border-radius is smaller than border-width (#28358) Summary: This PR fixes the drawing of the border rounded edges when the border-radius is small than the border-width. The current implementation capped the possible border-radius making it impossible to set smaller border-radii when using thicker borders. After inspection it was found that the rounded-rect calculation is incorrect. ## Changelog `[Android] [Fixed] - Fix rounded border-drawing when border-radius is smaller than border-width` Pull Request resolved: https://github.com/facebook/react-native/pull/28358 Test Plan: **Faulty situation:** As you can see, when the border-radius becomes very low, the border is stuck at a minimum value. Only after setting the border-radius fully to 0 is it again rendered correctly. ![ezgif com-video-to-gif (2)](https://user-images.githubusercontent.com/6184593/77183540-c3435b00-6ace-11ea-950d-29a0ea1757bd.gif) **After the fix:** ![ezgif com-video-to-gif (3)](https://user-images.githubusercontent.com/6184593/77183619-e837ce00-6ace-11ea-93a5-910127d352b7.gif) Differential Revision: D21124739 Pulled By: shergin fbshipit-source-id: cefd1776b77b5b9fb335e95fd7fdd7f345579dc4 * Fabric: `ComponentDescriptor::cloneProps()` now never returns the base props objects Summary: The diff changes how the `empty raw props` optimization works in `ComponentDescriptor::cloneProps()`. Now it only fires only when the base `props` object is null, which is practically all production cases we have (and care about). (I tried, in a normal run there were no cases where the empty raw props were passed with non-null props.) From the other side, the old behavior that may return the same props objects previously several times created bugs and practically unexpected results and practically disallowed to clone props objects easily. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D21110608 fbshipit-source-id: 884807cd8e9c5c3e6cc1c9e4c1f0227259cc21fb * Upgrade to Jest 25 Summary: This diff upgrades Jest to the latest version which fixes a bunch of issues with snapshots (therefore allowing me to enable the Pressable-test again). Note that this also affects Metro and various other tooling as they all depend on packages like `jest-worker`, `jest-haste-map` etc. Breaking changes: https://github.com/facebook/jest/blob/master/CHANGELOG.md This diff increases node_modules by 3 MiB, primarily because it causes more duplicates of `source-map` (0.8 MiB for each copy) and packages like `chalk` 3.x (vs 2.x). The base install was 15 MiB bigger and I reduced it to this size by playing around with various manual yarn.lock optimizations. However, D21085929 reduces node_modules by 11 MiB and the Babel upgrade reduced node_modules by 13 MiB. I will subsequently work on reducing the size through other packages as well and I'm working with the Jest folks to get rid of superfluous TypeScript stuff for Jest 26. Other changes in this diff: * Fixed Pressable-test * Blackhole node-notifier: It's large and we don't need it, and also the license may be problematic, see: https://github.com/facebook/jest/pull/8918 * Updated jest-junit (not a Jest package) but blackholed it internally because it is only used for open source CI. * Updated some API calls we use from Jest to account for breaking changes * Made two absolutely egrigious changes to existing product code tests to make them still pass as our match of async/await, fake timers and then/promise using `setImmediate` is tripping up `regenerator` with `Generator is already run` errors in Jest 25. These tests should probably be rewritten. * Locked everything to the same `resolve` version that we were already using, otherwise it was somehow pulling in 1.16 even though nothing internally uses it. Changelog: [General] Update Jest Reviewed By: rickhanlonii Differential Revision: D21064825 fbshipit-source-id: d0011a51355089456718edd84ea0af21fd923a58 * Apply placeholderColor to TextInput component Summary: Changelog: [Internal] TextInput's `placeholderTextColor` prop was being ignored. This diff fixes that. Reviewed By: JoshuaGross Differential Revision: D21064118 fbshipit-source-id: 33f148c355cee846db010153e0c65ea43155c3c9 * Fix mistake in swapping left/right layout properties Summary: Changelog: [Internal] We were assigned `undefined` value to incorrect edge, instead of `YGEdgeLeft` it should have been `YGEdgeRight`. If node has `YGEdgeRight` value, it needs to be reassigned to `YGEdgeEnd` and its original value set to undefined. Reviewed By: mdvacca Differential Revision: D21095234 fbshipit-source-id: fbecd9b7e6670742ad4a4bb097760aa10eec8685 * Fixed incorrect owner assignment in YGNode move constructor Summary: Assigning self as an owner makes a cycle which is obviously a bug. Changelog: [Internal] Small change in Yoga (should not affect RN). Reviewed By: SidharthGuglani Differential Revision: D21111423 fbshipit-source-id: 1835561c055ac827f5ce98a044f25aed0d1845a5 * Easy diff to add a TODO Summary: Easy diff to add a TODO to refactor `sendAccessibilityEvent` to use ViewCommands This was orginally added D17142507 changelog: [Internal] Internal change Reviewed By: JoshuaGross Differential Revision: D21137348 fbshipit-source-id: aff38ccad8dfbb222f83161e2bd5da82f543e5db * Add support for generating custom messages Summary: Until now we've generated scaffolding entirely based on the official devtools protocol spec. This diff adds support for defining custom domains in `custom.json` which will be merged with the upstream protocol JSON definition. ChangeLog: [Internal] Add support for Hermes-specific CDP messages Reviewed By: bestander Differential Revision: D20754605 fbshipit-source-id: a8075f81816a40114d1a3332192c7aa076b17848 * Implement Hermes.setPauseOnLoad Summary: This Hermes-specific mode is similar to Debugger.setPauseOnExceptions and lets the VM know that it should enter a Pause state whenever a new script is loaded/executed. The debugger can then take its time to parse the source map and update any breakpoints, before automatically continuing. Changelog: [Internal] Implement a Hermes.setPauseOnLoad CDP call Reviewed By: bestander Differential Revision: D20754604 fbshipit-source-id: 7f9d0638706c99e9dcb534699b633f658e364909 * Switch isPackagerRunning to a class method. Summary: This diff exports `isPackagerRunning` as a class method to be used without and instance. Changelog: [Internal] Reviewed By: cpojer Differential Revision: D21094414 fbshipit-source-id: 44becb59e3c08d66e4992c4c1b32d6efcd4fe257 * Fabric: Fixed `getDirtied` vs `isDirty` in `YogaLayoutableShadowNode` Summary: This is quite a fateful mistake. `getDirtied()` returns the pointer to a function which is obviously a mistake here; we should use `isDirty()` instead. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D21028569 fbshipit-source-id: 95212b31f4e32d51c594d5209f295397af3f1252 * Fabric: More strict policies to dirty Yoga nodes in YogaLayoutableShadowNode Summary: Yoga uses a dirty flag to re-layout nodes. In normal, single-threaded approach the policy for dirtying is simple: if a node was changed, we need to dirty it. In the Concurrent Yoga approach, those rules are not so simple, and it seems we haven't formalized those rules yet. Investigating some layout issues that we have in Fabric, I tend to believe that we don't dirty as much we should. Hense this change adds mode dirtying. Reviewed By: JoshuaGross Differential Revision: D21092815 fbshipit-source-id: 4603c97ccb79efcdf5e6a4cc450ebe61b63effb3 * Allow iOS PlatformColor strings to be ObjC or Swift UIColor selectors (#28703) Summary: Per discussion in https://github.com/react-native-community/releases/issues/186 the iOS `PlatformColor()` function is documented to use the semantic color names provided by the system. The referenced HIG documentation itself links to the `UIColor` documentation for semantic colors names. However, these names differ depending on if you are viewing the new Swift API docs or the Objective C docs. The current Objective C implementation in react-native assumes Objective C UIColor selector names that are suffixed 'Color'. But in Swift, Apple provides a Swift Extension on UIColor that makes aliases without the the 'Color' suffix and then makes the original selectors invalid presumably via `NS_UNAVAILABLE_SWIFT`. Since both selector names are valid depending on if you are using Objective C or Swift, let's make both forms be legal for `PlatformColor()`. In `RCTConvert.m` there is a dictionary of legal selector names. The code already supports the ability to have names be aliases of other selectors via a RCTSelector metadata key. The change adds code to the initialization of the map: it iterates over the keys in the map, which are all ObjC style UIColor selectors, and creates aliases by duplicating the entries, creating key names by stripping off the ObjC "Color" suffix, adds the RCTSelector key referring to the original and then appends these new Swift aliases to the map. ## Changelog [iOS] [Changed] - Allow iOS PlatformColor strings to be ObjC or Swift UIColor selectors Pull Request resolved: https://github.com/facebook/react-native/pull/28703 Test Plan: The PlatformColorExample.js is updated to use the new, shorter Swift selector names. There are still other examples in the same file and in unit tests that exercise the ObjC selector names. <img width="492" alt="PlatformColor" src="https://user-images.githubusercontent.com/30053638/79809089-89ab7d00-8324-11ea-8a9d-120b92edeedf.png"> Reviewed By: shergin Differential Revision: D21147404 Pulled By: TheSavior fbshipit-source-id: 0273ec855e426b3a7ba97a87645859e05bcd4126 * Update Differ test Summary: Update differ test so it passes again. Previously to D21111423 (I think) nodes were being incorrectly detected as updated even if they weren't different, so now there are fewer unnecessary Update mutations generated. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D21148647 fbshipit-source-id: cab6e3ecd0a457e1ac3155b3468bcc56663dab0b * Enable Yoga logging in Fabric Debug Summary: This diff extends Fabric to support Yoga logging changeLog: [Internal] Internal changes in Fabric to enable yoga logging Reviewed By: JoshuaGross Differential Revision: D21150195 fbshipit-source-id: a2e8308a79a7b422bf9ecc3a65f822b305f02c5d * Easy diff to document in code how to enable logging of Shadow Tree instrospection Summary: Easy diff to document in code how to enable logging of Shadow Tree instrospection changeLog: [Internal] Internal change used on Fabric Reviewed By: JoshuaGross Differential Revision: D21150196 fbshipit-source-id: 8eb23ec3ea1d574b79b09333428ab52c851065dd * Flip text alignment in case layout direction is RTL Summary: Changelog: [Internal] Flip text alignment in case layout direction is RTL. Reviewed By: JoshuaGross, mdvacca Differential Revision: D21130371 fbshipit-source-id: cf56ca052c17a48e321803b0f99f8a4baaa0e67b * Daily `arc lint --take GOOGLEJAVAFORMAT` Reviewed By: zertosh Differential Revision: D21154707 fbshipit-source-id: 11956915c265f98e286638b91d66d51545e3a311 * Upgrade Flipper to 0.37.0 (#28545) Summary: Bump flipper to 0.37 for both iOS and Android ## Changelog [Android] [Changed] - Upgrade Flipper to 0.37.0 [iOS] [Changed] - Upgrade Flipper to 0.37.0 Pull Request resolved: https://github.com/facebook/react-native/pull/28545 Test Plan: RNTester build pass Reviewed By: rickhanlonii Differential Revision: D20930069 Pulled By: hramos fbshipit-source-id: a7cb719da3e51e6a42d27d5e64bc664398d0d3c5 * Upgrade babel-eslint in xplat/js Summary: `babel-eslint` is the parser you can supply to ESLint based off of Babel. `babel-eslint` 10.1.0 is the newest production version of `babel-eslint`. There are very few changes between 10.0.1 (the lowest previous version) and 10.1.0. There are only 3 non-version-bump commits: 2 bug fixes and enabling parsing of Flow enums. The only project that was on a lower version than 10.0.1 was `/xplat/js/RKJSModules/Libraries/Relay/oss/__github__` - test below Changelog: [Internal] Reviewed By: cpojer Differential Revision: D21055850 fbshipit-source-id: bae0d8af5c6d833a4dbb0ad775c8e5e78ead1051 * RN: Create `RootTag` Type Summary: Creates a `RootTag` type and refactors the `RootTagContext` module a bit. This creates space for eventually changing `RootTag` into an opaque type that is only created once by `AppContainer`, and only consumed by native abstractions. Changelog: [Internal] (Note: this ignores all push blocking failures!) Reviewed By: cpojer Differential Revision: D21127173 fbshipit-source-id: 60177a6e5e02d6308e87f76d12a271114f8f8fe0 * RN: Add `RootTag` Type to TurboModule Summary: Adds `RootTag` as a valid type for arguments and return types in TurboModules (on both Android and iOS). This will enable us to change `RootTag` into an opaque type. There are two compelling reasons to do this: - JavaScript will no longer be able to safely depend on `RootTag` being a number (which means we can change this in the future). - Call sites using `unstable_RootTagContext` will can get a `RootTag`, but call sites using the legacy `context.rootTag` will not. This means the opaque type will give us a strategy for migrating away from legacy context and eventually making `unstable_RootTagContext` the only way to access `RootTag`. Changelog: [Internal] (Note: this ignores all push blocking failures!) Reviewed By: RSNara Differential Revision: D21127170 fbshipit-source-id: baec9d7ad17b2f8c4527f1a84f604fc0d28b97eb * RN: Fix Codegen Schema Buck Dependency (#28719) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/28719 The Buck dependencies for the schema rule is missing the source files for the new codegen (and specifically, the parser). Changelog: [Internal] (Note: this ignores all push blocking failures!) Reviewed By: cpojer Differential Revision: D21162993 fbshipit-source-id: 4addb6f257134e245a5d86dd427ee2536ed6d658 * Flow 0.123.0 in xplat/js Summary: Changelog: [Internal] ## Sync of generated files Ran ``` js1 upgrade www-shared -p core_windowless ``` but had to manually revert ``` RKJSModules/Libraries/www-shared/core_windowless/logging/FBLoggerType.flow.js RKJSModules/Libraries/www-shared/core_windowless/logging/FBLogger.js ``` because they introduced more errors ## Flow version bump ``` ~/fbsource/fbcode/flow/facebook/deploy_xplat.sh 0.123.0 ``` Reviewed By: gkz Differential Revision: D21159821 fbshipit-source-id: e106fcb43e4fc525b9185f8fc8a246e6c3a6b14f * Remove outdated metro type definitions Summary: RN itself does not depend on Metro any longer, which is abstracted away into the CLI. I don't think we need those type definitions any longer as we have proper Metro definitions internally. I'm removing them because they keep showing up in biggrep when I look for things. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D21089924 fbshipit-source-id: 2845277af12dae0f0baefaf85adefffb6ef9f2a5 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D21175893 fbshipit-source-id: 101734c1b968ce241a15648efdcaeabbd789952d * remove tvOS from template (#28706) Summary: According to the [0.62 blog post](https://reactnative.dev/blog/2020/03/26/version-0.62), Apple TV support has moved to react-native-tvos. The template still contains info.plist for tvOS, so I've removed them for future releases. ## 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] [Removed] - Removed tvOS related files from the template Pull Request resolved: https://github.com/facebook/react-native/pull/28706 Test Plan: run `react-native init TestTemplate` and remove tvOS related files and verified that iOS and Android runs on emulator. Differential Revision: D21182211 Pulled By: hramos fbshipit-source-id: 41d2e19e5158d7ec103a37c01a93cf511fc1e4c9 * Fabric: `ConcreteShadowNode::initialStateData()` now accepts a `ShadowNodeFamilyFragment` instead of just a `SurfaceId` Summary: We need it to be able pass an `EventEmitter` object to constructed concrete State objects. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D21169581 fbshipit-source-id: 3eef0310de7e2f061108aa85c1a39678a43fe85e * Fabric: Introducting `ShadowNodeFamilyFragment::Value` Summary: `ShadowNodeFamilyFragment::Value` is a value couter-part type for `ShadowNodeFamilyFragment`. We need that to be able safely copy data stored inside a `ShadowNodeFamilyFragment` object. Changelog: [Internal] Fabric-specific internal change. Reviewed By: kacieb Differential Revision: D21169580 fbshipit-source-id: 1a485e1b2ae47bc7da9476a60466934ac9d61366 * Overhaul RCTTurboModule creation and initialization Summary: ## Problems: In my investigation of T65656635, I realized that the TurboModule system has a number of problems: - In TurboModules, we use 1 lock to create n TurboModules. We should change this setup to n locks for n TurboModules. This way, two threads creating two different NativeModules don't compete for the same lock. Also, this is how it's done in Android (TurboModules & NativeModules), and iOS (NativeModules). - In TurboModules, we don't calculate "requires main queue setup" faithfully. In the legacy system, if a NativeModule has a custom `init` method or a custom `constantsToExport` method, it "requires main queue setup" with a warning. - In TurboModules, we don't create the NativeModule on the main queue, if "requires main queue setup" is true. Instead, the NativeModule is always created on the thread that requires it. - In TurboModules, we don't perform any concurrency control around `id<RCTTurboModule>` setup. We should. ## What this diff does In this diff, I fixed all the aforementioned issues by re-implementing `provideRCTTurboModule:`. **Algorithm Notes:** - **Gist:** When `n` threads race to create NativeModule `x`, only the first thread creates and sets up `x`. All others are told to wait. Once the creator thread finishes its job, it notifies all other waiting threads, which then wake up and return the newly created NativeModule. This algorithm was initially implemented in NativeModules for Android inside (ModuleHolder.java). I modified and implemented it for TurboModules for Android, and now this diff implements it for TurboModules for iOS. - The TurboModule cache is replace with a TurboModuleHolder map. A TurboModuleHolder manages the creation lifecycle of a TurboModule, and holds a condition variable and mutex for doing concurrency control around it. When the bridge invalidates, in TurboModuleManager, we set the `invalidating` flag to true, which prevents the insertion of new entries into the TurboModuleHolder map. - I added a `std::mutex` to serialize calls into the TurboModuleManagerDelegate, so we don't get races if the delegate isn't thread-safe. Changelog: [iOS][Fixed] - Re-implement RCTTurboModuleManager provideRCTTurboModule: Reviewed By: shergin Differential Revision: D21170099 fbshipit-source-id: 8792812c2237d3bfc80c9834c818e011de85b0ea * Fix folly::dynamic crash when attaching a debugger to Hermes Summary: folly_futures was compiled with and exported -DFOLLY_MOBILE=1, while folly_json did not. This flag disables fancy F14 data structures for folly::dynamic in favor of a simple std::unordered_map. This caused inlined/templated code from modules depending on folly_futures to disagree with the implementations in folly_json, leading to a crash. The only such libraries were libhermes-inspector and (transitively) libhermes-executor-debug, and these only use folly::dynamic for CDP serialization, which is why the problem was not more apparent. Changelog: [Internal] Fix crash when attaching a Hermes debugger Reviewed By: mhorowitz Differential Revision: D21193307 fbshipit-source-id: 2b795bb6f4f7f991e2adaacec62d62616117322b * Set black as default text color for <TextInput/> on iOS (#28708) Summary: This is a follow-up pull request to https://github.com/facebook/react-native/issues/28280 (reviewed by shergin). This pull request tried to solve the problem of the default color in a TextInput in dark mode on iOS being white instead of black. I got suggested to solve the problem not on the level of RCTTextAttributes, but on the level of RCTUITextField. Setting `self.textColor = [UIColor black];` in the constructor did not work, because it gets overwritten by nil in `RCTBaseTextInputView.m`. There I implemented the logic that if NSForegroundColorAttributeName color is nil then the color is being set to black. I think the `defaultTextAttributes` property confuses here, because it ends up being the effective text attributes, e.g. if I unconditionally set the default text color to black, it cannot be changed in React Native anymore. So I put the nil check in. ## Changelog [iOS] [Fixed] - TextInput color has the same default (#000) on iOS whether in light or dark mode Pull Request resolved: https://github.com/facebook/react-native/pull/28708 Test Plan: I have manually tested the following: - The default text color in light mode is black - The default text color in dark mode is black - The color can be changed using the `style.color` attribute - Setting the opacity to 0.5 results in the desired behavior, the whole TextInput becoming half the opacity. – Setting the `style.color` to rgba(0, 0, 0, 0.5) works as intended, creating a half-opaque text color. Differential Revision: D21186579 Pulled By: shergin fbshipit-source-id: ea6405ac6a0243c96677335169b214a2bb9ccc29 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D21202121 fbshipit-source-id: 6acb53e6ca941e465b11aeac4215533c16067eed * RN: Rename `{ => Event}ObjectPropertyType` in Codegen Summary: Straightforward rename to clarify the purpose of this type. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D21160790 fbshipit-source-id: eaf5e8c9f51e16134e153a6321857234be1aa338 * RN: Rename `{NativePrimitive => ReservedProp}TypeAnnotation` in Codegen Summary: Straightforward rename to clarify the purpose of this type. The current naming made more sense before the codegen also produced code for NativeModules. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D21160793 fbshipit-source-id: 6787ef298e32ff1b4d506afd831af96764f5af6f * RN: Rename `{ => NativeModule}MethodTypeShape` in Codegen Summary: Straightforward rename to clarify the purpose of this type. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D21160791 fbshipit-source-id: 422d09243edda0660815eb2f0ce51f7e56134983 * RN: Add `RootTag` Codegen Parser Test (and Cleanup) Summary: Adds a `RootTag` parser test for the new codegen for NativeModules/TurboModules. I'm doing this in a prerequisite commit in order to make the diff of the diff clearer when I implement proper support for `RootTag`. This also fixes some of the minor typos and mistakes that I noticed. I also wanted to land these benign snapshot changes independent of the upcoming behavior changes. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D21160792 fbshipit-source-id: 5f29f34035da30d7afa2369dbc19e95954553e88 * RN: Add `RootTag` to New NativeModule Codegen Summary: Adds support for `RootTag` in the new codegen for NativeModules/TurboModules. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D21160788 fbshipit-source-id: 952189f6e8bc8fde8b403d4c0e77b5d66b3f03e4 * RN: Add `RootTag` to New Commands Codegen Summary: Adds support for `RootTag` in the new codegen for Native Component Commands. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D21169371 fbshipit-source-id: 3b25433f3328e9c04cfe45bb176fc06d63559f14 * BackHandler: specify function return type for handler (#28192) Summary: Following the comment https://github.com/DefinitelyTyped/DefinitelyTyped/pull/42618#discussion_r384584159 Modify the flowtype of BackHandler function to have more specific return type. ## Changelog [General] [Changed] - Changed type of BackHandler to be more specific. Pull Request resolved: https://github.com/facebook/react-native/pull/28192 Test Plan: No flow error in RNTester Reviewed By: TheSavior Differential Revision: D20771113 Pulled By: hramos fbshipit-source-id: 5ca65e2a2b3f8726b8fb4606473d8fad5b0ce730 * Fabric: Simplifying Yoga and Fabric integration Summary: The integration with Yoga was pretty complex from day one. The first attempt to make it simpler was in D19963353 when we removed a bunch of layers of indirection. This is the second iteration that aimed to simplify the structure of methods and their responsibilities. The only conceptual change (that I am aware of) in this diff is that now we don't support (imaginary) case where a non-leaf YogaLayoutableShadowNode can have a non-YogaLayoutableShadowNode child. In the previous version, it was a no-op, now it's not supported and an assert will fire. Alongside with refactoring, this diff implements several helper functions that verify the invariants important for the Concurrent Layout in debug mode. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D21198222 fbshipit-source-id: cc085904948056f861562af5bd2571de45a743b9 * Clean up comments about null state wrappers Summary: Updating state with a null wrapper is neither desirable, nor possible. The underlying task was closed, just cleaning up comments. Changelog: [Internal] comments only Reviewed By: mdvacca Differential Revision: D21186545 fbshipit-source-id: d14ddd59d42e8fd91c6e7fd50037311d4e8d0b60 * Modal: disable view flattening explicitly for the children of Modal, the content wrappers Summary: I noticed that in ModalHostShadowNode.java (not used in Fabric), there's an assumption that the Modal will have exactly one child on the native side; this child is explicitly specified in Modal.js. However, in Fabric, these views are flattened and so the Modal will actually have N children - whatever children the product code passes into the Modal. In *theory* this should be fine, but might be causing issues. Not sure. This is an experiment and shouldn't be landed until we verify that (1) this actually matters, (2) that it fixes an issue with Modal on iOS or Android. Changelog: [Internal] Change to make Fabric consistent with non-Fabric Modal Reviewed By: mdvacca Differential Revision: D21191822 fbshipit-source-id: 9d65f346387fd056649d4063d70220f637ba8828 * Support `contentOffset` property in Android's ScrollView and HorizontalScrollView Summary: For a very long time, iOS has supported the `contentOffset` property but Android has not: https://github.com/facebook/react-native/issues/6849 This property can be used, primarily, to autoscroll the ScrollView to a starting position when it is first rendered, to avoid "jumps" that occur by asynchronously scrolling to a start position. Changelog: [Android][Changed] ScrollView now supports `contentOffset` Reviewed By: mdvacca Differential Revision: D21198236 fbshipit-source-id: 2b0773569ba42120cb1fcf0f3847ca98af2285e7 * RN: Fix Text Layout Ignoring Parent Bounds Summary: Fixes text layout so that the parent bounds are correctly respected. This fixes two bugs: - **Parent width is not respected.** This was caused by the recent change to shrink-wrap text layout. - **Parent height is not respected.** This has always been a bug. After this change, Android will behave like iOS. Changelog: [Android] [Fixed] - Text layout no longer ignores parent bounds Reviewed By: mdvacca Differential Revision: D21199030 fbshipit-source-id: cc072bdcff64167db1f79b7bf965e57a7396cdf4 * Remove unnecessary cast to int in TextInlineView measure functions Summary: This diff removes unnecessary (int) casts in the calculation of layout for TextInlineViews changeLog: [Internal][Android] Internal optimization on the calculation of layout for TextInlineViews Reviewed By: JoshuaGross Differential Revision: D21211532 fbshipit-source-id: 920c1f88d042f3e1f6bfd0f560371f7482a62064 * Use RTL in RTLExample when Platform != android (#28742) Summary: This change upstreams a small change we did in react-native-windows to allow the RTLExample RNTester page to function correctly on Windows. The change is part of this Pr: https://github.com/microsoft/react-native-windows/pull/4683 Currently the direction property is gated behind a check for Platform == 'iOS', which means it only works on iOS. Windows supports direction = 'rtl' so I've chanced this check to Platform != 'android'. ## 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] [Changed] - Changed RTLExample RNTester page to use direction = 'rtl' when Platform is not Android. Pull Request resolved: https://github.com/facebook/react-native/pull/28742 Test Plan: Confirmed this change works correctly in RNTester on Windows. Have not confirmed iOS as I don't have Mac hardware. Differential Revision: D21235579 Pulled By: shergin fbshipit-source-id: 47ab93c2bcd0dbc8347c6746081ae3c64f88faa5 * Add Dark Mode support to the App template and NewAppScreen components (#28711) Summary: This PR adds support for the dark mode and dynamic theme changing to the default App template and to the related `NewAppScreen` components. Using `useColorScheme` hook forced me to refactor a bit main `App.js` file, but I think those changes are step in the right direction according to way in which React Native is used in larger apps, so new `Section` component has been extracted to reduce code redundancy/repetition inside `App`. Additional color `darker` has been added to the `Colors` statics from `NewAppScreen` because `dark` was too bright for the Dark Mode backgrounds. Also main `StoryBoard` on iOS has been updated to use theme based colors instead of static or hardcoded ones. There was also an unused, empty `Label` which I have removed. ~~I'm not so much experienced with Android. If someone could also update Android splash screen (if Android requires such change) it will be nice. I want to look at this later using simulator.~~ > I have updated the Android splash screen and tested this change on the Android emulator. If you have any comment or corrections feel free to post them out, I would like to put more work into this PR if it's needed. Dark Mode this days is a part of near every OS, so it could be considered as a standard feature. I hope those changes helps people which struggle with the basic theming implementation (+ there is now an example of hook and `children` prop usage in the template). ## Changelog [Internal] [Added] - Add dark mode support to the default app template Pull Request resolved: https://github.com/facebook/react-native/pull/28711 Test Plan: I have tested the App from the template on the iOS device and in Android emulator with RN `0.63.0-rc`. Screen recording on iOS (demonstarates both modes, both splash screens and transition): ![ezgif-6-e24ee8e839c9](https://user-images.githubusercontent.com/719641/80025923-a04b0300-84e1-11ea-824a-b4363db48892.gif) Screenshot of iOS app in Dark Mode: ![IMG_6542](https://user-images.githubusercontent.com/719641/79885748-c98f6480-83f7-11ea-8c73-1351a721d5d6.PNG) Screenshot of iOS app splash screen in Dark Mode: ![IMG_6544](https://user-images.githubusercontent.com/719641/79960431-add29f80-8485-11ea-985c-b39176024ffa.PNG) Screenshot of Android app in the emulator: ![Screenshot_1587566100](https://user-images.githubusercontent.com/719641/79995454-88f72000-84b7-11ea-810b-dfb70de03c2a.png) Differential Revision: D21236148 Pulled By: shergin fbshipit-source-id: 0c8a9534d3a3f8f8099af939243a889ac4df6cda * Allow use of std::tuple<> with decorators directly Summary: Previously, a derived class, WithTuple, was used. This ran into bugs in MSVC (see https://github.com/microsoft/STL/issues/121). Instead, use specialization to get the same result using std::tuple directly. This avoids the bug, and is a cleaner API. Changelog: [Internal] Reviewed By: dulinriley Differential Revision: D21233677 fbshipit-source-id: 1d75991847164e525b4ba70f65a90627e5f8cd56 * Fabric: Added assert in ShadowNode Summary: It's not allowed to return nullptr from the callback. The assert ensures it which is helpful during development. Probably, we should consider using `gsl::not_null<>` here. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D21149891 fbshipit-source-id: a5f77b35029f22b499491721036405682f812a38 * Fabric: Test for State Reconciliation mechanism Summary: It's not immediately obvious from the UI/UX when/if this mechanism breaks, so it's good to have a test. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D21184718 fbshipit-source-id: 25432a1398cff3ce61f62cf433e3cb73d7a7a93f * ScrollView, HorizontalScrollView: support `null` contentOffset Summary: According to the Flow types, `contentOffset` is nullable. Support that. Changelog: [Internal] Fix to (1) support null contentOffset in ScrollView and HorizontalScrollView, added on Android after the last release. (2) Correctly add support for contentOffset in ScrollView (I missed that when adding it to HorizontalScrollView in the previous diff). Reviewed By: alsun2001 Differential Revision: D21243028 fbshipit-source-id: ebef9a9054a3e4dd88556739e836b7ece48fda12 Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: George Zahariev <gkz@fb.com> Co-authored-by: Scott Wolchok <swolchok@fb.com> Co-authored-by: Radek Czemerys <radko93@gmail.com> Co-authored-by: Lauren Tan <laurentan@fb.com> Co-authored-by: Vojtech Novak <vonovak@gmail.com> Co-authored-by: Tom Underhill <tomun@microsoft.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Frieder Bluemle <frieder.bluemle@gmail.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Valentin Shergin <shergin@fb.com> Co-authored-by: Will Holen <willholen@fb.com> Co-authored-by: Sidharth Guglani <sidharthguglani@fb.com> Co-authored-by: empyrical <empyrical@outlook.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Eli White <eliwhite@fb.com> Co-authored-by: Christoph Nakazawa <cpojer@fb.com> Co-authored-by: Tommy Nguyen <tonguye@microsoft.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: Tim Yung <yungsters@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Pritesh Nandgaonkar <prit91@fb.com> Co-authored-by: Ryan Tremblay <ryan.tremblay@microsoft.com> Co-authored-by: acton393 <zhangxing610321@gmail.com> Co-authored-by: Zack Argyle <zackargyle@fb.com> Co-authored-by: Jason Safaiyeh <safaiyeh@protonmail.com> Co-authored-by: Hein Rutjes <IjzerenHein@users.noreply.github.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: generatedunixname89002005287564 <generatedunixname89002005287564@fb.com> Co-authored-by: sunnylqm <sunnylqm@qq.com> Co-authored-by: Panagiotis Vekris <pvekris@fb.com> Co-authored-by: Jonny Burger <jonathanburger11@gmail.com> Co-authored-by: Keith Melmon <kmelmon@microsoft.com> Co-authored-by: simek <gosimek@gmail.com> Co-authored-by: Marc Horowitz <mhorowitz@fb.com>
2021-07-22 01:24:02 +03:00
return require('./Libraries/ReactNative/RootTag').RootTagContext;
},
get unstable_enableLogBox(): () => void {
v0.63 sync from upstream (#613) * Upgrade to Metro 0.59 Summary: Upgrades RN to Metro 0.59. Changelog: [Internal] Metro Upgrade Reviewed By: motiz88 Differential Revision: D20533864 fbshipit-source-id: 3c5fb8e37d2363edf0b9a1a8cfbdefba00763415 * Fix mock for TextInput (#28332) Summary: This PR adds the `isFocused` method to the mock of the TextInput component. My understanding some of the latest changes on the TextInput to make it use a forwardRef change the way this method is mock giving an error when trying to use in on a mock. The change suggested here fixes the issue. ## Changelog [JavaScript] [Fixed] - Fix the mock for TextInput to support the `isFocused` method Pull Request resolved: https://github.com/facebook/react-native/pull/28332 Reviewed By: cpojer Differential Revision: D20538044 Pulled By: TheSavior fbshipit-source-id: be734af105ab62ffdf9ed4017bd70845e207f8cd * Properly handle LogBox errors during tests Summary: This diff fixes an issue where errors in LogBox during tests would cause the tests to crash. The crash is due to the NativeExceptionsManager module not being mocked (as all native module need to be in tests). The fix is to properly mock the NativeExceptionManger. This fix exposed an infinite loop issue where failures in LogBox will be logged to the ExceptionManager, which logs to the console, which logs to LogBox, creating a loop. This diff also fixes that look by moving the LogBox internal error check to the top of the monkey patched console methods. Changelog: [Internal] Differential Revision: D20428590 fbshipit-source-id: 7289a480c99ba8dee67772178b7629afb40b330a * Back out "Track animations and flush them" Summary: Original commit changeset: b594d0e6e9b6 D20319824 introduced a problem in LayoutAnimations, which makes surfaced as the problem in T63911344. This diff reverts D20319824. Changelog: [Internal] Reviewed By: lunaleaps Differential Revision: D20541918 fbshipit-source-id: ff72b839f57d39051122920a38b2632cbb5ec362 * Consolidate "dispatchMountItems" reentrancy prevention code, and retry code, in one function Summary: Simplifying the dispatchMountItems reentrance and retry logic. Motivation: cleanup so I can work on dispatching ViewCommands before anything else. Importantly, this gives us the properties that: 1) Only one function is responsible for calling dispatchMountItems 2) Only one function is responsible for deciding if we shouldn't call dispatchMountItems due to reentrance 3) Only one function is responsible for all cleanup 4) Only one function maintains all of the relevant flags (except dispatchPreMountItems... two total now, instead of 4 before) Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20437035 fbshipit-source-id: 5370366790eb25f653bee6c1950e747458374a61 * Only retry ViewCommand mount items if exception is marked as "Retryable" Summary: Instead of just blindly retrying all ViewCommands if they fail - which could be dangerous, since it's arbitrary imperative commands we'd be executing twice, potentially with bad app state - we only retry if the ViewCommand throws a "RetryableMountingLayerException". Changelog: [Internal] Optimization to ViewCommands Reviewed By: mdvacca Differential Revision: D20529985 fbshipit-source-id: 0217b43f4bf92442bcc7ca48c8ae2b9a9e543dc9 * Introduce early dispatch of ViewCommands in FabricUIManager Summary: Earlier this week I introduced a change in the old, non-Fabric renderer (D20378633 D20427803) that (gated behind a feature-flag) executes ViewCommands before all other types of commands, as a perf optimization and (I think) a potential fix for a category of race conditions. I've added more details in comments here. The Fabric renderer uses the same feature-flag that I introduced for the non-Fabric renderer. Changelog: [Internal] Fabric Reviewed By: mdvacca Differential Revision: D20449186 fbshipit-source-id: bb3649f565f32c417a6247369902333989a043aa * Change nightly build from hourly to nightly (daily at 00:00) (#28346) Summary: We initially added the nightly build test to run every hour, in order to more quickly validate it. Now that it has been validated we can run it every night as it is intended to do. cc hramos ## Changelog [General] [Changed] - Change nightly build from hourly to nightly Pull Request resolved: https://github.com/facebook/react-native/pull/28346 Reviewed By: cpojer Differential Revision: D20550143 Pulled By: hramos fbshipit-source-id: 9487c6785684ad6ea7e877290d50a33118090a7f * Add diffing to app bundle size reports (#28284) Summary: Add diffing to app bundle size reports. ## Changelog [Internal] [Changed] - Add diffing to app bundle size reports Pull Request resolved: https://github.com/facebook/react-native/pull/28284 Test Plan: - App bundle size reports should now display a diff where available - Right now, the database contains only one entry for the last known good iOS build - Triggering a new build should not create additional comments Reviewed By: cpojer Differential Revision: D20450158 Pulled By: hramos fbshipit-source-id: 720772275f24d3ff0a49705f4dada2efe2e99bd3 * feat: improve monorepo support by removing redundant PROJECT_ROOT (#28354) Summary: Historically, React Native didn't support a lot of custom project structures apart from the standard flat directory with `ios` and `android` folders. The CLI had to be explicitly started from the project root, otherwise Metro didn't work right. In order to resolve the project root in the most accurate way, React Native assumed that project root is always `../../` from its location in `node_modules` - this is not true when the installation gets hoisted (e.g. in a monorepo). To address that, janicduplessis brought support for custom [`PROJECT_ROOT`](https://github.com/facebook/react-native/commit/9ccde378b6e6379df61f9d968be6346ca6be7ead) that allowed overriding the `../../` in case it wasn't true. Today, CLI is able to automatically resolve the project root, no matter where it's started. It will traverse the tree of the directories upwards and stop as soon as it meets `package.json`. As a result, it doesn't really matter from where we start the CLI anymore as a part of `react-native-xcode.sh`. By replacing the default value of `$REACT_NATIVE_DIR/../../` with `$PWD, that is default for all Xcode scripts, we can make the setup for monorepo easier - nobody will need to set `$PROJECT_ROOT` in order to override the incorrect defaults. By default, all scripts defined in Xcode run from `$PWD` directory, which is the location of the iOS project. In the future, we will be able to remove `cd` entirely. To better understand this PR, let's look a few hypothetical structures as an example: #### Monorepo: > tl;dr works out of the box, no need to mess around with paths ``` - package.json - packages/ - my-app/ - index.js - package.json - ios/ - MyApp.xcodeproj ``` **Before this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $REACT_NATIVE_DIR/../../ node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - Because we change the directory to the root of monorepo, CLI throws an error. All in all, there's no `react-native` dependency at the workspace root. - Some users turn `no hoist` in an act of troubleshooting the errors, which resolves the problem - `react-native` is moved under `my-app/node_modules` which makes this mechanism resolve properly. - Some users find out about `PROJECT_ROOT` and set it to overwrite the default value. For example, setting `export PROJECT_ROOT = "$PWD/../` will set the directory to `my-app`, which has a dependency on `react-native` in a `package.json` and makes the CLI happy. **After this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $PWD node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - The `$PWD` is `packages/my-app/ios/` because that's where the Xcode project is located. CLI will automatically set the root to `../` because that's where it finds `package.json` with `react-native` dependency. It will pass that root to Metro, unless users have set a different one themselves. Thanks to that, all paths to JavaScript files remain working and unaffected. - No need to set `PROJECT_ROOT` anymore. - We don't rely on the location of `node_modules`, which is cleaner and future proof. #### Standard: > tl;dr no changes ``` - ios/ - MyApp.xcodeproj - index.js - package.json ``` **Before this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $REACT_NATIVE_DIR/../../ node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - Everything works fine. Path from `react-native` inside `node_modules` is correct - the project root is set right to `/` **After this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $PWD node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - The root will be set to where Xcode project is located, which is `/ios`. This is the PWD for all Xcode scripts. CLI will look for the `package.json` going upwards from `ios` folder. Will stop at `/`, find out it has `react-native` dependency, load it and its commands and proceed further. ## Changelog [iOS] [Feature] - Better monorepo support when building release apk Pull Request resolved: https://github.com/facebook/react-native/pull/28354 Test Plan: - All projects (standard/monorepo) run without issues. - PROJECT_ROOT is not needed. CC: Titozzz (who wrote monorepo guide), alloy, bartolkaruza Reviewed By: cpojer Differential Revision: D20558005 Pulled By: hramos fbshipit-source-id: 2551120beadcfd4c2f1393ce8a2c2fa6b93c9290 * Fix `test_android`: Remove references to fbsource cell (#28363) Summary: Fixes https://github.com/facebook/react-native/issues/28361. ## Changelog [Internal] [CI] - Fix test_android Pull Request resolved: https://github.com/facebook/react-native/pull/28363 Test Plan: Prior to fix: ``` react-native $ ./scripts/circleci/buck_fetch.sh Guessing 168a69309928ba16065cdb33b1775a4af9f924a6 as the last one used version. Using additional configuration options from /Users/hramos/.buckconfig.d/experiments, /etc/buckconfig.d/fb_chef.ini, /etc/buckconfig.d/fb_chef_override.ini Invalidating internal cached state: Watchman failed to start. This may cause slower builds. Parsing buck files: finished in 1.5 sec Buck wasn't able to parse /Users/hramos/git/react-native/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK: IOError: [Errno 2] No such file or directory: '/Users/hramos/git/react-native/tools/build_defs/platform_defs.bzl' Call stack: File "/Users/hramos/git/react-native/.buckd/resources/168a69309928ba16065cdb33b1775a4af9f924a6/buck_server/buck_parser/profiler.py", line 507, in wrapped return func(*args, **kwargs) File "/Users/hramos/git/react-native/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK", line 1 load("//tools/build_defs:platform_defs.bzl", "ANDROID") File "/Users/hramos/git/react-native/.buckd/resources/168a69309928ba16065cdb33b1775a4af9f924a6/buck_server/buck_parser/profiler.py", line 507, in wrapped return func(*args, **kwargs) This error happened while trying to get dependency '//ReactAndroid/src/main/java/com/facebook/fbreact/specs:FBReactNativeSpec' of target '//ReactAndroid/src/main/java/com/facebook/react/devsupport:devsupport' ``` After fix: ``` react-native $ ./scripts/circleci/buck_fetch.sh + buck fetch ReactAndroid/src/test/java/com/facebook/react/modules Guessing 168a69309928ba16065cdb33b1775a4af9f924a6 as the last one used version. Using additional configuration options from /Users/hramos/.buckconfig.d/experiments, /etc/buckconfig.d/fb_chef.ini, /etc/buckconfig.d/fb_chef_override.ini Invalidating internal cached state: Watchman failed to start. This may cause slower builds. Parsing buck files: finished in 1.1 sec Configuration 'ANDROID_SDK' points to an invalid directory '/opt/android_sdk'. When creating rule //ReactAndroid/src/main/java/com/facebook/hermes/instrumentation:instrumentation. ``` > Note: I don't have the Android SDK configured in this machine. Verified on Circle CI. `test_android` is now green: https://circleci.com/gh/facebook/react-native/140682?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link Reviewed By: cpojer Differential Revision: D20564934 Pulled By: hramos fbshipit-source-id: 5d843b8f113c4db5391ee39addc3ff259d962290 * Fix TextInput left/right padding Summary: This fixes two things: 1) Currently it only respects Start and End padding, and if there's a Theme default, it will override Left/Right padding. Whoops. 2) Currently it doesn't respect when a TextInput starts with padding, but then is removed. This resolves both. It still does not account for RTL support. Changelog: [Internal] Fix AndroidTextInput padding Reviewed By: mdvacca Differential Revision: D20573151 fbshipit-source-id: e89791641b6699e728cde9dbd661a8c21485fbc8 * Validate selection range passed to setTextAndSelection Summary: Changelog: [Internal] # Fabric 1. If `start` and `end` parameters in `setTextAndSelection` are -1, we don't move the cursor. Previously the cursor would be moved to beginning of text input. 2. In view commands, do not validate `eventCount`. It is passed in as undefined from JS because Fabric's text input doesn't use `eventCount`. # Paper 1. If `start` and `end` parameters in `setTextAndSelection` are -1, we don't move the cursor. Previously the cursor would be moved to beginning of text input. Reviewed By: shergin Differential Revision: D20538290 fbshipit-source-id: c7aeddc25f58697254474058ce901df958321f7c * Remove ReactTypes from fbsource and React sync Summary: See https://github.com/facebook/react/pull/18366 This contains a fork of the upstream Flow types. We shouldn't be syncing this since these leads to conflicting types. As a result, these uses have already been codemodded away. Only the imports remained. Changelog: [React Core] - Remove ReactTypes from sync. Reviewed By: gaearon Differential Revision: D20583740 fbshipit-source-id: fc86a934cbdca8ff90fe90282b86ecc945a85e5f * Fix controlled TextInput with child nodes Summary: Changelog: [Internal] # There are three changes in this diff ## _stateRevision is replaced with a BOOL `_stateRevision` was protecting against setting attributed string that is already visible to the user. Previously this was ok because the change was only coming from native, any changes from JS were ignored. Imagine following scenario: 1. User taps key. 2. Update state is called on component initiated by native. 3. New state is created with incremented revision by one. 4. `_stateRevision` gets set to new state's revision + 1. 5. Now JS wants to change something because it just learnt that user tapped the key. 6. New state is created again with incremented revision by one. 7. Update state is called on the component, but the change isn't applied to the text view because `_state->getRevision()` will equal `_stateRevision`. By having a BOOL instead of number, we very explicitly mark the region in which we don't want state changes to be applied to text view. ## Calling [_backedTextInputView setAttributedText] move cursor to the end of text input This is prevented by storing what the current selection is and applying it after `[_backedTextInputView setAttributedText]` is called. This was previously invisible because JS wasn't changing contents of `_backedTextInputView`. ## Storing of previously applied JS attributed string in state This is the mechanism used to detect when value of text input changes come from JavaScript. JavaScript sends text input value changes through props and as children of TextInput. We compare what previously was set from JavaScript to what is currently being send from JavaScript and if they differ, this change is communicated to the component. Previously only first attributed string send from JavaScript was send to the component. # Problem If children are used to set text input's value, then there is a case in which we can't tell what source of truth should be. Let's take following example We have a text field that allows only 4 characters, again this is only a problem if those 4 characters come as children, not as value. This is a controller text input. 1. User types 1234. 2. User types 5th character. 3. JavaScript updates TextInput, saying that the content should stay 1234. 4. In `TextInputShadowNode` `hasJSUpdatedAttributedString` will be set to false, because previous JS value is the same as current JS value. Reviewed By: shergin Differential Revision: D20587681 fbshipit-source-id: 1b8a2efabbfa0fc87cba210570142d162efe61e6 * Daily `arc lint --take BUCKFORMAT` Reviewed By: zertosh Differential Revision: D20593906 fbshipit-source-id: b056947c698508119dc9d4d1bba202295b8f0fda * RN picker - implement background color Summary: add support to the android implementation of the Picker component for setting the background color. Changelog: [Android] [Added] - Support item background color in Dialog Picker Differential Revision: D20566131 fbshipit-source-id: d693b40803fa1051ec955c5728994c820fecd9e9 * Fabric: Modernizing Yoga Dirty flag test. Summary: Now we using TEST_F thing that allows consilidating initialization. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D20578788 fbshipit-source-id: 103bcb8fdeb3dbf297385cfe56415bd646e16791 * Fabric: Changing signature of `ComponentDescriptor::createState` Summary: This is pure syntactic change. Often we don't have a shared pointer to ShadowNodeFamily and only have just a reference. At the same time, `ComponentDescriptor::createState` does not have to accept a shared pointer. So, it's better to accept just a reference. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20578787 fbshipit-source-id: 905277001e096d41e75007575b59ea2ea15fbf4b * Fabric: View Test: Changing state should not dirty Yoga tree (in some most cases) Summary: Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D20578789 fbshipit-source-id: 4336165217bd39fc8065cfaeb96ef7753433d48a * Get ReactiveNative compiled with Clang 10 (#28362) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/28362 Fixed a few compilation errors emitted by Clang 10. Changelog: [iOS] [Fixed] - Get ready for Clang 10 Differential Revision: D20549970 fbshipit-source-id: dc36a85d90d3e43a05f045feb57c6ab6ded67da7 * Guard against null values in object parameters for bridged methods Summary: Handles the case when a value in an object parameter of a turbo module spec is null (even if the type is nullable). For example, given: ``` export interface Spec extends TurboModule { +myFunc: ({| foo: ?string, |}) => void; } ``` and calling `NativeModule.myFunc({foo: null})`, we see an error like: ``` JSON value '<null>' of type NSNull cannot be converted to NSString ``` Guarding against this by converting NSNull's to nils ## Changelog: [iOS] [Fixed] - Fix crash when passing null value in object parameter of bridged method Reviewed By: fkgozali Differential Revision: D20591590 fbshipit-source-id: fdb90f34131427a235f2e3c99147bf1e6a9c6732 * Modify pending deletion tags to be cross manageChildren Summary: Changelog: [Internal] Removing historic layout animations index adjustment (D20323928) broke the Dating Secret Crush screen. Since flushing animations (D20319824) had to be reverted due to issues with Saved + Privacy Shortcuts (https://fburl.com/tasks/eijtmifu) we need to track pending deletions across `manageChildren` operations. Reviewed By: JoshuaGross Differential Revision: D20601079 fbshipit-source-id: c6f116683750e97abe7f988cf361d2a6449e90e6 * Enable label-actions on the react-native repository (#28374) Summary: Enhance our issue management workflow by having the bot respond automatically whenever a label is applied to the issue. ## Changelog [Internal] - CI Pull Request resolved: https://github.com/facebook/react-native/pull/28374 Test Plan: Not tested. If needed, could be applied to a different, test repository. Reviewed By: cpojer Differential Revision: D20606887 Pulled By: hramos fbshipit-source-id: 874d1464527ea76bf51394a7d3e98e4fd8f69345 * Fix Animated Value initialized with undefined in ScrollView (#28349) Summary: When passing an object to contentOffset that doesn't have `y` prop set it causes the following error: ``` Error: AnimatedValue: Attempting to set value to undefined This error is located at: in ScrollView (at src/index.js:638) ... ``` This happens since a runtime check was added to the `AnimatedValue` constructor. (a3aaa471eca58b31597b9a0669f7ade385ccb175) According to flow types the object passed to contentOffset should always contain both x and y props but since it worked before when y is undefined I think its fine to patch the runtime behaviour defensively, especially since the code change is simple. ## Changelog [General] [Fixed] - Fix Animated Value initialized with undefined in ScrollView Pull Request resolved: https://github.com/facebook/react-native/pull/28349 Test Plan: Tested that the crash no longer reproduces when passing an empty object to contentOffset. Reviewed By: cpojer Differential Revision: D20601664 Pulled By: hramos fbshipit-source-id: b098a2dd1e702f995a9a92fa6e4e9a204187dac4 * xplat/js/react-native-github/ReactCommon/fabric/components/textinput/ Summary: Changelog: [Internal] Reviewed By: scottrice Differential Revision: D20619227 fbshipit-source-id: 674337e6ce585a4e96d020f9624b874ba86e2d80 * Seed ssh known hosts with github's public key (#28370) Summary: The [previous attempt](https://github.com/facebook/react-native/pull/28304) to fix the publish step failed, so now reverting to manually configuring things. This PR adds an entry to SSH’s `known_hosts` file using github.com’s public key that I have verified as per [these instructions](https://serverfault.com/a/807363): ``` ~/C/R/react-native [master] » nmap github.com --script ssh-hostkey Nmap scan report for github.com (140.82.118.4) rDNS record for 140.82.118.4: lb-140-82-118-4-ams.github.com PORT STATE SERVICE 22/tcp open ssh | ssh-hostkey: | 1024 ad:1c:08:a4:40:e3:6f:9c:f5:66:26:5d:4b:33:5d:8c (DSA) |_ 2048 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48 (RSA) ``` These fingerprints line up with [the ones posted by GitHub](https://help.github.com/en/github/authenticating-to-github/githubs-ssh-key-fingerprints), so my setup should be good and can be trusted to grab the public key from the right host: ``` ~/C/R/react-native [master] » ssh-keyscan -t rsa -H github.com # github.com:22 SSH-2.0-babeld-d48c3acd |1|If6MU203eXTaaWL678YEfWkVMrw=|kqLeIAyTy8pzpj8x8Ae4Fr8Mtlc= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== ``` ## Changelog [Internal] [Fixed] - Make automated publishing of packages from CI work again Pull Request resolved: https://github.com/facebook/react-native/pull/28370 Test Plan: I used the command being added in this PR in [a failed CI job](https://app.circleci.com/pipelines/github/facebook/react-native/4104/workflows/916127cb-177f-4583-9f90-cae5318041d8/jobs/140810). When I invoked the publish script manually I was not greeted by the blocking prompt and the package was successfully published: https://www.npmjs.com/package/react-native/v/0.0.0-56cf99a96 Reviewed By: cpojer Differential Revision: D20601527 Pulled By: hramos fbshipit-source-id: b1a4405228408cfc4a1b3b44ab88c79522af3a66 * Fix app bundle size diff not always being compared against latest commit (#28368) Summary: - Timestamp of entries in our Firebase instance sometimes get stored as number. This means that we may not always be diffing against the latest master commit. - Size report of Android and iOS gets overwritten depending on which build finishes first. ## Changelog [Internal] [Fixed] - App bundle size diff not always being compared against latest commit [Internal] [Fixed] - Android and iOS app bundle size diff overwrite each other Pull Request resolved: https://github.com/facebook/react-native/pull/28368 Test Plan: - We are now using Firebase's own [firebase.firestore.Timestamp.now](https://firebase.google.com/docs/reference/js/firebase.firestore.Timestamp#now) to ensure that we always get a timestamp in the preferred format. This has been tested locally but can only be verified when merged to master and we start getting new data. In the meantime, I'll manually fix up all the entries in the store. - There should be one app bundle size comment for Android and one for iOS in this PR. Reviewed By: cpojer Differential Revision: D20601620 Pulled By: hramos fbshipit-source-id: 0c3e4b78a74cbd659f1957a6aa74322b016e0646 * Hopefully fix so loading crashes Summary: Changelog: [Android][Internal] Fix potential initializer interruption threading crashes. Reviewed By: mdvacca Differential Revision: D20615755 fbshipit-source-id: 58b706deeb6df1998caff5bf2ae9ec60114313fe * Fix label-actions configuration Summary: Adds back a missing label key, fixes open source issue: https://github.com/facebook/react-native/issues/28378 Changelog: [Internal] [CI] - Fix label-actions config Reviewed By: cpojer Differential Revision: D20625887 fbshipit-source-id: 63c90db249aa9c15369a4b5bcab71cbe75c6d4b8 * Changing Order Of mOverrideColorScheme In Constructor Summary: Changelog: [Android] [Updated] mOverrideColorScheme should be assigned before the first colorSchemeForCurrentConfiguration call, so the initial setting of mColorScheme will reflect the override Reviewed By: zackargyle Differential Revision: D20630173 fbshipit-source-id: a2a2d174d3fc40c14f27dce6a7fa8e67203480c9 * hermes | inspector | Don't include posix headers on non-posix systems Summary: Changelog: [Internal] Hermes inspector includes pthreads, arpa and sys headers on all OSes that would break vanilla Windows builds. This diff adds a check for posix-compliance before inclusion (Note: this ignores all push blocking failures!) Reviewed By: dulinriley Differential Revision: D20564449 fbshipit-source-id: 8e264bc3104065dc4315bb291e8560609fe65184 * Upgrade Prettier from 1.17 to 2.0.2. Summary: This gets us on the latest Prettier 2.x: https://prettier.io/blog/2020/03/21/2.0.0.html Notably, this adds support for TypeScript 3.8, which introduces new syntax, such as `import type`. Reviewed By: zertosh Differential Revision: D20636268 fbshipit-source-id: fca5833d003804333a05ba16325bbbe0e06d6c8a * Back out "Upgrade Prettier from 1.17 to 2.0.2." Differential Revision: D20639755 fbshipit-source-id: 5028563f9cf0527a30b4259daac50cdc03934bfd * Fabric: Additional temporary checks in prop parsing infra Summary: While ViewConfig infra isn't perfect we need to check some value for correctness during prop-parsing. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D20639055 fbshipit-source-id: 193dcd0769bc7777bc8d60c964ede72ebdaa83e4 * Update React package Summary: This just updates the `react` package to the latest stable version. We updated it to experimental internally earlier so this brings the open source version to the latest before the branch cut. This doesn't include any breaking changes. Changelog: [General][Changed] - Update to React 16.13.1 Reviewed By: cpojer Differential Revision: D20642909 fbshipit-source-id: 68a4c74bfe72f1abdb33b0b9071a4f4e8e568318 * Fix sketchy null checks induced by new formatting in Prettier 2.0 Summary: Update code to prepare for Prettier 2.0, which will reformat `a || (b || c)` to `a || b || c`. Changelog: [Internal] prepare for Prettier 2.0 Reviewed By: kassens Differential Revision: D20639483 fbshipit-source-id: c2932b1495884684172ba9291d56c546f51711b8 * RN picker - fix types in AndroidDialogPickerManagerInterface Summary: according to [this crash report](https://our.intern.facebook.com/intern/logview/details/facebook_android_crashes/7ba7056481015482c6166d65cb97e49d/?trace_key=1506fe36a70dd5e50cdc8968f6317f27), `value` was throwing an NPE despite being null-checked. this is because it was an `int` rather than an `Integer`, so the null check wasn't working Changelog: Fix types in AndroidDialogPickerManagerInterface Reviewed By: mdvacca Differential Revision: D20646343 fbshipit-source-id: a27587e0a48f5782bcf5ffddb604018218e65206 * Remove RCTExportModule log spam Summary: The bridge complains if modules aren't exported, which isn't really helpful with lazily loaded modules and turbo modules. I considered only turning this off when TurboModules is enabled, but figured we'd be killing this soon anyways... If anyone feels strongly I can go that approach. Changelog: [iOS][Internal] Remove RCTExportModule log spam Reviewed By: shergin Differential Revision: D20629575 fbshipit-source-id: d32d9fe244c4d06acfee982fca7c7f63da294dc5 * De-jank DevLoadingView Summary: ## Problems Repro steps: 1. Disable Fabric (because CMD + R doesn't work with Fabric right now). 2. Open up Marketplace and hit `CMD + OPT + R` 3. **Observe:** The progress bar doesn't show up right away. It also doesn't actually show progress. https://pxl.cl/140g1 RN Support post: https://fb.workplace.com/groups/rn.support/permalink/3437652016283389/ ## Fixes The first problem is that progress bar doesn't actually show progress. **Fix:** Bundle load progress is updated in `RCTCxxBridge`, where we first require `RCTDevLoadingView`, and then call its `updateProgress` method. Previously, we wouldn't lazily load `RCTDevLoadingView`, it already didn't exist. Lazily loading `RCTDevLoadingView` causes the progress view to show up. Here: https://pxl.cl/140gt If you look at the above video, you'll notice there are two stages to the progress bar: stage 1 displays the actual progress. Stage 2 prompts that we're downloading the JS bundle. As you can see, stage 1 and stage 2 have different background colors, even though both of them are green. **Fix:** I adjusted the JS to match the Native color. Here: https://pxl.cl/140gT We're almost there, but the progress bar is dismissed twice? **Fix:** I dug into the code, and the reason why was because when we hit `CMD + R`, we invalidate the bridge, and immediately re-initialize it. This means that we asynchronously invalidate the old TurboModuleManager, and immediately create a brand new one. Therefore, two `RCTDevLoadingView` modules can (and do) exist at once. So, I moved `RCTDevLoadingView` to be an instance member of `FBReactModule`, to ensure that it doesn't get cleaned up and re-created when TurboModuleManager is deleted and re-created. This finally fixed the progress bar jank: https://pxl.cl/140hn Changelog: [iOS][Fixed] - Remove RCTDevLoadingView jank Reviewed By: rickhanlonii Differential Revision: D20607815 fbshipit-source-id: 05825c67adaf3cfda70be0fa2dc92d413dc8921b * Fix retaining self in block in LogBox impl Summary: Logbox has a retain cycle (see linked task for my deeper investigation). This diff doesn't fix the retain cycle, but it's just good practice to not retain self strongly in blocks. Changelog: [iOS][Internal] Fix retaining self in block in LogBox implementation Reviewed By: shergin Differential Revision: D20630693 fbshipit-source-id: cf399495e9bcd1917932fcc0e9c9d2d2a32bf6f0 * Flow type infoLog Summary: Changelog: [General][Internal] flow type infoLog Reviewed By: zackargyle Differential Revision: D20577939 fbshipit-source-id: eed4401b2ae0a6bf845fdcb54c6abe1fe98fe7c1 * Replace fbsource// with // in xplat/js/ files [1] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: scottrice Differential Revision: D20495655 fbshipit-source-id: a57b72f694c533e2e16dffe74eccb8fdec1f55f5 * Deploy Flow 0.121 to Xplat (#901) Summary: Deploy Flow 0.121 to Xplat bypass-lint allow-large-files Closes https://github.com/facebook/flipper/pull/901 Changelog: [Internal] Reviewed By: panagosg7 Differential Revision: D20570316 fbshipit-source-id: a76983d6f46c8b995ce2dd5cd1e014534790698a * Replace fbsource// with // in xplat/js/ files [3] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D20656211 fbshipit-source-id: deb91b917d349bc500acbb03d734ff621f6e1fc7 * Replace fbsource// with // in xplat/js/ files [4] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: JoshuaGross, shergin Differential Revision: D20656696 fbshipit-source-id: 10f02decb1dc969fd3491ac90d97f09e2bda59e7 * Add Needs: Repro bot action (#28397) Summary: Add automated response for Needs: Repro ## Changelog [Internal] [Added] - Add automated response for Needs: Repro Pull Request resolved: https://github.com/facebook/react-native/pull/28397 Test Plan: Bot should add a comment with the Needs: Repro label. Reviewed By: cpojer Differential Revision: D20665378 Pulled By: hramos fbshipit-source-id: 1c7d878faacf935a640849f74c81f119e5c7e92d * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D20666684 fbshipit-source-id: 32255ac7509e0257693969a7b4b044569af30df7 * ✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392) Summary: Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`. Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job. What was done in this PR: * The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use. * The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument. * The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument * The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument ## Changelog [Internal] [CI] - ✅ Green CI, disabled test infrastructure work Pull Request resolved: https://github.com/facebook/react-native/pull/28392 Test Plan: Verified on Circle CI Reviewed By: cpojer Differential Revision: D20665512 Pulled By: hramos fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726 * Upgrade internal packages to support ESLint >= 6 (#28393) Summary: Fixes https://github.com/facebook/react-native/issues/28293 I've tested it with https://github.com/react-native-community/react-native-template-typescript and it seems to be working as expected - no warnings, supports typescript 3.8. (note: I didn't upgrade the package version as I don't know how the releases work for this package) ## Changelog [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/28393 Reviewed By: hramos Differential Revision: D20647112 Pulled By: cpojer fbshipit-source-id: ca6b67971f625dc8125a58f9220dfcd86250ba94 * Fabric: Fixing a deadlock in RCTSurfacePresenter Summary: This is another attempt to fix an issue very similar to T59424871. The previous attempt was in D19249490. I don't know why we don't see production crashes (stalls) but it happened to me (and not to me) in the debugger. The previous attempt didn't work because we still could have a deadlock because we tried to acquired shared mutex already owned exclusively by the `suspend` method. Here is another approach: Instead of using one shared mutex, now we use two. One is similar to what we had and another that protects `suspend` and `resume`. Besides that, now we pass a Scheduler to functions that use that explicitly. This way we can be more explicit about acquiring mutexes and the overall flow of execution. The idea is: Now an arbitrary code that can be reentrant does not cover with mutexes, so the deadlock is not possible. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20639228 fbshipit-source-id: 98515742f00f2ae94b50b585c9f1f0611e169ebe * Update React Hooks Plugin Summary: Updates `eslint-plugin-react-hooks` to 3.0.0. This introduces a new lint error when you use a Hook inside a class. Changelog: [General][Changed] - Updated the React Hooks ESLint Plugin Reviewed By: cpojer Differential Revision: D20675528 fbshipit-source-id: d0cbe9748fd15df7a4c6de00bd1462610e0a43d6 * Upgrade React DevTools 4.0.6 -> 4.6.0 Summary: Upgrading the embedded version of React DevTools, primarily to pull in [this PR](https://github.com/facebook/react/pull/18397) which will reduce the impact of this package on `node_modules` size. # Update process Following a similar process as D15973709, I began by searching for [all of the references](https://our.intern.facebook.com/intern/biggrep/?corpus=xplat&filename=.json&case=false&view=default&extre=&s=%22react-devtools&engine=apr_strmatch&context=false&filter[uninteresting]=false&filter[intern]=false&filter[test]=false&grep_regex=) to the `react-devtools-core` package and updated all v4 usage to to point to the new 4.6.0 release: 1: Manually update "react-devtools-core" versions: ``` js/package.json js/react-native-github/package.json nuclide/package.json sonar/desktop/app/package.json sonar/desktop/plugins/reactdevtools/package.json vscode/modules/vscode-webview/package.json ``` 2: Setup Yarn proxy: ``` yarn config set proxy http://fwdproxy:8080/ yarn config set https-proxy http://fwdproxy:8080 ``` 3: Run "yarn" in each of the above directories. 4: Run the lockfile shell script: ``` ~/xplat/js/scripts/update-oss-yarn-lockfile.sh ``` 5: Update the generated `MOBILE_JS_NODE_MODULE_DEPS.bzl` by running ``` js1 build buckfiles ``` ## Changelog: [General] [Changed] - Upgrade embedded React DevTools backend from v4.0.6 to v4.6.0. Reviewed By: cpojer, gaearon Differential Revision: D20676091 fbshipit-source-id: 99865bdba9bce45e2a7d582d5fb550cfdbeeca3a * Make ScrollView use ForwardRef Summary: Have ScrollView use forwardRef so that the host component methods like `measure` and `measureLayout` are available without having to call `getNativeScrollRef`. Instead, you can use `<ScrollView ref={myRef} />` and directly call all methods of ScrollView and host components on `myRef`. Previous usage: ``` const myRef = React.createRef<React.ElementRef<typeof ScrollView>>(); <ScrollView ref={myRef} /> const innerViewRef = myRef.current.getNativeScrollRef(); innerViewRef.measure(); ``` New usage: ``` const myRef = React.createRef<React.ElementRef<typeof View>>(); <ScrollView ref={myRef} /> // now, myRef.current can be used directly as the ref myRef.current.measure(); myRef.current.measureLayout(); // Additionally, myRef still has access to ScrollView methods myRef.current.scrollTo(...); ``` Changes: * Added deprecation warnings to ScrollView methods `getNativeScrollRef`, `getScrollableNode`, and `getScrollResponder` * Added the forwardRef call to create `ForwardedScrollView` - this takes in `ref` and passes it into the class ScrollView as `scrollViewRef`. * Forwarded the ref to the native scroll view using `setAndForwardRef`. * Added statics onto `ForwardedScrollView` so that `ScrollView.Context` can still be accessed. * Added type `ScrollViewImperativeMethods`, which lists the public methods of ScrollView. * Converted all public methods of ScrollView to arrow functions. This is because they need to be bound to the forwarded ref. * Bound all public methods of ScrollView to the forwarded ref in the `setAndForwardRef` call. * Flow typed the final output (ForwardedScrollView) as an abstract component that takes in the props of the `ScrollView` class, and has all methods of both the inner host component (`measure`, `measureLayout`, etc) and the public methods (`scrollTo`, etc). Changes to mockScrollView: * Changed mockScrollView to be able to mock the function component instead of a class component * Updated necessary tests Changelog: [General] [Changed] - Make ScrollView use forwardRef Reviewed By: TheSavior Differential Revision: D19304480 fbshipit-source-id: 6c359897526d9d5ac6bc6ab6d5f9d82bfc0d8af4 * Fix issue with onEndReached Summary: onEndReached can be triggered twice when more items are added to the end of the list. This change makes it so that a second call to onEndReached won't happen until the user scrolls down to the new end of the list. Changelog: [General] [Fixed] - Fix double call to onEndReached in VirtualizedList Reviewed By: sahrens Differential Revision: D20066740 fbshipit-source-id: 129d7ae6bfd241eeea18fe0bb12b82be67735874 * Remove console warnings from ScrollView methods Summary: The newly added console warnings in D19304480 are adding a lot of warning noise due to missed infra callsites. Those callsites need to be updated before these warnings can be added. Changelog: [Removed] Remove console warnings from ScrollView methods Reviewed By: rickhanlonii Differential Revision: D20700917 fbshipit-source-id: cb618ee3a291d26e1942e4f91bbc02dee41fb78b * Upgrade react-docgen, jscodeshift and flow-parser Summary: In preparation for upgrading babel, I'm updating some of our source transform tools to the latest versions. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D20675201 fbshipit-source-id: fa4fee2652529c6677087e42cdd1325a8080e46f * Ship State Reconciliation 100% on all platforms Summary: State Reconciliation has been running 50/50 for a while and all metrics look stable. This is necessary for providing a good experience so we should ship to everyone unconditionally. Changelog: [Internal] Fabric diffing reconciliation process improvement Reviewed By: mdvacca Differential Revision: D20715694 fbshipit-source-id: 25b2635ecc29b67e2911679c9db66bc84d37dec1 * Core telemetry tests: update so they pass on my machine Summary: `std::this_thread::sleep_for` is not really precise and will attempt to sleep for "at least" that much time, but may sleep much longer depending on what CPUs are doing and scheduling policies. To get this to pass on my machine, I had to substantially increase the thresholds. Changelog: [Internal] Reviewed By: shergin Differential Revision: D20689571 fbshipit-source-id: f159420d24a95da2b5d95d49ed7882e783291e98 * Optimize diff algorithm to produce fewer remove+insert ("move") paired instructions Summary: An evolution of D20633188 but more performant. There are three optimized paths before the slow path. The first optimized path tries to pair identical nodes from old/new tree, and generate Update mutations, until we hit nodes that are different (indicating either a remove or an insert). This already existed. The next two optimizations, introduced by Tim in his JS pseudocode, were inspired by ReactJS's diffing algorithm. They work in cases where the rest of the nodes are (1) all removals/deletes or (2) all creates+inserts. Finally, if those final two optimized paths can't run, it's because there is a mix of delete+remove, create+insert, and "move" operations, mixed at the beginning, middle, and/or end of the list. This has slightly better average/best-case complexity as the previous implementation. In particularly pathological cases where all nodes are arbitrarily reordered, or reversed, for instance (ABCDE->EDCBA) the algorithm has the same complexity as the previous algorithm (quadratic). For now iOS is pinned to the older differ Changelog: [Internal] Experiment to optimize diffing algorithm in Fabric Reviewed By: shergin Differential Revision: D20684094 fbshipit-source-id: d29fba95a0328156c023e1c87804f23770ee1d91 * Unit test for V2 "minimal instruction" diffing algorithm Summary: This unit test is to verify that the new diffing algorithm generates a "minimal" instruction set, with regards to removes and inserts ("moves"). These unit tests are here to verify the expected behavior in this new algorithm, but these tests may be modified or deleted in the future if we decide we want to change this behavior. Changelog: [Internal] fabric unit test Reviewed By: mdvacca Differential Revision: D20706592 fbshipit-source-id: 5f9991498e0d788ecbf88d938bfe6d3f0f27af40 * Add ES Lint rules for `DynamicColorIOS()`and `ColorAndroid()` (#28398) Summary: The [PlatformColor PR](https://github.com/facebook/react-native/pull/27908) added support for iOS and Android to express platform specific color values. The primary method for an app to specify such colors is via the `PlatformColor()` method that takes string arguments. The `PlatformColor` method returns an opaque Flow type enforcing that apps use the PlatformColor method instead of creating Objects from scratch -- doing so would make it harder to write static analysis tools around Color values in the future. But in addition to `PlatformColor()`, iOS has a `DynamicColorIOS()` method that takes an Object. The Flow type for this Object cannot be opaque, but we still want to enforce that app code doesn't pass variables instead of Object literals or that values in the Objects are variables. To ensure `DynamicColorIOS()` can be statically analyzed this change adds an ESLint rule to enforce that `DynamicColorIOS()` takes an Object literal of a specific shape. A `ColorAndroid()` was also introduced not for practical use but just to test having platform specific methods for more than one platform in the same app. A second ESLint rule is created for `ColorAndroid` as well. ## Changelog [General] [Changed] - Add ES Lint rules for `DynamicColorIOS()`and `ColorAndroid()` Pull Request resolved: https://github.com/facebook/react-native/pull/28398 Test Plan: `yarn lint` passes. Reviewed By: cpojer Differential Revision: D20685383 Pulled By: TheSavior fbshipit-source-id: 9bb37ccc059e74282b119577df0ced63cb9b1f53 * fix: Android gradle config when bundling for release (#28415) Summary: This fix aims to address the issue when bundling an Android app for release and getting the error exhibited in https://github.com/facebook/react-native/issues/28002 which I also encountered myself. The config was changed sometime in November 2019 (as part of https://github.com/facebook/react-native/issues/26940, commit https://github.com/facebook/react-native/commit/a3b08048674e324dbe1f0ca816f35607e9e06a2f) to be very opinionated when it comes to the use of `npx` which Gradle itself cannot find anyway (I have `npx` installed globally and it didn't pick it up). Another issue that the use of `npx` creates is that Gradle should only ever use the currently installed react-native cli rather than a (possibly) higher version which may not always have backward compatibility. The proposed change simply throws a more descriptive error rather than defaulting to a tool which may or may not exist on the machine, be it CI or a development environment. I've also modified the RNTester app to reflect the correct config implementation relative to the RNTester app itself. In real projects, the config inside `android/app/build.gradle` should look similar to the following snippet: ``` project.ext.react = [ cliPath: "$rootDir/../node_modules/react-native/cli.js", entryFile: "index.js" ]; ``` ## Changelog [Android] [Fixed] - Gradle release config Pull Request resolved: https://github.com/facebook/react-native/pull/28415 Test Plan: - [x] Successfully bundled an Android release build with correct config - [x] Works with RNTester app Reviewed By: mdvacca Differential Revision: D20714372 Pulled By: hramos fbshipit-source-id: 4d66139249c6f840582a71a48c64e6a6595f7af0 * Reimplement D19965405: Small improvements in Differentiator/TinyMap Summary: Two things: 1) I reimplement Valentin's idea in D19965405, so that TinyMaps can be iterated over, with a couple of bugfixes (calling front() or back() on an empty vector will crash). 2) I now use TinyMap instead of better::map in the "optimized" diffing algorithm. 3) `erase` now actually removes elements from the vector, but only when more than half of elements have been erased. 4) If you repeatedly erase elements at the beginning of the vector, they will no longer be iterated over. This is a specific optimization for our heaviest TinyMap use-cases. These amount to some small but hopefully somewhat meaningful perf improvements. Changelog: [Internal] Fabric perf Reviewed By: shergin Differential Revision: D20718719 fbshipit-source-id: 91f4b2e2e0f6387ae484e43d5b0095103087baa6 * Remove LayoutInspectingPolicy.includeScrollViewContentOffset Summary: `LayoutInspectingPolicy` has two flags, `includeTransform` and `includeScrollViewContentOffset`. `includeScrollViewContentOffset` seems to be redundant for two reasons. # 1st From looking at callers, they have always the same value. I looked at all call sites, and they are either always both set to true or both set to false. # 2nd The way we include scroll view content offset, is through transformation, so setting `includeTransform` to true and `includeScrollViewContentOffset` to false will include content offset anyway. In order to make both flags work, we would need to introduce further changes to `getRelativeLayoutMetrics`. But since the flag isn't used anyway, I think it is better to get rid of it for now. If we need it in the future, we could re-introduce it. Reviewed By: shergin Differential Revision: D20622256 fbshipit-source-id: fb6156c66b752319ea928239fa723ff90688b0a0 * Add support for translation and rotation to operator * between Rect and Transform Summary: Changelog: [Internal] Until now `Rect operator*(Rect const &rect, Transform const &transform)` supported only scaling. Now it supports translation and rotation as well. Reviewed By: shergin Differential Revision: D20622876 fbshipit-source-id: 1b65393bd3fd6fd9a8941903e0f2681a10097e4a * Include transform property when calling getRelativeLayoutMetrics Summary: Changelog: [Internal] Current implementation of `measure` doesn't take transform into account.. So if you had a view which has width and height 100 and had `Scale(0.5, 0.5, 1)` (this will shrink view by half). Calling `getRelativeLayoutMetrics` would report its size being `{100, 100}`. This applies if view's parent has transformation as well, because transformation is applied to all subviews of the view as well. Reviewed By: mdvacca Differential Revision: D20621590 fbshipit-source-id: 2cf902a0494291c821ecada56f810c5e6620db5a * feat: migrate appveyor to circleci (#28245) Summary: This issue closes https://github.com/facebook/react-native/issues/28241 Migrated Windows test from AppVeyor to CircleCI ## Changelog [Internal] [Changed] - Migrated Windows test from AppVeyor to CircleCI Pull Request resolved: https://github.com/facebook/react-native/pull/28245 Test Plan: For CircleCI to Pass Reviewed By: cpojer Differential Revision: D20689163 Pulled By: hramos fbshipit-source-id: 285c762457ef00f7884ee9157b3f336044c0452f * Remove "Debug with Nuclide" option Summary: This is no longer needed. Reviewed By: cpojer Differential Revision: D20722274 fbshipit-source-id: 5bc3104e90811d724f42aadbf137ab8eff718ca0 * experiment to preload RN bridge after fb4a bookmarks render Summary: Changelog: [Android][Internal] add internal supermodule label Reviewed By: mdvacca Differential Revision: D20434200 fbshipit-source-id: fae50309cdd0df4a4523c2f88d1c8e01a7163575 * Fix CursorDrawable Color Tint for Android 10+ Summary: Accessing this field via reflection is explicitly blacklisted by Google in Android 10 and higher. They have provided a new API to change the color, which I have implemented here. [The old setColorFilter is deprecated](https://developer.android.com/reference/android/graphics/drawable/Drawable#setColorFilter(int,%20android.graphics.PorterDuff.Mode)) so I also updated that method call as well. Changelog: [General] [Fixed] Use new setTextCursorDrawable API for Android 10 Reviewed By: JoshuaGross Differential Revision: D20656068 fbshipit-source-id: 58a92b57c0a892c7c87fc5d735e4ceaa4e987ec7 * Early return on tinting CursorDrawable if no color supplied Summary: There's (potentially) a lot of expensive reflection calls here that, as best I can tell, end up being ignored if the supplied color is null. Better to early return. Changelog: [General] [Internal] Preclude reflection when setting cursor color if color is null Reviewed By: JoshuaGross Differential Revision: D20670594 fbshipit-source-id: 480a988355bbd79008002c4326d4b35035ec2a95 * Partial React Sync for Inspector Summary: Partial sync for React that includes: - https://github.com/facebook/react/pull/18388 - https://github.com/facebook/react/commit/dd7e5e4f5ac2ffac3171ef61daee2cb1edc69635 Created from this branch: https://github.com/facebook/react/compare/master...rickhanlonii:rh-partial-3-24?expand=1 Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20651395 fbshipit-source-id: 67baf7c407f75d9fd01c17f2203a77a38567100e * Enable inspector for Fabric Summary: ## Overview This diff refactors the Inspector, moving logic to look up view data for a touched view inside the renderer as `getInspectorDataForViewAtPoint`. We then implement that same function for Fabric in order to support the inspector in that renderer. Requires https://github.com/facebook/react/pull/18388 ## Motivation Reason one for this refactor is that, previously, the inspector held all of the logic to look up view data for a given x,y touch coordinate. To do this, it would take the React tag and coordinates, look up the native view tag, measure it, and then ask React internals for the Fiber information of that tag. All of this is deeply coupled to React internals, yet the logic is outside of React core in the Inspector. Reason two is that, for Fabric, the logic for getting the view data is different than Paper. In Fabric, we pass the x,y coordinates to native directly, which returns an instance handle. That handle can be used to measure the ShadowNode, or retrieve the Fiber information. By moving the logic into the renderer in React core, we decouple the implementation details of looking up view data for a tapped point and allow ourselves the ability to add and change renderer-specific code for the actual lookup without impacting outsiders like the Inspector. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D20291710 fbshipit-source-id: a125223f2e44a6483120c41dc6146ad75a0e3e68 * chore: update url of warning message from deprecated imports (#28452) Summary: Some of the repository name of Lean Core(https://github.com/facebook/react-native/issues/23313) libraries has been renamed. This PR updates the warning message to display the updated url. ## Changelog [General] [Changed] - Update warning message of deprecated imports Pull Request resolved: https://github.com/facebook/react-native/pull/28452 Test Plan: updated URL can be accessed. Reviewed By: cpojer Differential Revision: D20745184 Pulled By: TheSavior fbshipit-source-id: 2c3ed6a000b45022ca6c4862305aa567c4d18b2e * Add `upgrade-support` link on issue creation (#28411) Summary: This PR adds a https://github.com/react-native-community/upgrade-support link for the user when creating an issue. Changelog: [Internal] Pull Request resolved: https://github.com/facebook/react-native/pull/28411 Reviewed By: cpojer Differential Revision: D20714274 Pulled By: hramos fbshipit-source-id: 4ca42224a50e386b95f21f0fb236a917e1b6b982 * Update PixelRatio 'getFontScale' method description (#28407) Summary: Refs facebook/react-native-website#1776. Despite in-code description `PixelRatio.getFontScale()` is working properly on the iOS (it also reflects the user settings). This PR updates the in-code description to match current behaviour. I have decided to skip in the code information about additional setting in `Accessibility` menu and in `Control Centre`, but if you think it is important just let me know, I can update this PR. ## Changelog [Internal] [Fixed] - Fix PixelRatio getFontScale method description Pull Request resolved: https://github.com/facebook/react-native/pull/28407 Test Plan: N/A Differential Revision: D20750260 Pulled By: shergin fbshipit-source-id: c40ec2fd49cd60e2975351c3a1c453aab0045da4 * Remove allowDisablingImmediateExecutionOfScheduleMountItems feature flag Summary: No longer needed. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20747684 fbshipit-source-id: a8077519b7670d72e23267b1c1423556ec97be3f * RuntimeExecutor helpers that modify the way of the callback is being executed. Summary: Here we implement a bunch of helper methods that allow customizing the behavior of a RuntimeExecutor "on-demand" on the caller side. We will use it in the next diff(s). Changelog: [Internal] Fabric-specific internal change. Reviewed By: PeteTheHeat Differential Revision: D20551411 fbshipit-source-id: 51d3cd02b69753110c0e1155347c6e52eb882c7d * Fabric: Using `executeSynchronouslyOnSameThread_CAN_DEADLOCK` in MainRunLoopEventBeat Summary: We are replacing inline-ed implementation with practically the same one implemented as the helper method. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20551409 fbshipit-source-id: fcc6f497cd240af65fba534051c217fe5746ce82 * Set RootNodeKind trait in ModalHostViewShadowNode Summary: Changelog: [internal] `ModalHostViewShadowNode` didn't have `RootNodeKit` trait, therefore `getRelativeLayoutMetrics` was including nodes in ancestors that it shouldn't have. Reviewed By: shergin Differential Revision: D20735801 fbshipit-source-id: 6b81e3b174c2f82e530abc2bca2da8bebc2270b0 * mention RNTester app in contributor guide (#28042) Summary: motivation is following - the RNTester app is imho the best place to try out any changes that a contributor would make, yet it is not directly mentioned in the contributor guide. This fixes it. ## Changelog [Internal] - Docs Pull Request resolved: https://github.com/facebook/react-native/pull/28042 Test Plan: not necessary Reviewed By: TheSavior Differential Revision: D20401260 Pulled By: hramos fbshipit-source-id: 01c1b7dff56b59909c94b2feb609650f0baba1a9 * Buck: Use Android SDK 29 during build (#28455) Summary: Fixes `test_android` and `test_docker` build failures. Thanks to dulmandakh for identifying the fix. Changelog: [Internal] [Android] [Changed] - Use Android SDK 29 to build during CI tests Pull Request resolved: https://github.com/facebook/react-native/pull/28455 Test Plan: Circle CI shows `test_android` and `test_docker` passing: https://app.circleci.com/jobs/github/facebook/react-native/142273 Reviewed By: sturmen Differential Revision: D20766589 Pulled By: hramos fbshipit-source-id: 8ef8a8ce3a6e7353ae47425accb3bd26cf1608c4 * Assign orderIndex_ in ConcreteViewShadowNode constructor instead of ViewShadowNode's constructor Summary: Changelog: [Internal] `orderIndex_` was only being assigned for `ViewShadowNode`, not for other `ShadowNodes` that are later represented on the screen. Reviewed By: shergin Differential Revision: D20746477 fbshipit-source-id: c04c2cfea14b9141d22bc3d9e9bb4c0c59925754 * Implement nativePerformanceNow to improve Profiler API results (#27885) Summary: When experimenting with React Profiler API (https://reactjs.org/docs/profiler.html), I noticed that durations are integers without a debugger, but they are doubles with higher precision when debugger is attached. After digging into React Profiler code, I found out that it's using `performance.now()` to accumulate execution times of individual units of work. Since this method does not exist in React Native, it falls back to Javascript `Date`, leading to imprecise results. This PR introduces `global.nativePerformanceNow` function which returns precise native time, and a very basic `performance` polyfill with `now` function. This will greatly improve React Profiler API results, which is essential for profiling and benchmark tools. Solves https://github.com/facebook/react-native/issues/27274 ## Changelog [General] [Added] - Implement `nativePerformanceNow` and `performance.now()` Pull Request resolved: https://github.com/facebook/react-native/pull/27885 Test Plan: ``` const initialTime = global.performance.now(); setTimeout(() => { const newTime = global.performance.now(); console.warn('duration', newTime - initialTime); }, 1000); ``` ### Android + Hermes ![Screenshot_1580198068](https://user-images.githubusercontent.com/13116854/73245757-af0d6c80-41b5-11ea-8130-dde14ebd41a3.png) ### Android + JSC ![Screenshot_1580199089](https://user-images.githubusercontent.com/13116854/73246157-92256900-41b6-11ea-87a6-ac222383200c.png) ### iOS ![Simulator Screen Shot - iPhone 8 - 2020-01-28 at 10 06 49](https://user-images.githubusercontent.com/13116854/73245871-f136ae00-41b5-11ea-9e31-b1eff5717e62.png) Reviewed By: ejanzer Differential Revision: D19888289 Pulled By: rickhanlonii fbshipit-source-id: ab8152382da9aee9b4b3c76f096e45d40f55da6c * Save/restore IP when leaving the interpreter Summary: This diff implements the instruction pointer save/restore trick Tzvetan came up with; allowing us to observe and modify the IP from outside the interpreter loop with negligible overhead. From Tzvetan's internal post on the subject: > [Today] the interpreter IP is just a local variable in the interpreter function, so there is no way to get to its value from outside the function. It lives in a register and we don't want to make it a Runtime field since the overhead [of accessing it via memory in the interpeter loop] would kill us. > However, if you really think about it, it only lives in a register while the interpreter function is running. For the rest of the time, it is spilled by the C++ compiler onto the stack. So, precisely when we need it, it is actually stored in memory. The only problem is, we don't know where! Admittedly, that is an annoying problem, but it feels like it should be solvable. > What if, instead of relying on the compiler to spill the IP register, we manually spill it ourselves, to a known location? It works. Example: https://godbolt.org/z/ftSDnp This diff implements this approach across the whole interpreter loop: whenever we call out of the loop we capture/publish the IP and restore it again immediately after the external call returns. This means we can now see the IP outside the interpret loop and even change it. This is effectively "for free" as the compiler now skips spilling/restoring the IP behind the scenes. The immediate benefit of this is knowing the current IP allows us to have more accurate stack-traces during execution. In future this may enabled tricks like changing the IP before returning to the interpreter loop, allowing things outside the interpreter to affect program flow without adding logic to the interpreter loop. Reviewed By: tmikov Differential Revision: D20151091 fbshipit-source-id: 3814382639800208d8985a32ede31ba8f7ff7c80 * Plumb through memory allocation profiler feature to Chrome Inspector Summary: Changelog: Make allocation profiler feature of Chome Inspector work Reviewed By: dulinriley Differential Revision: D20383003 fbshipit-source-id: 8a10c310d5a639a6644763adb53f2f0017057587 * chore: update lint config in template (#28443) Summary: Updating the eslint config and metro-preset used in project template. ## Changelog [General] [Changed] - Upgrade eslint-config and metro-preset in project template Pull Request resolved: https://github.com/facebook/react-native/pull/28443 Test Plan: - Start new project with `npx react-native init TestLint` - upgrade lint and metro-config - run lint and start up emulator on iOS and android Reviewed By: cpojer Differential Revision: D20771048 Pulled By: hramos fbshipit-source-id: a6d387b8687cee348681bcb10d22c7e3de291ed7 * Apply buckformat in preparation for updating buildifier Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D20773287 fbshipit-source-id: 144bb13191312eef246646b99e1dc06304c6d210 * Circle CI Housekeeping: Windows, e2e (#28471) Summary: Circle CI Housekeeping: * Integrate Windows job into `tests` workflow * Add parametrized e2e tests command * Move js e2e tests out of the disabled test quarantine area * Parametrize and split `test_ios` job to reduce total execution time by ~13 minutes **Before:** Longest running iOS job at 39 minutes. | Setup Job Runtime | Job | Job Runtime | Total Runtime | | - | - | - | - | | 01:24 | test_ios | 38:04 | **39:28** | | 01:24 | test_ios_frameworks | 38:02 | 39:26 | ![Screen Shot 2020-03-31 at 12 40 29 PM](https://user-images.githubusercontent.com/165856/78068308-044c3280-734d-11ea-96bf-2e50691a0ef7.png) **After:** Longest running iOS job down to 26 minutes. | Setup Job Runtime | Job | Job Runtime | Total Runtime | | - | - | - | - | | 01:26 | test_ios_unit | 20:48 | 22:14 | | 01:26 | test_ios_unit_frameworks | 22:52 | 24:18 | | 01:26 | test_ios_detox | 24:35 | 39:28 | | 01:26 | test_ios_detox_frameworks | 24:54 | **26:20** | ![Screen Shot 2020-03-31 at 12 39 22 PM](https://user-images.githubusercontent.com/165856/78068294-fe565180-734c-11ea-96da-8836231d7747.png) ## Changelog [Internal] [CI] - CI Housekeeping Pull Request resolved: https://github.com/facebook/react-native/pull/28471 Test Plan: Circle CI Reviewed By: cpojer Differential Revision: D20774521 Pulled By: hramos fbshipit-source-id: 4a2f5a4083cd76dcb51d5ccaf726cd204fca222e * Fix bug in optimized differ Summary: The differ was still producing correct, but not minimal, instruction sets in some cases due to an optimization that was buggy. This affected cases where 2+ nodes were inserted at the beginning of a list. It would trigger the old behavior where all nodes after the first would be removed, deleted, then reinserted. See the test case (which was failing and now passed) and P128190998 (the 3->4 transition) for samples. Changelog: [Internal] Fabric differ Reviewed By: mdvacca Differential Revision: D20785729 fbshipit-source-id: 2fea6a816753066abb358ed7bb51003140cd5fc4 * Use `buildCodeFrameError` in babel-plugin-inline-view-configs Summary: The next version of Babel changes how it prints file names in errors. This diff fixes the test by using `/` as the `cwd` and switches the plagin to use `path.buildCodeFrameError` so errors will be more helpful for users. I renamed the `nodePath` variable to `path` because that's what babel plugins usually do. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D20781805 fbshipit-source-id: cc149dce6389aa9402ce70ea30035c74a6150ea3 * Swap left and right yoga position with start and end in RTL context Summary: Changelog: [Internal] Paper swaps right and left in RTL setting, this logic is in [RCTShadowView.m](https://our.intern.facebook.com/intern/diffusion/FBS/browse/master/xplat/js/react-native-github/React/Views/RCTShadowView.m?commit=cdd504cfbee66ae0659495604c4ff7b5764a1d9e&lines=529-549). For Fabric instead of doing it during yoga props assignment, I swap the left/right with start/end just before we pass yoga nodes to layout calculation. Reviewed By: shergin Differential Revision: D20420040 fbshipit-source-id: b777f2658f56c173743b2034b8b5059e3e0c9840 * Fix inline-view-configs test on Windows. Summary: *facepalm* The file path is platform specific. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D20793023 fbshipit-source-id: 4fbcbf982911ee449a4fa5067cc0c5d81088ce04 * Pass isRTL flag from FabricUIManager Fabric core Summary: Changelog: [Internal] Send `isRTL` flag and `doLeftAndRightSwapInRTL` flags from Java to Fabric Core. Reviewed By: JoshuaGross, mdvacca Differential Revision: D20776005 fbshipit-source-id: 946c239d9a11ebea958b0a6d04f2316b7cd77311 * Promote shadowColor to formsStackingContext property Summary: Changelog: [Internal] View with `ShadowColor` was getting flattened and therefore views didn't have shadow property set. This is fixed by promoting ShadowColor so in case it is set, it forms stacking context. Reviewed By: shergin Differential Revision: D20792201 fbshipit-source-id: 1033ac00e32047ffbb14e61b7c26348c578d132d * Get CallInvokers from the bridge Summary: ## Context For now, assume TurboModules doesn't exist. **What happens when we call an async NativeModule method?** Everytime JS calls an async NativeModule method, we don't immediately execute it. The legacy infra pushes the call into some queue managed by `MessageQueue.js`. This queue is "flushed" or "emptied" by the following events: - **Flushed:** A C++ -> JS call. NativeModule async methods can called with an `onSuccess` and/or `onFail` callback(s). Calling `NativeToJsBridge::invokeCallback` to invoke one of these callbacks is one way for ObjC++/C++/Java to call into JS. Another way is via JSModule method calls, which are initiated by `NativeToJsBridge::callFunction`. - **Flushed:** When `JSIExecutor::flush` is called. Since TurboModules don't exist, this only happens when we call `JSIExecutor::loadApplicationScript`. - **Emptied:** When more than 5 ms have passed, and the queue hasn't been flushed/emptied, on the next async NativeModule method call, we add to the queue. Afterwards, we empty it, and invoke all the NativeModule method calls. **So, what's the difference between flushed and emptied?** > Note: These are two terms I just made up, but the distinction is important. If the queue was "flushed", and it contained at least one NativeModule method call, `JsToNativeBridge` dispatches the `onBatchComplete` event. On Android, the UIManager module is the only module that listens to this event. This `onBatchComplete` event doesn't fire if the queue was "emptied". **Why does any of this matter?** 1. TurboModules exist. 2. We need the TurboModules infra to have `JsToNativeBridge` dispatch `onBatchComplete`, which depends on: - **Problem 1:** The queue being flushed on calls into JS from Java/C++/ObjC++. - **Problem 2:** There being queued up NativeModule async method calls when the queue is flushed. In D14656466, fkgozali fixed Problem 1 by making every C++/Java/Obj -> JS call from TurboModules also execute `JSIExecutor::flush()`. This means that, with TurboModules, we flush the NativeModule async method call queue as often as we do without TurboModules. So far, so good. However, we still have one big problem: As we convert more NativeModules to TurboModules, the average size of the queue of NativeModule method calls will become smaller and smaller, because more NativeModule method calls will be TurboModule method calls. This queue will more often be empty than not. Therefore, we'll end up dispatching the `onBatchComplete` event less often with TurboModules enabled. So, somehow, when we're about to flush the NativeModule method call queue, we need `JsToNativeBridge` to understand that we've executed TurboModule method calls in the batch. These calls would have normally been queued, which would have led the queue size to be non-zero. So if, during a batch, some TurboModule async method calls were executed, `JsToNativeBridge` should dispatch `onBatchComplete`. **So, what does this diff do?** 1. Make `Instance` responsible for creating the JS `CallInvoker`. 2. Make `NativeToJsBridge` responsible for creating the native `CallInvoker`. `Instance` calls into `NativeToJsBridge` to get the native `CallInvoker`. 3. Hook up `CatalystInstanceImpl`, the Android bridge, with the new JS `CallInvoker`, and the new native `CallInvoker`. This fixes `onBatchComplete` on Android. iOS work is pending. Changelog: [Android][Fixed] - Ensure `onBatchComplete` is dispatched correctly with TurboModules Reviewed By: mdvacca Differential Revision: D20717931 fbshipit-source-id: bc3ccbd6c135b7f084edbc6ddb4d1e3c0c7e0875 * Make HermesRuntime::description() always include "HermesRuntime" Summary: If name is passed in as part of RuntimeConfig, that is included in the description, too. Changelog: [Internal] Reviewed By: dulinriley Differential Revision: D20716320 fbshipit-source-id: f2fba6df32f496090dee787d8b7f55a6a4dd8ed8 * Fix Yoga flexshrink with min-width sizing issue Summary: While resolving the flexible items we calculate totalFlexShrinkScaledFactors which uses the flexBasis or initial width of node (Not min-width). At a later stage during distribution of space we are subtracting value from this which also takes care of min-width. For example If node has flexShrink 1 and width 100 and min-width 301 then totalFlexShrinkScaledFactors will become -1*100 = -100 but later we are subtracting -1 * 301 (min-width) = -301 which is ambiguous and causing layout inconsistencies with how web behaves. Fixed this by only using the flexBasis or width for these calculations. Changelog: [Internal][Yoga] Fix layout issue when flexShrink and min-width are used together Reviewed By: pasqualeanatriello Differential Revision: D20219419 fbshipit-source-id: 948fbc06ca541d4ad307c88c8a2df65d157778b1 * More consistent snapshots on windows (#28482) Summary: Get jest tests to be runnable on windows, and match current snapshots ## Changelog [Internal] [Fixed] - More consistent snapshots on windows Pull Request resolved: https://github.com/facebook/react-native/pull/28482 Test Plan: run `yarn test` on a windows machine, and hit the test_windows circleci tests Reviewed By: hramos Differential Revision: D20799002 Pulled By: cpojer fbshipit-source-id: da3db0171c34a43199c7d3dc17b622b37bc91701 * Improve component stack parsing Summary: Update the error log message parsing to fix missing component stacks in console.errors. Changelog: [Internal] Reviewed By: cpojer Differential Revision: D20801985 fbshipit-source-id: ae544200315a8c3c0310e8370bc38b0546734f38 * Implement RCTWarn equivalent on Android Summary: ## Overview This diff is an RFC to port a logging feature from iOS to Android. Changelog: [Internal] ## Motivation On iOS we have the following log functions and behaviors available for logging native warnings and errors: - **Warnings** (`RCTLogWarn`) - Log level 'warn' to console - Display warning in LogBox - **Errors** (`RCTLogError`) - Log level 'error' to console - Display a native RedBox (needs converted to show a LogBox if available) - **Logs** - We also have `RCTLog`, `RCTTrace`, `RCTAdvice`, `RCTInfo`, which just log to the console. In Java, we have: - **Warnings** - **None**, added in this diff - **Errors** (`DevSupportManager.showNewJavaError`) - Log level 'error' to console with `FLog.e` - Display a native RedBox (needs converted to show a LogBox if available - **Logs** - `ReactSoftException` (crashes the app??) - `ReactNoCrashSoftException` (only logs??) - Others? ## Details This diff adds a method to pair with `RCTLogWarn`, `DevSupportManager.showNewJavaWarning`, which will log to the console and show a LogBox warning if LogBox is available. ## Concerns I have a few concerns/questions about the state of logging on Android: - Should/can we move all of the logging to it's own class, like how RCTLog works? - Why does some logging happen on DevSupportManager and some in other classes? - If we moved it all to it's own class, how could we access the reactContext to call the RCTLog JS module Reviewed By: JoshuaGross Differential Revision: D20056394 fbshipit-source-id: 32d57e300685e46da8039fc77cb22b4084acf81a * Remove unused feature flag: useMapNativeAccessor Summary: useMapNativeAccessor isn't being used anywhere. Changelog: [Internal] Removing unused internal feature flags: mUseMapNativeAccessor and mUseArrayNativeAccessor Reviewed By: mdvacca Differential Revision: D20788147 fbshipit-source-id: bf670508326813602cb544f86d3d2164651d3394 * Remove unused Feature Flag: lazilyLoadViewManagers Summary: Remove unused feature flag. This is not used within Facebook and I'm not aware of usage outside of FB. Changelog: [Removed] Removing Android feature flag: lazilyLoadViewManagers Reviewed By: mdvacca Differential Revision: D20788210 fbshipit-source-id: 435316e3de7830d7cb7f14537351883e4fc6eeaa * Remove unused feature flag: enableExtraWebViewLogs Summary: Hard-coded to false everywhere, and write-only. We never read from this. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20788252 fbshipit-source-id: ae117ebc51db7045947b9713602527ff4220833e * Remove unused feature flag: logDroppedViews Summary: Remove unused internal feature flag, logDroppedViews. Changelog: [Internal] Reviewed By: lunaleaps Differential Revision: D20797353 fbshipit-source-id: 1bfea7fcce9e80cdb92cda59a89c7dd817d4a581 * Split loadApplicationScript into initializeRuntime and loadBundle (#27844) Summary: This is the first of three PRs related to enabling multi-bundle support in React Native. More details, motivation and reasoning behind it can be found in RFC [here](https://github.com/react-native-community/discussions-and-proposals/issues/152). Logic responsible for installing globals was pulled out from `loadApplicationScript` to `initializeRuntime` since it should be ran only once, what was left was renamed to `loadBundle`. It's based on dratwas work from [here](https://github.com/callstack/react-native/tree/feat/multibundle/split-load-application), but applied to current `master` to avoid rebasing 3-months old branch and issues that come with that. ## Changelog [Internal] [Changed] - split `loadApplicationScript` into `initializeRuntime` and `loadBundle` to enable multi-bundle support in the future Pull Request resolved: https://github.com/facebook/react-native/pull/27844 Test Plan: Initialized new RN app with CLI, set RN to build from source and verified the still app builds and runs OK using code from this branch. Reviewed By: rickhanlonii Differential Revision: D19888605 Pulled By: ejanzer fbshipit-source-id: 24ace48ffe8978796591fe7c6cf53a61b127cce6 * Back out "Fix controlled TextInput with child nodes" Summary: Changelog: [Internal] Original commit changeset: 1b8a2efabbfa Original diff D20587681 breaks non-controlled text input. Reviewed By: motiz88 Differential Revision: D20815935 fbshipit-source-id: 70577ed1e5701850ff0e30a6592945a31c2a8bec * Fixed crash in JSIExecutor::NativeModuleProxy Summary: JSIExecutor::NativeModuleProxy is an object created by JSIExecutor and essentially representing that in JavaScript world. Before this change, JSIExecutor::NativeModuleProxy had a raw reference to JSIExecutor which (I believe) caused a crash because JSIExecutor can be deallocated before JSIExecutor::NativeModuleProxy. Now, instead of storing a pointer to JSIExecutor, we store a weak pointer to JSINativeModules which we can safely validate before calling on it. Changelog: [Internal] Fixed crash in JSIExecutor Now the configuration looks like this: ``` + - - - - - - - - - - - - - - - - - - - - - Something else | | shared_ptr<jsi::Runtime> runtime --+ | | + - - - - - - - - - - - - - - - - - - - - - | | | +------------------------------------------+ | | | | | JSExecutorFactory | | +--------------------------------+-------------------------------+ | | +-----------------------+ | | | +------------------------------------------+ | | v | | | +------------------------------------------+ | +--------------------------+ | | | | | | | | ModuleRegistry | | v | | | | | +------------------------------------------+ | | +------------------------------------------+ | | HermesRuntimeImpl | | | | | | (jsi::Runtime) |--+ | | +->+------------------------------------------+ | | | | | | | |std::unordered_map<std::string, size_t> | | +------------------------------------------+ | | | | |modulesByName_ | | | | | | | | | | | | | +------------------------------------------+ | | | | +->+------------------------------------------+ | +-----------------------+ | | |std::vector<std::unique_ptr<NativeModule>>| | | | | |modules_ | | | | | | | | v | | +------------------------------------------+ | +------------------------------------------+ | | | | | | | | | JSIExecutor::NativeModuleProxy | | | | | | | | | +------------------------------------------+ | | | +------------------------------------------+ | | | | | | +->+------------------------------------------+ | | | | NativeToJsBridge | |shared_ptr<JSINativeModules> | | | | | | |nativeModules_ | | | | +------------------------------------------+ +------------------------------------------+--+-----+------------------------------------+ | | | | | | +->+------------------------------------------+ | | | | | |unique_ptr<JSExecutor> | | | | | | |m_executor | | | | | | |(`::destroy()` resets it.) | | | | | | +------------------------------------------+--------------------------------+ | | | | +->+------------------------------------------+ | | | | | | |shared_ptr<JsToNativeBridge> | | | | | | | |m_delegate | | | | | | | +------------------------------------------+--+ v | | | | +->+------------------------------------------+ | +------------------------------------------+ | | | | |shared_ptr<MessageQueueThread> | | | | | | | | |m_executorMessageQueueThread | | | HermesExecutor: JSIExecutor: JSExecutor | | | | | +------------------------------------------+ | | | | | | | | +------------------------------------------+ | | | | | | | | | | | +->+------------------------------------------+ | | | | | | |shared_ptr<jsi::Runtime> | | | | | | | |runtime_ | | | | | | | +------------------------------------------+--+ | | | | +->+------------------------------------------+ | | | | | |shared_ptr<JSINativeModules> | | | | | | |nativeModules_ | | | | | | +------------------------------------------+--------+------------------------------------+ | +--------------------------+ +->+------------------------------------------+ | | | | |std::shared_ptr<ExecutorDelegate> | | v | | |delegate_ | | +------------------------------------------+ | | +------------------------------------------+--+ | | | | | | | | JSINativeModules | | | | | | | | | | | +------------------------------------------+ | | | | | | | | | +-->+------------------------------------------+ | +-----------------------------------------------------------------------------------+ | |m_moduleRegistry | | | | |(shared_ptr) | | | | +------------------------------------------+--+ | | | | v | +------------------------------------------+ | | | | | JsToNativeBridge: ExecutorDelegate | | | | | +------------------------------------------+ | | | +->+------------------------------------------+ | |shared_ptr<ModuleRegistry> | | |m_registry | | +------------------------------------------+-----------------------------------------------------------------+ ``` Reviewed By: RSNara Differential Revision: D20817257 fbshipit-source-id: 9ae378dbe880aaabfef7ae783dae2f94ee4b0af5 * Fix crash caused by <Modal> trying to present view controller twice Summary: Changelog: [Internal] `_viewController` was being presented twice causing following exception ``` 'Application tried to present modally an active controller <FBReactRootViewController: 0x7fe741818b80; ``` Reviewed By: shergin Differential Revision: D20820395 fbshipit-source-id: 5c9489011e5f99d8bd37befbd544d2d55a650589 * Loosen up restrictions for internal changelogs (#28486) Summary: Do not nag on PRs that contain internal changelogs (meaning, the change doesn't need to be called out in release notes). ## Changelog [Internal] - This should be acceptable. Pull Request resolved: https://github.com/facebook/react-native/pull/28486 Test Plan: See PR. Reviewed By: cpojer Differential Revision: D20817454 Pulled By: hramos fbshipit-source-id: a7082c4db05ec53ad27349db7e5bce2cfffd6930 * Fix TextInlineViews when UIImplementation processes two roots at the same time Summary: This diff cleans the variable NativeViewHierarchyOptimizer.mTagsWithLayoutVisited right after all the view updates for a rootShadowNode have been processed by the UIImplementation class. This intends to fix the bug reported in the task: T61185028, which root cause seems related to the fact that the variable NativeViewHierarchyOptimizer.mTagsWithLayoutVisited is not cleaned up when updating multiple rootShadowNodes as part of the same batch changelog: [Android][internal] internal bug fix Reviewed By: JoshuaGross Differential Revision: D20812921 fbshipit-source-id: 28067ee29a931d7a9e9c33c90aceb4e3512dac1a * Add a React Feature Flag to control TextInlineView fix Summary: This diff adds a temporary Feature Flag to control a fix in TextInlineView (see previous diffs of the stack) changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D20812920 fbshipit-source-id: 90fece9b29ba173546d96e4d9baf1ccabb3031b2 * Pass native CallInvoker to ObjCTurboModule constructor Summary: This is necessary to integrate TurboModule async method dispatch with the bridge's `onBatchComplete` event. See D20717931 for more details. This diff is similar to D20480971. **Note:** This stack doesn't really make any functional changes, since the native CallInvoker is `nullptr` right now. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809199 fbshipit-source-id: bf465a3a51bdddb8b56d1e696ca510fdf071f9ec * Manual changes required to make ObjCTurboModule accept native CallInvoker Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809200 fbshipit-source-id: d540eec9a3360a031f75d76a6ab9fb15303f8af5 * Codemod all getTurboModuleWithJsInvoker methods to accept a native CallInvoker Summary: To make iOS TurboModules integrate with the bridge's onBatchComplete event, they need to use a native CallInvoker. This call invoker is created by the `NativeToJsBridge`, and ObjCTurboModule will use this native CallInvoker to dispatch TurboModule method calls. This diff makes sure that ObjCTurboModules are created with that native CallInvoker. ## Script ``` var withSpaces = (...args) => args.join('\s*') var regexString = withSpaces( '-', '\(', 'std::shared_ptr', '<', '(?<turboModuleClass>(facebook::react::|react::|::|)TurboModule)', '>', '\)', 'getTurboModuleWithJsInvoker', ':', '\(', 'std::shared_ptr', '<', '(?<callInvokerClass>(facebook::react::|react::|::|)CallInvoker)', '>', '\)', '(?<jsInvokerInstance>[A-Za-z0-9]+)', 'perfLogger', ':', '\(', 'id', '<', 'RCTTurboModulePerformanceLogger', '>', '\)', '(?<perfLoggerInstance>[A-Za-z0-9]+)', '{', 'return', 'std::make_shared', '<', '(?<specName>(facebook::react::|react::|::|)Native[%A-Za-z0-9]+SpecJSI)', '>', '\(', 'self', ',', '\k<jsInvokerInstance>', ',', '\k<perfLoggerInstance>', '\)', ';', '}', ) var replaceString = `- (std::shared_ptr<$<turboModuleClass>>) getTurboModuleWithJsInvoker:(std::shared_ptr<$<callInvokerClass>>)$<jsInvokerInstance> nativeInvoker:(std::shared_ptr<$<callInvokerClass>>)nativeInvoker perfLogger:(id<RCTTurboModulePerformanceLogger>)$<perfLoggerInstance> { return std::make_shared<$<specName>>(self, $<jsInvokerInstance>, nativeInvoker, $<perfLoggerInstance>); }` const exec = require('../lib/exec'); const abspath = require('../lib/abspath'); const relpath = require('../lib/relpath'); const readFile = (filename) => require('fs').readFileSync(filename, 'utf8'); const writeFile = (filename, content) => require('fs').writeFileSync(filename, content); function main() { const tmFiles = exec('cd ~/fbsource && xbgs -n 10000 -l getTurboModuleWithJsInvoker:').split('\n').filter(Boolean); tmFiles .filter((filename) => !filename.includes('microsoft-fork-of-react-native')) .map(abspath) .forEach((filename) => { const source = readFile(filename); const newSource = source.replace(new RegExp(regexString, 'g'), replaceString); if (source == newSource) { console.log(relpath(filename)); } writeFile(filename, newSource); }); } if (!module.parent) { main(); } ``` Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809202 fbshipit-source-id: 5d39b3cacdaa5681b70ce1803351d0432dd74550 * Make RCTTurboModuleManagerDelegate getTurboModule accept native CallInvoker and PerfLogger Summary: Might be worthwhile to just kill this method instead, since we're having all NativeModules provide their TurboModule jsi::HostObjects. But I'll leave that decision to a later time. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809201 fbshipit-source-id: ee73d4b5454a76460832a54f9b864841e5b2b9c0 * eslint-config: add version badge and add homepage for eslint-config (#28506) Summary: Add version badge to README of eslint-config, and add specific url for the homepage so people looking at the npm package can find out where the package is from. ## Changelog [Internal] [Changed] - Add version badge to README of eslint-config Pull Request resolved: https://github.com/facebook/react-native/pull/28506 Test Plan: Not required as the only changes are made in README and homepage prop of package.json Differential Revision: D20837085 Pulled By: cpojer fbshipit-source-id: 820d3b44b069780ec8764c6152d2e7fd5220933c * Rename Instance::getNativeCallinvoker to Instance::getDecoratedNativeCallInvoker Summary: Now, instead of accepting a `std::function` that schedules work, and returning a `CallInvoker`, `Instance::getDecoratedNativeCallInvoker` will accept a `CallInvoker` that schedules work, and return a decorated `CallInvoker`. I think this change will help with readability. It also clarifies that the bridge is adding additional behaviour to the native `CallInvoker`. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20826885 fbshipit-source-id: a2c5681d10a4544ee3d2a0d1f1cbd386ef06d0e6 * Add CallInvoker::invokeSync Summary: We'll be using a native CallInvoker to dispatch sync and async method calls to ObjC NativeModules. This native CallInvoker will hold a reference to the ObjC NativeModule's method queue. **Why is the native CallInvoker required for ObjC NativeModules?** In the case where the ObjC NativeModule neither provides nor requests a method queue, we must create a method queue for it. When we go to invoke a method from JS, for these NativeModules specifically, there is no way to access this method queue. A native CallInvoker is a convenient abstraction that holds on to that method queue. For async calls, we'll just call `CallInvoker::invokeAsync`, and for sync calls, we'll just call `CallInvoker::invokeSync`. **Why do we need sync call support for native `CallInvoker`?** In ObjC, sync NativeModule method calls block the JS thread, then execute synchronously on the NativeModule's method queue, and then unblock the JS thread. This is what'll be implemented by `CallInvoker::invokeSync`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20829955 fbshipit-source-id: efb9d5408a1ade81069a943c865f232d4d10acfe * Export Instance::getDecoratedNativeCallInvoker from RCTCxxBridge Summary: `RCTTurboModuleManager` will create a native `CallInvoker` for each ObjC NativeModule. This `CallInvoker` will be used to dispatch calls from JS to native. Before passing the native `CallInvoker` to the `ObjCTurboModule`, it'll first use `RCTCxxBridge decorateNativeCallInvoker` to get a bridge-aware decorated native `CallInvoker`. That way, the bridge remains informed about async TurboModule method calls that took place since the last time it was flushed. This ensures that we don't end up dispatching `onBatchComplete` any less with TurboModules on than we do with TurboModules off. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20831546 fbshipit-source-id: b2eb4e0097e0dabf8c4bd8fdc4c850a0858af699 * Add Author Feedback label automatically (#28484) Summary: Improve issue triage by automatically adding the "Needs: Author Feedback" label. NOTE: The old label-actions app should be disabled when this PR is merged: https://github.com/apps/label-actions/installations/7445225 ## Changelog [Internal] - Issue Triage Pull Request resolved: https://github.com/facebook/react-native/pull/28484 Test Plan: Verified the same `label-actions.yml` and workflow config on a private repo. Reviewed By: cpojer Differential Revision: D20817443 Pulled By: hramos fbshipit-source-id: 39732dd67509c9fb9cf6ff7306913f5ec088266d * docs: add README and specify file in package.json (#28507) Summary: Adding a README for `react-native-codegen` since the package was published. Also added a `files` prop in package.json so unused file won't be included in the package. ## Changelog [Internal] [Changed] - Add README for react-native-codegen. Pull Request resolved: https://github.com/facebook/react-native/pull/28507 Test Plan: verify js files to function correctly without including files other than `src` Reviewed By: rickhanlonii Differential Revision: D20836113 Pulled By: cpojer fbshipit-source-id: e860f14760e9c1dbe121f5fb95ccf72d4ddb2af1 * Make the link easier to copy. (#28516) Summary: Making a PR from GitHub, I need to copy-paste the link, and it would be easier to just triple-click a line with the URL rather than carefully selecting the URL from the text. <img width="723" alt="Screen Shot 2020-04-03 at 17 33 47" src="https://user-images.githubusercontent.com/100233/78378550-6c12af80-75d1-11ea-93a4-2eae568ce602.png"> ## Changelog [General] [Changed] - Make PR template easier to use with changelog URL. Pull Request resolved: https://github.com/facebook/react-native/pull/28516 Reviewed By: fkgozali Differential Revision: D20842238 Pulled By: hramos fbshipit-source-id: 3fef7a994f36a996bbbc52556600d468a56210a9 * Upgrade tests to Xcode 11.3.1 (#28498) Summary: Upgrade Sandcastle and Circle CI tests to use Xcode 11.3.1 across the board. Pull Request resolved: https://github.com/facebook/react-native/pull/28498 Pull Request resolved: https://github.com/facebook/react-native/pull/28501 Changelog: [Internal] - Use Xcode 11.3.1 in iOS tests Reviewed By: fkgozali Differential Revision: D20821844 fbshipit-source-id: b250ca82bdf2c9fb7faa765d3e2433eb46efd692 * Fixes iOS reload through metro "r" command key (#28477) Summary: This allows the iOS device to be reloaded through the metro command line, besides the fact that whenever packagerServerHost is called, it will only get the IP address once when debugging. ## Changelog [iOS] [Fixed] - Fixed connection of metro reload command to iOS device Pull Request resolved: https://github.com/facebook/react-native/pull/28477 Test Plan: - Build any react-native project in debug mode to an iOS device connected through USB - Press the “r” key on the terminal that is running metro - The device should now reload the project Reviewed By: cpojer Differential Revision: D20818462 Pulled By: TheSavior fbshipit-source-id: 6d9792447d205223dad8fbd955518885427cbba8 * Create method queues for NativeModules that neither provide nor request one Summary: ## Problem: Let `A` be the set of all ObjC NativeModules that neither provide nor reqeust a method queue. The TurboModule system dispatches all method calls to NativeModules in `A` synchronously to the JS thread. Here is the relevant logic: **RCTTurboModule.mm:** Link: https://fburl.com/diffusion/nz9gqje8 ``` jsi::Value performMethodInvocation( // ... ) { // ... dispatch_queue_t methodQueue = NULL; if ([instance_ conformsToProtocol:protocol(RCTBridgeModule)] && [instance_ respondsToSelector:selector(methodQueue)]) { methodQueue = [instance_ performSelector:selector(methodQueue)]; } if (methodQueue == NULL || methodQueue == RCTJSThread) { // This is the default mode of execution: on JS thread. block(); } else if (methodQueue == dispatch_get_main_queue()) { ``` **Why does this end up happening?** 1. NativeModules that request a method queue have `synthesize methodQueue = _methodQueue` in their `implementation` section. This generates a `methodQueue` getter for the NativeModule, and also creates an ivar to back that getter. The TurboModule system generates a `dispatch_queue_t` and uses ObjC's KVC API to write to the ivar. So in the above logic, for NativeModules that provide a method queue, methodQueue will neither be `NULL` nor `RCTJSThread`, so we don't dispatch synchronously to the JS thread. 2. NativeModules that provide a method queue will return something that is not `NULL` or something that is `RCTJSThread`. If they return `NULL`, the infra will throw an error early. If they return `RCTJSThread`, we'll dispatch synchronously to the JS thread, as we should (...wait. For async NativeModule methods that dispatch to `RCTJSThread`, should we dispatch asynchronously to the JS thread, via jsInvoker? **Edit:** Nope: https://fburl.com/diffusion/ivt9b40s.). In all other cases, we dispatch to appropriately to the respective method queue. 3. For NativeModules that neither provide nor request a method queue (i.e: NativeModules in `A`), they don't implement the `methodQueue` selector. Therefore, we dispatch synchronously to the JS thread. ## The fix (Part 1): The first step towards fixing this problem is to generate `dispatch_queue_t`s for NativeModules in `A`. That's what this diff accomplishes. Changelog: [iOS][Fixed] - Create method queue for NativeModules that don't provide nor request one. Reviewed By: fkgozali Differential Revision: D20821054 fbshipit-source-id: 17a73550ad96766c5c7e719e28e1cc879e36465c * Rename duplicate name `<ScrollView>` example on RNTester (#28515) Summary: Tiny change. When searching for `scro` in the RNTester, two `<ScrollView>`s come up, from different example files. One is the "simple" one and the other is the "regular" one. Before: <img width="370" alt="Screen Shot 2020-04-03 at 17 14 01" src="https://user-images.githubusercontent.com/100233/78377338-c6ab0c00-75cf-11ea-9c45-2dcdd6460f6d.png"> After: <img width="369" alt="Screen Shot 2020-04-03 at 17 13 38" src="https://user-images.githubusercontent.com/100233/78377371-cf034700-75cf-11ea-89ea-aa3ff2f3988c.png"> ## Changelog [Internal] [Changed] - Rename the "simple" ScrollView example in RNTester to "ScrollSimpleView". Pull Request resolved: https://github.com/facebook/react-native/pull/28515 Test Plan: - Try to search for `scro` in RNTester. Reviewed By: fkgozali Differential Revision: D20842264 Pulled By: hramos fbshipit-source-id: 3db54a826ae774108e62690e7f154e85b541520f * Fix Fabric SSTs, so they actually run in Fabric instead of Paper, convert ServerSnapshotTestsAppImpl to functional component Summary: Update instrumentation test infra for Fabric tests. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D19961919 fbshipit-source-id: 17264b6308712dddece730effd57832817e148cf * Fixed scrollview inset when RN view is embedded in another view (#27607) Summary: I'm using RNN, which embeds RN view inside native view controllers. On iOS 13, a modal view controller is "floating" and is offset from the top of the screen. This causes the calculation of inset in `KeyboardAvoidingView` incorrect as it mixes local view controller coordinate space, with keyboard's screen coordinate space. ## Changelog [iOS] [Fixed] - Fixed `KeyboardAvoidingView` inset in embedded views (i.e modal view controllers on iOS 13) Pull Request resolved: https://github.com/facebook/react-native/pull/27607 Test Plan: 1. Tested before and after in a simple view controller (should stay the same) 2. Tested before and after in a modal view controller (should be offset before, and fixed after) 3. Repeated no. 2 with each device rotation (upsideDown, landscapeLeft, landscapeRight) Reviewed By: cpojer Differential Revision: D20812231 Pulled By: TheSavior fbshipit-source-id: fbd72739fb7152655028730e284ad26ff4a5da73 * Bump react-native-codegen to 0.0.2 Summary: Changelog: [Internal] Reviewed By: cpojer Differential Revision: D20843514 fbshipit-source-id: c611bf91d311c6ce8a7e469d267a0417b2ee58e5 * Rename ScrollViewSimpleExample Summary: Changelog: [Internal] - Rename ScrollViewSimpleExample in RNTester Reviewed By: fkgozali Differential Revision: D20846977 fbshipit-source-id: 397589cb0a17beaf37a25b91ad8efa4a2bc62358 * Remove console warnings for innerViewNode/Ref Summary: Remove these warnings until the methods in ScrollResponder have been moved into ScrollView, so that unactionable warnings aren't firing. Changelog: [General][Removed] Remove console warnings for innerViewNode/Ref in ScrollView Reviewed By: TheSavior Differential Revision: D20850624 fbshipit-source-id: ce90988e204c3cc3b93536842ec3caa12cf6994e * Make TurboModules dispatch method calls via native CallInvoker Summary: This diff: 1. Has ObjC NativeModules use the native `CallInvoker` to invoke JS -> native sync/async calls. 2. Integrates the native `CallInvoker` for each ObjC NativeModule with the bridge. This way, the bridge is informed of all JS -> native TurboModule method calls, and dispatches `onBatchComplete` appropriately. Changelog: [iOS][Fixed] Integrate ObjC TurboModules async method calls with the bridge Reviewed By: fkgozali Differential Revision: D20831545 fbshipit-source-id: da1cbb4ecef4cae85841ca7ef625ab8e380760cd * add ripple config object to Pressable (#28156) Summary: Motivation is to support ripple radius just like in TouchableNativeFeedback, plus borderless attribute. See https://github.com/facebook/react-native/pull/28009#issuecomment-589489520 In the current form this means user needs to pass an `android_ripple` prop which is an object of this shape: ``` export type RippleConfig = {| color?: ?ColorValue, borderless?: ?boolean, radius?: ?number, |}; ``` Do we want to add methods that would create such config objects - https://facebook.github.io/react-native/docs/touchablenativefeedback#methods ? ## Changelog [Android] [Added] - support borderless and custom ripple radius on Pressable Pull Request resolved: https://github.com/facebook/react-native/pull/28156 Test Plan: Tested locally in RNTester. I noticed that when some content is rendered after the touchables, the ripple effect is "cut off" by the boundaries of the next view. This is not specific to Pressable, it happens to TouchableNativeFeedback too but I just didn't notice it before in https://github.com/facebook/react-native/pull/28009. As it is an issue of its own, I didn't investigate that. ![pressable](https://user-images.githubusercontent.com/1566403/75098762-785f2200-55ba-11ea-8842-e648317610e3.gif) I changed the Touchable example slightly too (I just moved the "custom ripple radius" up to show the "cutting off" issue), so just for completeness: ![touchable](https://user-images.githubusercontent.com/1566403/75098763-81e88a00-55ba-11ea-9528-e0343d1e054b.gif) Reviewed By: yungsters Differential Revision: D20071021 Pulled By: TheSavior fbshipit-source-id: cb553030934205a52dd50a2a8c8a20da6100e23f * Make TurboModule creation thread-safe Summary: NativeModules can be created from any number of threads. In the legacy system, `ModuleHolder`, the class responsible for creating NativeModules, has built-in concurrency control to ensure that NativeModule creation is thread-safe. This diff introduces that thread-safety to the TurboModule infra. Basically, after this diff, if `n` threads race to create a TurboModule x, only the first thread will create x. All other threads will wait until x is created. Changelog: [Android][Fixed] - Make TurboModule creation thread-safe Reviewed By: mdvacca Differential Revision: D20659799 fbshipit-source-id: 2b720fe1ea49e40ae0d6dae50d422f23a6f45520 * Remove unused fields from error dialog Summary: Removed in https://github.com/facebook/react/pull/18487 Changelog: [React Core] Logging changes Reviewed By: gaearon Differential Revision: D20853086 fbshipit-source-id: 4b0002f21269f415769a2ac8305ba5750245f7d1 * Fix crash when enabling Performance Monitor on iOS 13.4 (#28512) Summary: This PR fixes a crash when opening the Performance Monitor on iOS 13.4. Detailed info: https://github.com/facebook/react-native/issues/28414 ## Changelog `[iOS] [Fixed] - Fix crash when enabling Performance Monitor on iOS 13.4` ## How This PR prevents the JavaScriptCore option from being set altogether. This ensures that the performance monitor keeps working, but on iOS 13.4 and higher, it will no longer crash trying to show the GC usage. Pull Request resolved: https://github.com/facebook/react-native/pull/28512 Test Plan: Tested on iOS 13.4 (simulator): ![image](https://user-images.githubusercontent.com/6184593/77903803-c6370c00-7283-11ea-8b71-b6b6546c82f6.png) Tested on iOS 13.1 (simulator) ![image](https://user-images.githubusercontent.com/6184593/77903499-41e48900-7283-11ea-9d14-83f67a3b7b77.png) - Verified that the `setOption` was called, but the Performance Monitor didn't show any GC usage regardless. - Identical PR https://github.com/expo/react-native/pull/21 has been shipped and tested in Expo Client 37 Fixes https://github.com/facebook/react-native/issues/28414 Reviewed By: PeteTheHeat Differential Revision: D20851131 Pulled By: TheSavior fbshipit-source-id: ff96301036e8487db59f95947bbe6841fe230e1e * Modify warning message (#28514) Summary: Modify deprecation warning message for `AccessibilityInfo.fetch` - https://reactnative.dev/docs/accessibilityinfo#isscreenreaderenabled - https://github.com/facebook/react-native/commit/523ab8333800afbfb169c6fd70ab6611fe07cc2a ## Changelog [Internal] [Changed] - Modify deprecation warning message for `AccessibilityInfo.fetch` Pull Request resolved: https://github.com/facebook/react-native/pull/28514 Test Plan: Try using `AccessibilityInfo.fetch` and check log Reviewed By: cpojer Differential Revision: D20850223 Pulled By: TheSavior fbshipit-source-id: e21bb20b7a02d9f2ed6e27e2bfecbac0aebf9e09 * Set _borderLayer.frame when border changes Summary: Changelog: [Internal] Setting `_borderLayer.frame` inside `-[RCTViewComponentView layoutSubviews]` causes unwanted animation because it is not wrapped in `CATransaction`. Moving it to `-[RCTViewComponentView updateLayoutMetrics]` which is called inside `CATransaction`. Reviewed By: shergin Differential Revision: D20836890 fbshipit-source-id: 2048a25fd2edb8109f6275c1186c0adae4b9f504 * Add API for getting sourceURL directly from ReactContext Summary: In bridgeless mode, the CatalystInstance doesn't exist, but we still need to be able to access the sourceURL in SourceCodeModule (which is needed to render the images in LogBox warnings and errors). This diff adds a new API for getting the sourceURL directly from ReactContext, instead of having to call context.getCatalystInstance().getSourceURL(), and updates SourceCodeModule to use it. Changelog: [Internal] Reviewed By: RSNara Differential Revision: D20848700 fbshipit-source-id: 3ecda81a17121178b76bbb3e9b0f27f103c1961a * imp: Remove unused `npx` reference (#28544) Summary: Recently we removed `npx` usage from `react-native-cli` flow. After checking usages in this repo I found unused reference. ## 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] [Removed] - Remove unused `npx` reference Pull Request resolved: https://github.com/facebook/react-native/pull/28544 Test Plan: Tests pass Reviewed By: cpojer Differential Revision: D20873090 Pulled By: hramos fbshipit-source-id: 12e05e9635a83f19439024766817e4599320af98 * Add debug logs to track down T62192299 exception source Summary: Add debug logs to track down T62192299 exception source Changelog: [Internal] Reviewed By: RSNara Differential Revision: D20878063 fbshipit-source-id: 94acd56c45d4b529a695d1b4d2bfd10d8f725e63 * Back out "Fixed scrollview inset when RN view is embedded in another view" Summary: Original commit changeset: fbd72739fb71 Changelog: Back out "[react-native][PR] Fixed scrollview inset when RN view is embedded in another view" Reviewed By: TheSavior Differential Revision: D20878607 fbshipit-source-id: 0d77b9fb08c637f7894c399a219a242e472b0700 * Fail silently in AppStateModule.sendEvent if CatalystInstance is not available Summary: According to our logs, 80% of these warnings are coming from AppStateModule. It's not particularly interesting or surprising that the CatalystInstance would be torn down when there's some app event, so let's stop taking up DB space with a useless message. Reviewed By: ejanzer, mdvacca Differential Revision: D20879426 fbshipit-source-id: b1182461aed4a66d82cb34bbd4b12782af6ed7b3 * Move DebugEnvironment helper to open source Summary: This is an internal only module that we use to detect whether we are in async debugging mode. Changelog: [Internal] Reviewed By: yungsters Differential Revision: D20879780 fbshipit-source-id: 5915f4e1c54a3fda0cf607c77f463120264fdbc4 * Fix Appearance module when using Chrome Debugger Summary: The appearance module uses sync native module methods which doesn't work with the chrome debugger. This broke in 0.62: https://github.com/facebook/react-native/issues/26705 This fix makes the appearance module return 'light' when using the chrome debugger. Changelog: [Fixed] Appearance `getColorScheme` no longer breaks the debugger Reviewed By: yungsters Differential Revision: D20879779 fbshipit-source-id: ad49c66226096433bc9f270e004ad4a6f54fa8c2 * Extend Android ImageViewManager to support analyticsTag prop Summary: This diff extends the Android Image View manager to support the new analyticsTag prop. this prop is going to be used to track performance for images in android changelog: [Android][Added] Add analyticsTag prop into ImageView component Reviewed By: JoshuaGross Differential Revision: D20880602 fbshipit-source-id: e302e8fa83706e6517b228d44a3094a1686830f7 * Extend Image.android to support analyticsTag prop Summary: Quick diff to extend Image.android component to support analytics tag prop changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D20880601 fbshipit-source-id: 99bc11f36ce46953c00480f7c8d628cf6c0a9263 * Create ImageContext object to allow udpating the analyticsTag prop for RN sections Summary: As part of this diff I create the new ImageContext object that will be used to allow the update of the analyticsTag prop for components that contain multiple images in their view hierarchy changelog: [JS][Added] Add ImageContext object, this object can be used to update the Imageview's analyticsTag prop on RN components that contain multiple images in their view hierarchy Reviewed By: JoshuaGross Differential Revision: D20880603 fbshipit-source-id: f2094bfd3ab1c867cf7c107e678a098aab7e94a8 * Ez cleanup in ImageProps Summary: Ez cleanup in ImageProps, this import is not being used anymore changelog: [internal] internal change Reviewed By: JoshuaGross Differential Revision: D20880600 fbshipit-source-id: 7d903b5a6e16c37e61dec661b6bd1f9a6b442cc3 * Exclude all FlipperKit transitive dependencies from iOS Release builds (#28504) Summary: The `:configuration` option from `pod` only affects the specified pod and not its dependencies [1]. Therefore in order to avoid all transitive dependencies being linked in the resulting Release IPA we need to list them in the `Podfile`. Note that this will still build Flipper's pods when doing a Release, but it won't link it in the resulting IPA. [1] https://guides.cocoapods.org/syntax/podfile.html#pod Fixes https://github.com/react-native-community/upgrade-support/issues/28 Related https://github.com/CocoaPods/CocoaPods/issues/9658 ## Changelog * [iOS] [Fixed] - Exclude Flipper from iOS Release builds Pull Request resolved: https://github.com/facebook/react-native/pull/28504 Test Plan: Create a new React Native 0.62 project, run `pod install`, then diff: ``` ProjectName/ios/Pods/Target Support Files/Pods-ProjectName/Pods-ProjectName.debug.xcconfig` ``` and ``` ProjectName/ios/Pods/Target Support Files/Pods-ProjectName/Pods-ProjectName.relaese.xcconfig ``` ![image](https://user-images.githubusercontent.com/855995/78337679-a3fa0280-7591-11ea-8142-6f82cbc6be58.png) Reviewed By: passy Differential Revision: D20894406 Pulled By: priteshrnandgaonkar fbshipit-source-id: 680780f0f5a85fd8423b85a271a499bd12f06d00 * Fix crash in FabricUIManager.onMeasure Summary: Changelog: [Internal] The cause of crash was `NullPointerException`, which happened because of `mReactContextForRootTag.get(rootTag)` returning `null`. This is solved by checking whether it returns `null` before passing it to `I18nUtil`. Reviewed By: mdvacca Differential Revision: D20890623 fbshipit-source-id: c884c6838b83b944a5438375a4c060c1f5b1dc6e * Fix flow types of ImageContext Summary: ez diff to Fix flow types of ImageContext changelog: [internal] internal change to update flow types of ImageContext Reviewed By: TheSavior Differential Revision: D20883647 fbshipit-source-id: 6dba83ab431e56a71f96c39005ebcccf39a7da9a * Avoid passing analyticsTag prop to native if this is set to null Summary: This diff avoids passing the analyticsTag prop to native if this is set to null changelog: [internal] internal optimization Reviewed By: TheSavior Differential Revision: D20904498 fbshipit-source-id: f1ea1e5aa3199ef073668df86ca7cf6e20f70c5b * Rename analyticsTag -> internal_analyticsTag in ImageView component Summary: This diff renames the analyticsTag prop for the intenral_analyticsTag in ImageView component changelog: [internal] Creation of internal_analyticTag prop in ImageView, for now this prop is meant to be used internally. Reviewed By: TheSavior Differential Revision: D20904497 fbshipit-source-id: 2a28f746772ee0f9d657ec71549020c1f3e9d674 * Make Vibration.vibrate compatible with TurboModules (#27951) Summary: This PR fixes a compatibility issue with the Vibration module and TurboModules. The TurboModules spec doesn't allow nullable arguments of type Number, causing the following problem: ![IMG_3758](https://user-images.githubusercontent.com/1247834/73803879-10be6f80-4790-11ea-92d4-a008f0007681.PNG) ## Changelog [iOS] [Fixed] - Make Vibration library compatible with TurboModules. Pull Request resolved: https://github.com/facebook/react-native/pull/27951 Test Plan: Just submitted a PR to my own app to fix the issue [here](https://github.com/rainbow-me/rainbow/pull/340) The problem should be reproducible on RNTester due to this line: https://github.com/facebook/react-native/blob/91f139b94118fe8db29728ea8ad855fc4a13f743/RNTester/js/examples/Vibration/VibrationExample.js#L66 and should be working on this branch. Reviewed By: TheSavior Differential Revision: D19761064 Pulled By: hramos fbshipit-source-id: 84f6b62a2734cc09d450e906b5866d4e9ce61124 * Fix Cocoapods builds Summary: ## Problem For some reason, D20831545 broke the `use_frameworks!` build of RNTester. ## Building RNTester ``` pushd ~/fbsource/xplat/js/react-native-github/RNTester && USE_FRAMEWORKS=1 pod install && open RNTesterPods.xcworkspace && popd; ``` ## Error I built RNTester locally, and the error was this: ``` Undefined symbols for architecture x86_64: "facebook::jsi::HostObject::set(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&, facebook::jsi::Value const&)", referenced from: vtable for facebook::react::ObjCTurboModule in RCTImageEditingManager.o vtable for facebook::react::ObjCTurboModule in RCTImageLoader.o vtable for facebook::react::ObjCTurboModule in RCTImageStoreManager.o "facebook::jsi::HostObject::getPropertyNames(facebook::jsi::Runtime&)", referenced from: vtable for facebook::react::ObjCTurboModule in RCTImageEditingManager.o vtable for facebook::react::ObjCTurboModule in RCTImageLoader.o vtable for facebook::react::ObjCTurboModule in RCTImageStoreManager.o ld: symbol(s) not found for architecture x86_64 ``` ## Fix It looked like libraries that depend on "ReactCommon/turbomodule/core" weren't linking to JSI correctly. So, I modified all such Podspecs to also depend on "React-jsi": ``` arc rfr ' s.dependency "ReactCommon/turbomodule/core", version' ' s.dependency "ReactCommon/turbomodule/core", version\n s.dependency "React-jsi", version' ``` This seemed to do the trick. In buck, we'd fix this problem using exported_dependencies. I skimmed through cocoapods, and couldn't find such a configuration option there. So, I guess this will have to do? Changelog: [iOS][Fixed] - Fix Cocoapods builds of RNTester Reviewed By: fkgozali, hramos Differential Revision: D20905465 fbshipit-source-id: 60218c8274ec165752a428f2a7a9a546607c8fec * Add minimumSize to RCTRootView & RCTRootShadowView Summary: This adds a `minimumSize` property to RCTRootView, and forwards any changes to it's shadow view. This **does not** change any default behaviour, as the default minimum size is `CGSizeZero` before & after this diff. Changelog: [iOS][Internal] Add minimumSize to RCTRootView & RCTRootShadowView Reviewed By: RSNara Differential Revision: D20905456 fbshipit-source-id: a03f880e782891f60ef86b9c898965e05a5e796e * Make RCTNativeAnimatedModule into a TurboModule Summary: D20831545 integrated TurboModules with the bridge's `onBatchComplete` event. This fixed the RCTNativeAnimatedModule jank, so I'm re-converting RCTNativeAnimatedModule into a TurboModule. Changelog: [iOS][Fixed] - Make RCTNativeAnimatedModule TM-compatible Reviewed By: PeteTheHeat Differential Revision: D20850744 fbshipit-source-id: bb85a1bb27963e7d39bf149d0a3d7b71c88175da * upgrade to flow 0.122.0 Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D20919782 fbshipit-source-id: 3d5dc54ea4daafb8a1d96cad6c35a2dab4c24097 * Switch order of onSelectionChange and onChange events send from native Summary: Changelog: [Internal] UIKit uses either `UITextField` or `UITextView` as its UIKit element for `<TextInput>`. `UITextField` is for single line entry, `UITextView` is for multiline entry. There is a problem with order of events when user types a character. In `UITextField` (single line text entry), typing a character first triggers `onChange` event and then `onSelectionChange`. JavaScript depends on this order of events because it uses `mostRecentEventCount` from this even to communicate to native that it is in sync with changes in native. In `UITextView` (multi line text entry), typing a character first triggers `onSelectionChange` and then `onChange`. As JS depends on the correct order of events, this can cause issues. An example would be a TextInput which changes contents based as a result of `onSelectionChange`. Those changes would be ignored as native will throw them away because JavaScript doesn't have the newest version. Reviewed By: JoshuaGross Differential Revision: D20836195 fbshipit-source-id: fbae3b6c0d388fc059ca2541ae980073b8e5f6c7 * Maintain selection and cursor location when setting string on TextInput Summary: Changelog: [Internal] Calling `_backedTextInputView.attributedText = attributedString` causes cursor to be moved to the end of text input. This applies to both, `UITextField` and `UITextView`. This is not desired as when JS sets a new text, we don't want the cursor to be moved to the end of text input. JS has the option to use view commands if it wishes to move cursor somewhere. Reviewed By: JoshuaGross Differential Revision: D20836201 fbshipit-source-id: 9234e54cfbc5fc206f723626988e505275788aae * Implement event count for TextInput Summary: Changelog: [Internal] Implementation of event count for Fabric's Text input. Reviewed By: JoshuaGross Differential Revision: D20800185 fbshipit-source-id: 988692cb2fc786649821cccb06e629b40b9b0479 * Migrate setNativeProps to commands in iOS text input Summary: Changelog: Move from setNativeProps to ViewCommands. Reviewed By: JoshuaGross Differential Revision: D20843018 fbshipit-source-id: 9be9d2bbee01f2e15279e3c3ae785c1a5b163765 * Update default Podfile to not depend on a path (#28572) Summary: Recently, a default Podfile has been modified to not contain all the React Native pods, but use a helper method `use_react_native!`. While this is great, it assumes a hardcoded path of `../node_modules/react-native` to be always the correct location of the React Native. https://github.com/facebook/react-native/blob/d4d8887b5018782eeb3f26efa85125e6bbff73e4/scripts/autolink-ios.rb#L7-L9 Unfortunately, due to the way Ruby works, this completely hides the path away from the users. Before, they could have seen the wrong path explicitly in a Podfile and knew to update it to resolve path-related issues. With the current version in `master`, I can see a lot of issues where developers wonder how to resolve the path issues and how to pass the path itself. https://github.com/facebook/react-native/blob/4118d798265341061105f3a53550db83c66a71cb/template/ios/Podfile#L5-L10 This PR uses React Native CLI configuration (that is already used to link 3rd party dependencies) to explicitly define the correct path to the React Native. As a result, we don't have to change the paths here whether we're running monorepo or not. ## Changelog [IOS] [INTERNAL] - Always provide an explicit path to React Native Pull Request resolved: https://github.com/facebook/react-native/pull/28572 Differential Revision: D20945194 Pulled By: TheSavior fbshipit-source-id: 010f9754f2ed78ef62fd52f4d201f296f5af6d27 * chore: update CLI * fix: do not throw on missing `cliPath`, use the default value (#28625) Summary: The `cliPath` has always been optional value and in fact, even had its default value hardcoded in the React gradle file. In this PR, I am just taking use of it and remove throwing an error, which is going to be a really annoying breaking change. ## Changelog [ANDROID] [INTERNAL] - Don't require `cliPath` Pull Request resolved: https://github.com/facebook/react-native/pull/28625 Test Plan: Run Android project, everything works. Provide custom `cliPath`, it gets respected Reviewed By: cpojer Differential Revision: D21044222 Pulled By: TheSavior fbshipit-source-id: 8029f988d92abb9f64f30e05932c0d407d0c997e * chore: remove Kotlin version from the default template * (eslint-config) update community eslint plugin in eslint config (#28642) Summary: Updating the community eslint-plugin used in the eslint-config to the latest version. expecting new eslint-config version to be released with this change so that it can be included in new project template for 0.63 https://github.com/react-native-community/releases/issues/186 ## 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] - Update community eslint plugin in the eslint config Pull Request resolved: https://github.com/facebook/react-native/pull/28642 Test Plan: yarn lint passes Differential Revision: D21048976 Pulled By: cpojer fbshipit-source-id: 2c3ec0ef450cf357d8c88db7873f4ca1154b2034 * [0.63.0-rc.0] Bump version numbers * Upgrade Hermes dependency to 0.5.0 Summary: Use the latest published release of hermes-engine. Update RN to invoke `hermesc` instead of `hermes`. Changelog: [Android] [Changed] - Upgraded to Hermes 0.5.0 allow-large-files Reviewed By: mhorowitz Differential Revision: D20998564 fbshipit-source-id: 4824e273bcb044029a5a7e9379f168d3da47da50 * Remove the post install step (#28651) Summary: Removes the post install step for Flipper, as the latest version of YogaKit is compatible with swift 5. cc alloy ## 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 --> [Flipper] [Template] - Remove the post install step for Flipper Pull Request resolved: https://github.com/facebook/react-native/pull/28651 Test Plan: Tested a newly created RN app without post install step and it built successfully. Reviewed By: passy Differential Revision: D21064653 Pulled By: priteshrnandgaonkar fbshipit-source-id: da56d0754d918e30a0ebe480c77590f0139d48ac * Allow iOS PlatformColor strings to be ObjC or Swift UIColor selectors (#28703) Summary: Per discussion in https://github.com/react-native-community/releases/issues/186 the iOS `PlatformColor()` function is documented to use the semantic color names provided by the system. The referenced HIG documentation itself links to the `UIColor` documentation for semantic colors names. However, these names differ depending on if you are viewing the new Swift API docs or the Objective C docs. The current Objective C implementation in react-native assumes Objective C UIColor selector names that are suffixed 'Color'. But in Swift, Apple provides a Swift Extension on UIColor that makes aliases without the the 'Color' suffix and then makes the original selectors invalid presumably via `NS_UNAVAILABLE_SWIFT`. Since both selector names are valid depending on if you are using Objective C or Swift, let's make both forms be legal for `PlatformColor()`. In `RCTConvert.m` there is a dictionary of legal selector names. The code already supports the ability to have names be aliases of other selectors via a RCTSelector metadata key. The change adds code to the initialization of the map: it iterates over the keys in the map, which are all ObjC style UIColor selectors, and creates aliases by duplicating the entries, creating key names by stripping off the ObjC "Color" suffix, adds the RCTSelector key referring to the original and then appends these new Swift aliases to the map. ## Changelog [iOS] [Changed] - Allow iOS PlatformColor strings to be ObjC or Swift UIColor selectors Pull Request resolved: https://github.com/facebook/react-native/pull/28703 Test Plan: The PlatformColorExample.js is updated to use the new, shorter Swift selector names. There are still other examples in the same file and in unit tests that exercise the ObjC selector names. <img width="492" alt="PlatformColor" src="https://user-images.githubusercontent.com/30053638/79809089-89ab7d00-8324-11ea-8a9d-120b92edeedf.png"> Reviewed By: shergin Differential Revision: D21147404 Pulled By: TheSavior fbshipit-source-id: 0273ec855e426b3a7ba97a87645859e05bcd4126 * Fix folly::dynamic crash when attaching a debugger to Hermes Summary: folly_futures was compiled with and exported -DFOLLY_MOBILE=1, while folly_json did not. This flag disables fancy F14 data structures for folly::dynamic in favor of a simple std::unordered_map. This caused inlined/templated code from modules depending on folly_futures to disagree with the implementations in folly_json, leading to a crash. The only such libraries were libhermes-inspector and (transitively) libhermes-executor-debug, and these only use folly::dynamic for CDP serialization, which is why the problem was not more apparent. Changelog: [Internal] Fix crash when attaching a Hermes debugger Reviewed By: mhorowitz Differential Revision: D21193307 fbshipit-source-id: 2b795bb6f4f7f991e2adaacec62d62616117322b * Update react.gradle (#28776) Summary: Running `./gradlew assembleRelease` fails as the path to the CLI contains a new line at the end. We don't run this command in `debug` mode, hence it passed the testing. My bad. Fixed, checked in both `debug` with `bundleInDebug: true` and `release`. Fixes https://github.com/facebook/react-native/issues/28700 ## Changelog [INTERNAL] [ANDROID] - Fix `React.gradle` to build Android apps in production Pull Request resolved: https://github.com/facebook/react-native/pull/28776 Test Plan: Running `./gradlew assembleRelease` works Reviewed By: hramos Differential Revision: D21287789 Pulled By: TheSavior fbshipit-source-id: dc3ec8eef7a919b072b562d2bd455e2f704bc083 * Revert D21064653: Remove the post install step Differential Revision: D21064653 Original commit changeset: da56d0754d91 fbshipit-source-id: 1086cfdeca9aa3830370ea115ba7b5f05d3fb124 * Bump @react-native-community/eslint-config in new app template Summary: Changelog: [Changed][General] Update react-native-community/eslint-config to 1.1.0, adding the new color rule Reviewed By: rickhanlonii Differential Revision: D21342153 fbshipit-source-id: ac1367353d4d3e69b6df29dc16f9fcb60cde3519 * [0.63.0-rc.1] Bump version numbers * Upgrade Flipper to 0.37.0 (#28545) Summary: Bump flipper to 0.37 for both iOS and Android [Android] [Changed] - Upgrade Flipper to 0.37.0 [iOS] [Changed] - Upgrade Flipper to 0.37.0 Pull Request resolved: https://github.com/facebook/react-native/pull/28545 Test Plan: RNTester build pass Reviewed By: rickhanlonii Differential Revision: D20930069 Pulled By: hramos fbshipit-source-id: a7cb719da3e51e6a42d27d5e64bc664398d0d3c5 * Enable with CocoaPods `:configuration` (#28796) Summary: ~~⚠️ Depends on https://github.com/facebook/flipper/pull/1086 and a new Flipper release.~~ Fixes https://github.com/facebook/react-native/commit/17f025bc26da13da795845a3f7daee65563420c0#commitcomment-38831234 Currently user’s are being told to add a definition of the `FB_SONARKIT_ENABLED` macro and examples, including those in stock React Native templates, set this for the user by making use of a `post_install` hook in the user’s `Podfile`. This leads to confusion, fragile code [when a user’s project dir structure deviates from vanilla], and is ultimately not necessary as CocoaPods already has dedicated mechanisms to: * specify build settings (through the `xcconfig` property); * and selectively include certain pods only in certain build configurations (e.g. debug). ## 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] [Changed] - Entirely control Flipper being enabled through inclusion in Podfile and optionally limiting to certain build configurations using the `:configuration` directive. Pull Request resolved: https://github.com/facebook/react-native/pull/28796 Test Plan: Tested using the changes of https://github.com/facebook/flipper/pull/1086 in a new app that uses RN `master`. Reviewed By: priteshrnandgaonkar Differential Revision: D21449754 Pulled By: passy fbshipit-source-id: 9ff7c7f4ffc32b364b1edd82b94e0b80c3997625 * Pressable: Rename pressRectOffset to pressRetentionOffset to be consistent with other touchables Summary: Text and the other Touchables have this prop called pressRetentionOffset. Pressable should be consistent with that. Changelog: [Breaking][General]: Pressable: Rename pressRectOffset to pressRetentionOffset to be consistent with other touchables Reviewed By: yungsters Differential Revision: D21552255 fbshipit-source-id: 31e64bad9e48ac98e4934dd2f4c0a7f526de5cb6 * iOS: Fix Animated image crash when CADisplayLink target in RCTWeakProxy is nil Summary: When self is nil, this may crash in RCTUIImageViewAnimated.m. ``` _displayLink = [CADisplayLink displayLinkWithTarget:[RCTWeakProxy weakProxyWithTarget:self] selector:selector(displayDidRefresh:)]; ``` Replace `RCTWeakProxy` with a concrete class `RCTDisplayWeakRefreshable` that has the displayDidRefresh method, that calls the displayDidRefresh method in its weak target. https://github.com/facebook/react-native/pull/28070#issuecomment-619295254 Changelog: [iOS] [Fixed] - Fix Animated image crash when CADisplayLink target in RCTWeakProxy is nil Reviewed By: shergin Differential Revision: D21419385 fbshipit-source-id: da7c3c38f81ea54f633da7f59359e07680ea2faf * Pressable: Add Support for Inspector Overlay Summary: Adds support for the debug overlay (enabled via the Inspector) that the legacy touchable components supported. Changelog: [General][Added] - Added Inspector overlay support for Pressable Reviewed By: TheSavior Differential Revision: D21614412 fbshipit-source-id: b884e04f8dba1bfd35e61de25d33d6d47bc34b03 * Changed iOS LaunchScreen from xib to storyboard (#28239) Summary: > Starting April 30, 2020, all apps submitted to the App Store must use an Xcode storyboard to provide the app’s launch screen and all iPhone apps must support all iPhone screens. Updated iOS Launch screen as per [App Store policy change](https://developer.apple.com/news/?id=03042020b). Community discussion: https://github.com/react-native-community/discussions-and-proposals/issues/209 ## Changelog Changed iOS Launch Screen from a `xib` to `storyboard`. The `LaunchScreen.xib` file has been replaced with `LaunchScreen.storyboard`. Xcode automatically picks up the new Launch Screen no additional change is required. [iOS] [Deleted] - Deleted LaunchScreen.xib [iOS] [Added] - Added LaunchScreen.storyboard Pull Request resolved: https://github.com/facebook/react-native/pull/28239 Test Plan: Build the Xcode project under `template/iOS` and verify that the new launch screen is identical to the previous one. Reviewed By: cpojer Differential Revision: D20408892 Pulled By: hramos fbshipit-source-id: 9c38df58d1304088a23f3d73e0fbd87675804f1a * Fix debugging on android for 0.63 (#29204) Summary: Currently on react native 0.63-rc.0 and 0.63-rc.1 enabling debugging throws an exception. It looks like something may have been missed in unregistering JSDevSupport in this commit c20963e ![crash](https://user-images.githubusercontent.com/14797029/85500252-2acae400-b5b1-11ea-938a-674b55e649b2.gif) This should fix https://github.com/facebook/react-native/issues/28746 and https://github.com/facebook/react-native/issues/29136 ## Changelog [Android] [Fixed] - Fix crash when enabling debug Pull Request resolved: https://github.com/facebook/react-native/pull/29204 Test Plan: To recreate the bug: npx react-native init RN063 --version 0.63.0-rc.1 react-native start react-native run-android Enable debug mode from react native dev menu After this commit, the crash no longer occurs ![non crash](https://user-images.githubusercontent.com/14797029/85500241-269ec680-b5b1-11ea-8cfe-85bfda4dd222.gif) Reviewed By: TheSavior Differential Revision: D22395406 Pulled By: RSNara fbshipit-source-id: 046df77ae1c1de96870fb46f409d59e7d6a68c0d * [0.63.0] Bump version numbers * Add ProGuard rule for hermes (#28571) Summary: This adds a ProGuard for `hermes` rule so it does not have to be added by users manually. https://github.com/facebook/react-native/issues/28270 ## 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 --> [Android] [Added] - ProGuard rule for hermes Pull Request resolved: https://github.com/facebook/react-native/pull/28571 Test Plan: 1. Create a project with/without hermes. 2. Enable proguard. Reviewed By: cpojer Differential Revision: D20947095 Pulled By: hramos fbshipit-source-id: 79b166ad2dd060f20041d9f5cfe2f794c754843d * Fix rounded border drawing when border-radius is smaller than border-width (#28358) Summary: This PR fixes the drawing of the border rounded edges when the border-radius is small than the border-width. The current implementation capped the possible border-radius making it impossible to set smaller border-radii when using thicker borders. After inspection it was found that the rounded-rect calculation is incorrect. ## Changelog `[Android] [Fixed] - Fix rounded border-drawing when border-radius is smaller than border-width` Pull Request resolved: https://github.com/facebook/react-native/pull/28358 Test Plan: **Faulty situation:** As you can see, when the border-radius becomes very low, the border is stuck at a minimum value. Only after setting the border-radius fully to 0 is it again rendered correctly. ![ezgif com-video-to-gif (2)](https://user-images.githubusercontent.com/6184593/77183540-c3435b00-6ace-11ea-950d-29a0ea1757bd.gif) **After the fix:** ![ezgif com-video-to-gif (3)](https://user-images.githubusercontent.com/6184593/77183619-e837ce00-6ace-11ea-93a5-910127d352b7.gif) Differential Revision: D21124739 Pulled By: shergin fbshipit-source-id: cefd1776b77b5b9fb335e95fd7fdd7f345579dc4 * Fix border-stroke drawing after resetting border-radius (#28356) Summary: This PR fixes incorrect drawing of the View borders on Android, after changing the border-radius back to 0 *(and when no background-color is defined)*. This happens because the `drawRoundedBackgroundWithBorders` function in ReactViewBackgroundDrawable changes the style on the Paint object to `STROKE`. This style is however never reverted back to `FILL`. This change ensures that the Paint style is set to `FILL` for the full execution of the `drawRectangularBackgroundWithBorders` function. ## Changelog `[Android] [Fixed] - Fix border-drawing when changing border-radius back to 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28356 Test Plan: **Faulty situation:** ![ezgif com-video-to-gif](https://user-images.githubusercontent.com/6184593/77153163-9759b280-6a99-11ea-82bb-33a1e0a4934c.gif) **After the fix:** ![ezgif com-video-to-gif (1)](https://user-images.githubusercontent.com/6184593/77153825-c91f4900-6a9a-11ea-8e0c-a4280b9e72b8.gif) Differential Revision: D21124741 Pulled By: shergin fbshipit-source-id: 2044f8e8ad59a58df42b64d7ee8c4ad1d3b562f1 * Fixes TextInput shaking when typing Chinese (#28805) Summary: Fixes https://github.com/facebook/react-native/issues/28488. ## Changelog [iOS] [Fixed] - Fixes TextInput shaking when typing Chinese Pull Request resolved: https://github.com/facebook/react-native/pull/28805 Test Plan: Demo see https://github.com/facebook/react-native/issues/28488. Differential Revision: D21376803 Pulled By: shergin fbshipit-source-id: b1fe6cc5f67d42ef98a6c12b8ab9990feac0e2a7 * Set black as default text color for <TextInput/> on iOS (#28708) Summary: This is a follow-up pull request to https://github.com/facebook/react-native/issues/28280 (reviewed by shergin). This pull request tried to solve the problem of the default color in a TextInput in dark mode on iOS being white instead of black. I got suggested to solve the problem not on the level of RCTTextAttributes, but on the level of RCTUITextField. Setting `self.textColor = [UIColor black];` in the constructor did not work, because it gets overwritten by nil in `RCTBaseTextInputView.m`. There I implemented the logic that if NSForegroundColorAttributeName color is nil then the color is being set to black. I think the `defaultTextAttributes` property confuses here, because it ends up being the effective text attributes, e.g. if I unconditionally set the default text color to black, it cannot be changed in React Native anymore. So I put the nil check in. ## Changelog [iOS] [Fixed] - TextInput color has the same default (#000) on iOS whether in light or dark mode Pull Request resolved: https://github.com/facebook/react-native/pull/28708 Test Plan: I have manually tested the following: - The default text color in light mode is black - The default text color in dark mode is black - The color can be changed using the `style.color` attribute - Setting the opacity to 0.5 results in the desired behavior, the whole TextInput becoming half the opacity. – Setting the `style.color` to rgba(0, 0, 0, 0.5) works as intended, creating a half-opaque text color. Differential Revision: D21186579 Pulled By: shergin fbshipit-source-id: ea6405ac6a0243c96677335169b214a2bb9ccc29 * Enable array buffers in JSCRuntime.cpp (#28961) Summary: The JavaScriptCore implementation of JSI [does not currently support array buffers](https://github.com/facebook/react-native/blob/master/ReactCommon/jsi/JSCRuntime.cpp#L925-L943). The comments in the code suggest the JSC version used by React Native does not work with array buffers, but this seems to be out of date since the current version of JSC used by React Native does indeed support array buffers. This change just enables array buffers in JSCRuntime.cpp. NOTE: See https://github.com/react-native-community/discussions-and-proposals/issues/91#issuecomment-632371219 for more background on this change. ## Changelog [General] [Added] - Support for array buffers in the JavaScriptCore implementation of JSI Pull Request resolved: https://github.com/facebook/react-native/pull/28961 Test Plan: To test these changes, I just made some temporary changes to RNTester to use JSI to inject a test function into the JS runtime that reads from and writes to an array buffer, and call that function from the JS of the RNTester app (see https://github.com/ryantrem/react-native/commit/28152ce3f4ae0fa906557415d106399b3f072118). For the JS side of this, specifically look at https://github.com/ryantrem/react-native/blob/28152ce3f4ae0fa906557415d106399b3f072118/RNTester/js/RNTesterApp.android.js#L13-L18 For the native side of this, specifically look at https://github.com/ryantrem/react-native/blob/28152ce3f4ae0fa906557415d106399b3f072118/RNTester/android/app/src/main/cpp/JSITest.cpp#L22-L38 Reviewed By: shergin Differential Revision: D21717995 Pulled By: tmikov fbshipit-source-id: 5788479bb33c24d01aa80fa7f509e0ff9dcefea6 * Fix font variant crash on Android < 4.4 (#29176) Summary: In RN 0.62 support for `fontVariant` was added on Android. Using that prop crashes the app on Android below KitKat (4.3 and below) To reproduce just add any Text with the `fontVariant` styling prop in the app: ```js <Text style={{fontVariant: ['tabular-nums']}}>This will crash</Text> ``` It will crash any device running Android below KitKat with the error: ![image](https://user-images.githubusercontent.com/4534323/85073452-18206b80-b1bb-11ea-8d7e-96f27fa1a320.png) This is caused by `java.utils.Objects` only being available on Android 4.4+ ## Changelog [Android] [Fixed] - Fix font variant crash on Android < 4.4 Pull Request resolved: https://github.com/facebook/react-native/pull/29176 Test Plan: [TextUtils.equals](https://developer.android.com/reference/android/text/TextUtils#equals) was added as soon as API level 1, so no compatibility issue here. Tested on Emulator running Android 4.1, no crash anymore. I've searched for other occurences of `java.utils.Objects` in the project, and this was the only one, so no need to remove other occurences ✅ Reviewed By: JoshuaGross Differential Revision: D22337316 Pulled By: mdvacca fbshipit-source-id: 5507b21b237a725d596d47b5c01e269895b16d4a * Fix LogBox.ignoreAllLogs used with no argument (#29310) Summary: When you call `LogBox.ignoreAllLogs()` it should ignore logs. This fixes a bug that made this equivalent to `LogBox.ignoreAllLogs(false)` ## Changelog [General] [Fixed] - LogBox.ignoreAllLogs() should ignore logs Pull Request resolved: https://github.com/facebook/react-native/pull/29310 Test Plan: Added tests Reviewed By: TheSavior Differential Revision: D22448436 Pulled By: rickhanlonii fbshipit-source-id: 6ba12b9d9c1f29cf3ac503946ac5ca0097425a7a * Pressable: Minimum Press Duration Summary: When a `Pressable` has a configured (or the default) `delayPressIn` and no (or the default) `delayPressOut`, tapping very quickly can lead to intantaneous invocation of `onPressIn` and `onPressOut`. The end result is that users may never experience any intended visual press feedback. This changes `Pressable` to accept (and be preconfigured with a default) **minimum press duration**. The minimum press duration ensures that even if the press is released before `delayPressIn` has elapsed, `onPressOut` will still wait the remaining time up to `minPressDuration` before firing. Note that setting a non-zero `delayPressOut` is insufficient because if a user holds down on a `Pressable` for longer than `delayPressIn`, we still want `onPressOut` to fire immediately when the press is released. Changelog: [General][Changed] - Added `minPressDuration` to `Pressable`. Reviewed By: TheSavior Differential Revision: D21614708 fbshipit-source-id: 502f3d8ad6a40e7762435b6df16809c8798dd92c * chore: bring back script to org shape * [0.63.1] Bump version numbers * Exclude okhttp from flipper dependency (#29260) Summary: This fixes https://github.com/facebook/react-native/issues/28481. As explained in [this comment](https://github.com/facebook/react-native/issues/28481#issuecomment-645546195), the flipper network plugin pulls a more recent version of okhttp (3.14), but only versions of okhttp up to 3.12 works on Android API 21 and less. This prevented being able to run the app in debug mode, it was still working fine in release mode. ## 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 --> [Android] [Fixed] - Fix unable to run in debug mode on Android API < 21 Pull Request resolved: https://github.com/facebook/react-native/pull/29260 Test Plan: Using `yarn react-native run-android` the app would instantly crash with this error in `adb logcat`: ``` E/AndroidRuntime( 5079): java.lang.RuntimeException: Unable to create application com.awesometsproject.MainApplication: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created E/AndroidRuntime( 5079): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4154) E/AndroidRuntime( 5079): at android.app.ActivityThread.access$1300(ActivityThread.java:130) E/AndroidRuntime( 5079): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1255) E/AndroidRuntime( 5079): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 5079): at android.os.Looper.loop(Looper.java:137) E/AndroidRuntime( 5079): at android.app.ActivityThread.main(ActivityThread.java:4745) E/AndroidRuntime( 5079): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 5079): at java.lang.reflect.Method.invoke(Method.java:511) E/AndroidRuntime( 5079): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) E/AndroidRuntime( 5079): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) E/AndroidRuntime( 5079): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 5079): Caused by: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:90) E/AndroidRuntime( 5079): at com.facebook.react.ReactInstanceManager.<init>(ReactInstanceManager.java:238) E/AndroidRuntime( 5079): at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:281) E/AndroidRuntime( 5079): at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:87) E/AndroidRuntime( 5079): at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:39) E/AndroidRuntime( 5079): at com.awesometsproject.MainApplication.onCreate(MainApplication.java:47) E/AndroidRuntime( 5079): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:999) E/AndroidRuntime( 5079): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4151) E/AndroidRuntime( 5079): ... 10 more E/AndroidRuntime( 5079): Caused by: java.lang.reflect.InvocationTargetException E/AndroidRuntime( 5079): at java.lang.reflect.Constructor.constructNative(Native Method) E/AndroidRuntime( 5079): at java.lang.reflect.Constructor.newInstance(Constructor.java:417) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:80) E/AndroidRuntime( 5079): ... 17 more E/AndroidRuntime( 5079): Caused by: java.lang.NoClassDefFoundError: java.util.Objects E/AndroidRuntime( 5079): at okhttp3.CertificatePinner.withCertificateChainCleaner(CertificatePinner.java:231) E/AndroidRuntime( 5079): at okhttp3.OkHttpClient.<init>(OkHttpClient.java:238) E/AndroidRuntime( 5079): at okhttp3.OkHttpClient$Builder.build(OkHttpClient.java:1015) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevServerHelper.<init>(DevServerHelper.java:132) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerImpl.<init>(DevSupportManagerImpl.java:183) E/AndroidRuntime( 5079): ... 20 more W/ActivityManager( 1456): Force finishing activity com.awesometsproject/.MainActivity ``` With this fix, the app launch successfully in debug mode, without having to remove flipper altogether from our config. Reviewed By: passy Differential Revision: D22521109 Pulled By: mdvacca fbshipit-source-id: 3c0263642438bd7c0d09b045e15a933bd8a26734 * Send key when onKeyPress event is fired from TextInput Summary: Changelog: [Internal] In `onKeyPress` event, we were not returning `key` property. This diff adds `key` property to `onKeyPress` event and removes other, redundant properties from `onKeyPress` event. The implementation has been translated from Paper. Reviewed By: shergin Differential Revision: D21250411 fbshipit-source-id: f1e31381667acb9dec02d0b33883df8f8f5b2a4b * Calling Paper TextInput setTextAndSelection view command now dirties layout Summary: Changelog: [Internal] Previously `setTextAndSelection` was not dirtying layout. This would cause an issue where `setTextAndSelection` causes layout change. For example calling setTextAndSelection with empty string on a multiline auto expanding text input. I changed one example in TextInputSharedExamples.js, "Live Re-Write (no spaces allowed) and clear" example is now multiline. This allows to test whether `setTextAndSelection` dirties layout. Enter multiline string to to the example text input and press clear. Observe that the text input shrinks to single line height. Reviewed By: shergin Differential Revision: D21182990 fbshipit-source-id: de8501ea0b97012cf4cdf8d5f658649139f92da6 * Remove setMostRecentEventCount from TextInput view commands Summary: Changelog: [Internal] We don't use view command `setMostRecentEventCount`, let's get rid of it. Reviewed By: JoshuaGross Differential Revision: D21016600 fbshipit-source-id: 6491c063e9d6a89252300cb47c010b248e473f4b * Restore Previous Behavior for StyleSheet Validation of Null/Undefined Styles (#29171) Summary: https://github.com/facebook/react-native/issues/27264 changed stylesheet validation to avoid enumerating properties on the prototype of a style. It introduces a secondary behavior change, where null/undefined styles used to be tolerated but now lead to an exception. This is because `for in undefined` will noop where `for of Object.keys(undefined)` will throw. This scenario of undefined/null styles seems to actually show up in practice and was previously well tolerated. E.g. `Button.js` has code that looks like this: ```jsx const styles = StyleSheet.create({ button: Platform.select({ ios: {}, android: { elevation: 4, // Material design blue from https://material.google.com/style/color.html#color-color-palette backgroundColor: '#2196F3', borderRadius: 2, }, }), ``` For non ios/Android platforms, that creates a style object which looks like: ```js { button: undefined, ... } ``` This previously meant that the component would be unstyled if created, but now means out-of-tree platforms throw if the builtin Button component is required. This change restores the previous `for in` loop but adds a `hasOwnProperty` check to avoid properties on prototypes. ## Changelog [General] [Fixed] - Restore Previous Behavior for StyleSheet Validation of Null/Undefined Styles Pull Request resolved: https://github.com/facebook/react-native/pull/29171 Test Plan: Validated that importing Buttons will no longer cause an exception, and that invalid properties are still caught. Reviewed By: JoshuaGross Differential Revision: D22118379 Pulled By: TheSavior fbshipit-source-id: 650c64b934ccd12a3dc1b75e95debc359925ad73 * Set windowTranslucentNavigation to false (#29399) Summary: This fixes https://github.com/facebook/react-native/issues/29397. Without this, apps that specify `android:windowTranslucentNavigation` draw the `LogBox` buttons underneath the soft navigation bar, making the buttons unpressable. Before | After :-------------------------:|:-------------------------: <img src="http://ashoat.com/AndroidTranslucentNavigationLogBox.png" width="300" /> | <img src="http://ashoat.com/AndroidTranslucentNavigationLogBoxFixed.png" width="300" /> ## Changelog [Android] [Fixed] - Set LogBox windowTranslucentNavigation to false Pull Request resolved: https://github.com/facebook/react-native/pull/29399 Test Plan: I tested this change on the [repo](https://github.com/Ashoat/LogBoxTest) I set up to reproduce the issue. I set it up to [build `ReactAndroid` from source](https://github.com/Ashoat/LogBoxTest/commit/3a2cdab8777ac381cd3be5a84a5bf3250751ac11) and then edited `node_modules/react-native/ReactAndroid/src/main/res/devsupport/values/styles.xml` directly. Reviewed By: rickhanlonii Differential Revision: D22602970 Pulled By: mdvacca fbshipit-source-id: 8c2adc149aa0157825075022f00bb695956d3121 * Fix image cannot show in iOS 14 (#29420) Summary: This PR is to fix https://github.com/facebook/react-native/issues/29279, which image cannot show in iOS 14 As https://github.com/facebook/react-native/issues/29279#issuecomment-658244428 mention, this issue can be fixed by calling ` [super displayLayer:layer];` it it is still image, to let `UIImageView` handle still image rendering ## Changelog [iOS] [Fixed] - Fix image cannot show in iOS 14 Pull Request resolved: https://github.com/facebook/react-native/pull/29420 Test Plan: Image can be shown in iOS 14 build with Xcode 12 beta, using ```js <Image source={require('./images/some_local_image.jpg')}/> ``` It may also need to test gif image is render correctly ```js <Image source={{uri: 'https://some_remote_gif_image.gif'}}/> ``` Reviewed By: p-sun Differential Revision: D22619448 Pulled By: shergin fbshipit-source-id: f4d0ad83af945a6b8099d4eaea5a5f1933c7bfd2 * [0.63.2] Bump version numbers * botched merge changes 1 * more hermes changes needed from upstream, botched merge? * [RCTPicker] Guard UIKit only API on macOS * [RCTSegmentedControl] Make UIKit agnostic * [RCTDisplayWeakRefreshable] Make platform agnostic * [RCTImageLoader] Make platform agnostic * [RCTDevLoadingView] Make platform agnostic * botched merge changes 2 * [RCTPushNotificationManager] Guard for macOS * v0.63 TODO * [RCTBaseTextInputViewManager] Make platform agnostic * [RCTBaseTextInputView] Make platform agnostic * [RNTester-macOS] Fix * [RCT-Folly] Fix build * [PlatformColorValueTypes] Add macOS shim * [package] Update CLI to no longer require config This makes a previous change more explicit: https://github.com/microsoft/react-native-macos/pull/602 * Fix iOS build failures. * Get RNTester to launch * [CODEOWNERS] Add myself * [flow] Remove deprecated rule in newer Flow https://github.com/facebook/flow/commit/759970c1b6dc0a25171d9969e34eaf5dae70f130 * [flow] Get iOS checks green * [PlatformColor] Duplicate iOS code for macOS This is a naive version of this change, there should likely be some code sharing happening between iOS and macOS. * [test] Make green with macOS fork changes * [test] Get macOS test bundle to build * [Color] Rename alternating colors to match to assumptions * [PlatformExample] Fix examples on macOS * [transform] Use iOS implementation for macOS * [circle] Fix config * [ci] Update metro config as per upstream * [ci] Ignore metro config in e2e tests * Revert "[ci] Ignore metro config in e2e tests" This reverts commit 25f7006bc9ba76b1e002b721954a823b3d710c5c. * Revert "[ci] Update metro config as per upstream" This reverts commit b47ca570be00394bbd92b349eab02083787301e7. * [ci] Only disable custom metro config in e2e test * [ci] Ignore metro config in e2e tests * [ci] Switch to experimental CocoaPods CDN * Revert "[ci] Switch to experimental CocoaPods CDN" This reverts commit 44a92f7f08397406429672b14930d44b6aa06b5e. * [ci] Skip Android tests in Apple PR on master * [rnm-init] Fix pod reference * [rnm-init] Update minimum iOS deployment target Co-authored-by: Christoph Nakazawa <cpojer@fb.com> Co-authored-by: Sergio Estevao <sergioestevao@gmail.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: Sam Mathias Weggersen <sawegger@microsoft.com> Co-authored-by: Tommy Nguyen <tonguye@microsoft.com> Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Héctor Ramos <hector@hectorramos.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Sebastian Markbage <sema@fb.com> Co-authored-by: generatedunixname89002005287564 <generatedunixname89002005287564@fb.com> Co-authored-by: Eddie Dugan <ejd@fb.com> Co-authored-by: Valentin Shergin <shergin@fb.com> Co-authored-by: Max Ovtsin <maxovtsin@fb.com> Co-authored-by: Alexander Kawrykow <akawry@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Spencer Ahrens <sahrens@fb.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Jack Wang <shoubowang@fb.com> Co-authored-by: Oleg Bogdanov <boguscoder@fb.com> Co-authored-by: Michael Bolin <mbolin@fb.com> Co-authored-by: Dan Abramov <gaearon@fb.com> Co-authored-by: Peter Argany <petetheheat@fb.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: George Zahariev <gkz@fb.com> Co-authored-by: Jason Safaiyeh <safaiyeh@protonmail.com> Co-authored-by: Pedro Barbiero <pedrobarbiero@gmail.com> Co-authored-by: Brian Vaughn <bvaughn@fb.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Martin Sherburn <mns@fb.com> Co-authored-by: Tom Underhill <tomun@microsoft.com> Co-authored-by: Ventsislav Dimitrov <4097884+vdmtrv@users.noreply.github.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: Lucas Bento <lucas.bsilva@outlook.com> Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com> Co-authored-by: Vojtech Novak <vonovak@gmail.com> Co-authored-by: Emilis Baliukonis <emilisb@wix.com> Co-authored-by: Jacob Bower <jbower@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: Marc Horowitz <mhorowitz@fb.com> Co-authored-by: Sidharth Guglani <sidharthguglani@fb.com> Co-authored-by: Andrew Coates (REDMOND) <acoates@microsoft.com> Co-authored-by: maciej simka <mcj.simka@gmail.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Pavlos Vinieratos <pvinis@gmail.com> Co-authored-by: Cristiano Santos <cristianomnsantos@gmail.com> Co-authored-by: Daniel Cohen Gindi <Danielgindi@gmail.com> Co-authored-by: Eli White <eliwhite@fb.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: jiggag <jiggag90@gmail.com> Co-authored-by: Emily Janzer <janzer@fb.com> Co-authored-by: Kacper Wiszczuk <kacperwiszczuk@gmail.com> Co-authored-by: Xiaoyu Yin <xyin@fb.com> Co-authored-by: Javier Cuevas <javi@diacode.com> Co-authored-by: Bruno Barbieri <brunobar79@gmail.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Will Holen <willholen@fb.com> Co-authored-by: Pritesh Nandgaonkar <prit91@fb.com> Co-authored-by: sunnylqm <sunnylqm@qq.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Tim Yung <yungsters@fb.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: Devon Deonarine <hello@devondeonarine.ca> Co-authored-by: Radek Czemerys <radko93@gmail.com> Co-authored-by: Hein Rutjes <IjzerenHein@users.noreply.github.com> Co-authored-by: zhongwuzw <zhongwuzw@qq.com> Co-authored-by: Jonny Burger <jonathanburger11@gmail.com> Co-authored-by: Ryan Tremblay <ryan.tremblay@microsoft.com> Co-authored-by: almouro <contact@almouro.com> Co-authored-by: Rick Hanlon <rickhanlonii@gmail.com> Co-authored-by: Matthieu Harlé <bonjour@matthieuharle.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Ashoat Tevosyan <ashoat@gmail.com> Co-authored-by: Tom Cheung <cheungch@gmail.com>
2020-09-30 19:38:06 +03:00
return () =>
console.warn(
'LogBox is enabled by default so there is no need to call unstable_enableLogBox() anymore. This is a no op and will be removed in the next version.',
);
},
// Deprecated Prop Types
get ColorPropType(): $FlowFixMe {
console.warn(
'ColorPropType will be removed from React Native. Migrate to ' +
"ColorPropType exported from 'deprecated-react-native-prop-types'.",
);
return require('deprecated-react-native-prop-types').ColorPropType;
},
get EdgeInsetsPropType(): $FlowFixMe {
console.warn(
'EdgeInsetsPropType will be removed from React Native. Migrate to ' +
"EdgeInsetsPropType exported from 'deprecated-react-native-prop-types'.",
);
return require('deprecated-react-native-prop-types').EdgeInsetsPropType;
},
get PointPropType(): $FlowFixMe {
console.warn(
'PointPropType will be removed from React Native. Migrate to ' +
"PointPropType exported from 'deprecated-react-native-prop-types'.",
);
return require('deprecated-react-native-prop-types').PointPropType;
},
get ViewPropTypes(): $FlowFixMe {
console.warn(
'ViewPropTypes will be removed from React Native. Migrate to ' +
"ViewPropTypes exported from 'deprecated-react-native-prop-types'.",
);
return require('deprecated-react-native-prop-types').ViewPropTypes;
},
// ]TODO(macOS GH#774)
};
if (__DEV__) {
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
/* $FlowFixMe[prop-missing] This is intentional: Flow will error when
* attempting to access ART. */
/* $FlowFixMe[invalid-export] This is intentional: Flow will error when
* attempting to access ART. */
Object.defineProperty(module.exports, 'ART', {
configurable: true,
get() {
invariant(
false,
'ART has been removed from React Native. ' +
"It can now be installed and imported from '@react-native-community/art' instead of 'react-native'. " +
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
'See https://github.com/react-native-art/art',
);
},
});
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
/* $FlowFixMe[prop-missing] This is intentional: Flow will error when
* attempting to access ListView. */
/* $FlowFixMe[invalid-export] This is intentional: Flow will error when
* attempting to access ListView. */
Object.defineProperty(module.exports, 'ListView', {
configurable: true,
get() {
invariant(
false,
'ListView has been removed from React Native. ' +
'See https://fb.me/nolistview for more information or use ' +
'`deprecated-react-native-listview`.',
);
},
});
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
/* $FlowFixMe[prop-missing] This is intentional: Flow will error when
* attempting to access SwipeableListView. */
/* $FlowFixMe[invalid-export] This is intentional: Flow will error when
* attempting to access SwipeableListView. */
Object.defineProperty(module.exports, 'SwipeableListView', {
configurable: true,
get() {
invariant(
false,
'SwipeableListView has been removed from React Native. ' +
'See https://fb.me/nolistview for more information or use ' +
'`deprecated-react-native-swipeable-listview`.',
);
},
});
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
/* $FlowFixMe[prop-missing] This is intentional: Flow will error when
* attempting to access WebView. */
/* $FlowFixMe[invalid-export] This is intentional: Flow will error when
* attempting to access WebView. */
Object.defineProperty(module.exports, 'WebView', {
configurable: true,
get() {
invariant(
false,
'WebView has been removed from React Native. ' +
"It can now be installed and imported from 'react-native-webview' instead of 'react-native'. " +
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
'See https://github.com/react-native-webview/react-native-webview',
);
},
});
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
/* $FlowFixMe[prop-missing] This is intentional: Flow will error when
* attempting to access NetInfo. */
/* $FlowFixMe[invalid-export] This is intentional: Flow will error when
* attempting to access NetInfo. */
Object.defineProperty(module.exports, 'NetInfo', {
configurable: true,
get() {
invariant(
false,
'NetInfo has been removed from React Native. ' +
"It can now be installed and imported from '@react-native-community/netinfo' instead of 'react-native'. " +
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
'See https://github.com/react-native-netinfo/react-native-netinfo',
);
},
});
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
/* $FlowFixMe[prop-missing] This is intentional: Flow will error when
* attempting to access CameraRoll. */
/* $FlowFixMe[invalid-export] This is intentional: Flow will error when
* attempting to access CameraRoll. */
Object.defineProperty(module.exports, 'CameraRoll', {
configurable: true,
get() {
invariant(
false,
'CameraRoll has been removed from React Native. ' +
"It can now be installed and imported from '@react-native-community/cameraroll' instead of 'react-native'. " +
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
'See https://github.com/react-native-cameraroll/react-native-cameraroll',
);
},
});
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
/* $FlowFixMe[prop-missing] This is intentional: Flow will error when
* attempting to access ImageStore. */
/* $FlowFixMe[invalid-export] This is intentional: Flow will error when
* attempting to access ImageStore. */
Object.defineProperty(module.exports, 'ImageStore', {
configurable: true,
get() {
invariant(
false,
'ImageStore has been removed from React Native. ' +
'To get a base64-encoded string from a local image use either of the following third-party libraries:' +
"* expo-file-system: `readAsStringAsync(filepath, 'base64')`" +
"* react-native-fs: `readFile(filepath, 'base64')`",
);
},
});
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
/* $FlowFixMe[prop-missing] This is intentional: Flow will error when
* attempting to access ImageEditor. */
/* $FlowFixMe[invalid-export] This is intentional: Flow will error when
* attempting to access ImageEditor. */
Object.defineProperty(module.exports, 'ImageEditor', {
configurable: true,
get() {
invariant(
false,
'ImageEditor has been removed from React Native. ' +
"It can now be installed and imported from '@react-native-community/image-editor' instead of 'react-native'. " +
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
'See https://github.com/callstack/react-native-image-editor',
);
},
});
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
/* $FlowFixMe[prop-missing] This is intentional: Flow will error when
* attempting to access TimePickerAndroid. */
/* $FlowFixMe[invalid-export] This is intentional: Flow will error when
* attempting to access TimePickerAndroid. */
Object.defineProperty(module.exports, 'TimePickerAndroid', {
configurable: true,
get() {
invariant(
false,
'TimePickerAndroid has been removed from React Native. ' +
"It can now be installed and imported from '@react-native-community/datetimepicker' instead of 'react-native'. " +
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
'See https://github.com/react-native-datetimepicker/datetimepicker',
);
},
});
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
/* $FlowFixMe[prop-missing] This is intentional: Flow will error when
* attempting to access ToolbarAndroid. */
/* $FlowFixMe[invalid-export] This is intentional: Flow will error when
* attempting to access ToolbarAndroid. */
v0.63 sync from upstream (#613) * Upgrade to Metro 0.59 Summary: Upgrades RN to Metro 0.59. Changelog: [Internal] Metro Upgrade Reviewed By: motiz88 Differential Revision: D20533864 fbshipit-source-id: 3c5fb8e37d2363edf0b9a1a8cfbdefba00763415 * Fix mock for TextInput (#28332) Summary: This PR adds the `isFocused` method to the mock of the TextInput component. My understanding some of the latest changes on the TextInput to make it use a forwardRef change the way this method is mock giving an error when trying to use in on a mock. The change suggested here fixes the issue. ## Changelog [JavaScript] [Fixed] - Fix the mock for TextInput to support the `isFocused` method Pull Request resolved: https://github.com/facebook/react-native/pull/28332 Reviewed By: cpojer Differential Revision: D20538044 Pulled By: TheSavior fbshipit-source-id: be734af105ab62ffdf9ed4017bd70845e207f8cd * Properly handle LogBox errors during tests Summary: This diff fixes an issue where errors in LogBox during tests would cause the tests to crash. The crash is due to the NativeExceptionsManager module not being mocked (as all native module need to be in tests). The fix is to properly mock the NativeExceptionManger. This fix exposed an infinite loop issue where failures in LogBox will be logged to the ExceptionManager, which logs to the console, which logs to LogBox, creating a loop. This diff also fixes that look by moving the LogBox internal error check to the top of the monkey patched console methods. Changelog: [Internal] Differential Revision: D20428590 fbshipit-source-id: 7289a480c99ba8dee67772178b7629afb40b330a * Back out "Track animations and flush them" Summary: Original commit changeset: b594d0e6e9b6 D20319824 introduced a problem in LayoutAnimations, which makes surfaced as the problem in T63911344. This diff reverts D20319824. Changelog: [Internal] Reviewed By: lunaleaps Differential Revision: D20541918 fbshipit-source-id: ff72b839f57d39051122920a38b2632cbb5ec362 * Consolidate "dispatchMountItems" reentrancy prevention code, and retry code, in one function Summary: Simplifying the dispatchMountItems reentrance and retry logic. Motivation: cleanup so I can work on dispatching ViewCommands before anything else. Importantly, this gives us the properties that: 1) Only one function is responsible for calling dispatchMountItems 2) Only one function is responsible for deciding if we shouldn't call dispatchMountItems due to reentrance 3) Only one function is responsible for all cleanup 4) Only one function maintains all of the relevant flags (except dispatchPreMountItems... two total now, instead of 4 before) Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20437035 fbshipit-source-id: 5370366790eb25f653bee6c1950e747458374a61 * Only retry ViewCommand mount items if exception is marked as "Retryable" Summary: Instead of just blindly retrying all ViewCommands if they fail - which could be dangerous, since it's arbitrary imperative commands we'd be executing twice, potentially with bad app state - we only retry if the ViewCommand throws a "RetryableMountingLayerException". Changelog: [Internal] Optimization to ViewCommands Reviewed By: mdvacca Differential Revision: D20529985 fbshipit-source-id: 0217b43f4bf92442bcc7ca48c8ae2b9a9e543dc9 * Introduce early dispatch of ViewCommands in FabricUIManager Summary: Earlier this week I introduced a change in the old, non-Fabric renderer (D20378633 D20427803) that (gated behind a feature-flag) executes ViewCommands before all other types of commands, as a perf optimization and (I think) a potential fix for a category of race conditions. I've added more details in comments here. The Fabric renderer uses the same feature-flag that I introduced for the non-Fabric renderer. Changelog: [Internal] Fabric Reviewed By: mdvacca Differential Revision: D20449186 fbshipit-source-id: bb3649f565f32c417a6247369902333989a043aa * Change nightly build from hourly to nightly (daily at 00:00) (#28346) Summary: We initially added the nightly build test to run every hour, in order to more quickly validate it. Now that it has been validated we can run it every night as it is intended to do. cc hramos ## Changelog [General] [Changed] - Change nightly build from hourly to nightly Pull Request resolved: https://github.com/facebook/react-native/pull/28346 Reviewed By: cpojer Differential Revision: D20550143 Pulled By: hramos fbshipit-source-id: 9487c6785684ad6ea7e877290d50a33118090a7f * Add diffing to app bundle size reports (#28284) Summary: Add diffing to app bundle size reports. ## Changelog [Internal] [Changed] - Add diffing to app bundle size reports Pull Request resolved: https://github.com/facebook/react-native/pull/28284 Test Plan: - App bundle size reports should now display a diff where available - Right now, the database contains only one entry for the last known good iOS build - Triggering a new build should not create additional comments Reviewed By: cpojer Differential Revision: D20450158 Pulled By: hramos fbshipit-source-id: 720772275f24d3ff0a49705f4dada2efe2e99bd3 * feat: improve monorepo support by removing redundant PROJECT_ROOT (#28354) Summary: Historically, React Native didn't support a lot of custom project structures apart from the standard flat directory with `ios` and `android` folders. The CLI had to be explicitly started from the project root, otherwise Metro didn't work right. In order to resolve the project root in the most accurate way, React Native assumed that project root is always `../../` from its location in `node_modules` - this is not true when the installation gets hoisted (e.g. in a monorepo). To address that, janicduplessis brought support for custom [`PROJECT_ROOT`](https://github.com/facebook/react-native/commit/9ccde378b6e6379df61f9d968be6346ca6be7ead) that allowed overriding the `../../` in case it wasn't true. Today, CLI is able to automatically resolve the project root, no matter where it's started. It will traverse the tree of the directories upwards and stop as soon as it meets `package.json`. As a result, it doesn't really matter from where we start the CLI anymore as a part of `react-native-xcode.sh`. By replacing the default value of `$REACT_NATIVE_DIR/../../` with `$PWD, that is default for all Xcode scripts, we can make the setup for monorepo easier - nobody will need to set `$PROJECT_ROOT` in order to override the incorrect defaults. By default, all scripts defined in Xcode run from `$PWD` directory, which is the location of the iOS project. In the future, we will be able to remove `cd` entirely. To better understand this PR, let's look a few hypothetical structures as an example: #### Monorepo: > tl;dr works out of the box, no need to mess around with paths ``` - package.json - packages/ - my-app/ - index.js - package.json - ios/ - MyApp.xcodeproj ``` **Before this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $REACT_NATIVE_DIR/../../ node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - Because we change the directory to the root of monorepo, CLI throws an error. All in all, there's no `react-native` dependency at the workspace root. - Some users turn `no hoist` in an act of troubleshooting the errors, which resolves the problem - `react-native` is moved under `my-app/node_modules` which makes this mechanism resolve properly. - Some users find out about `PROJECT_ROOT` and set it to overwrite the default value. For example, setting `export PROJECT_ROOT = "$PWD/../` will set the directory to `my-app`, which has a dependency on `react-native` in a `package.json` and makes the CLI happy. **After this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $PWD node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - The `$PWD` is `packages/my-app/ios/` because that's where the Xcode project is located. CLI will automatically set the root to `../` because that's where it finds `package.json` with `react-native` dependency. It will pass that root to Metro, unless users have set a different one themselves. Thanks to that, all paths to JavaScript files remain working and unaffected. - No need to set `PROJECT_ROOT` anymore. - We don't rely on the location of `node_modules`, which is cleaner and future proof. #### Standard: > tl;dr no changes ``` - ios/ - MyApp.xcodeproj - index.js - package.json ``` **Before this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $REACT_NATIVE_DIR/../../ node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - Everything works fine. Path from `react-native` inside `node_modules` is correct - the project root is set right to `/` **After this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $PWD node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - The root will be set to where Xcode project is located, which is `/ios`. This is the PWD for all Xcode scripts. CLI will look for the `package.json` going upwards from `ios` folder. Will stop at `/`, find out it has `react-native` dependency, load it and its commands and proceed further. ## Changelog [iOS] [Feature] - Better monorepo support when building release apk Pull Request resolved: https://github.com/facebook/react-native/pull/28354 Test Plan: - All projects (standard/monorepo) run without issues. - PROJECT_ROOT is not needed. CC: Titozzz (who wrote monorepo guide), alloy, bartolkaruza Reviewed By: cpojer Differential Revision: D20558005 Pulled By: hramos fbshipit-source-id: 2551120beadcfd4c2f1393ce8a2c2fa6b93c9290 * Fix `test_android`: Remove references to fbsource cell (#28363) Summary: Fixes https://github.com/facebook/react-native/issues/28361. ## Changelog [Internal] [CI] - Fix test_android Pull Request resolved: https://github.com/facebook/react-native/pull/28363 Test Plan: Prior to fix: ``` react-native $ ./scripts/circleci/buck_fetch.sh Guessing 168a69309928ba16065cdb33b1775a4af9f924a6 as the last one used version. Using additional configuration options from /Users/hramos/.buckconfig.d/experiments, /etc/buckconfig.d/fb_chef.ini, /etc/buckconfig.d/fb_chef_override.ini Invalidating internal cached state: Watchman failed to start. This may cause slower builds. Parsing buck files: finished in 1.5 sec Buck wasn't able to parse /Users/hramos/git/react-native/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK: IOError: [Errno 2] No such file or directory: '/Users/hramos/git/react-native/tools/build_defs/platform_defs.bzl' Call stack: File "/Users/hramos/git/react-native/.buckd/resources/168a69309928ba16065cdb33b1775a4af9f924a6/buck_server/buck_parser/profiler.py", line 507, in wrapped return func(*args, **kwargs) File "/Users/hramos/git/react-native/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK", line 1 load("//tools/build_defs:platform_defs.bzl", "ANDROID") File "/Users/hramos/git/react-native/.buckd/resources/168a69309928ba16065cdb33b1775a4af9f924a6/buck_server/buck_parser/profiler.py", line 507, in wrapped return func(*args, **kwargs) This error happened while trying to get dependency '//ReactAndroid/src/main/java/com/facebook/fbreact/specs:FBReactNativeSpec' of target '//ReactAndroid/src/main/java/com/facebook/react/devsupport:devsupport' ``` After fix: ``` react-native $ ./scripts/circleci/buck_fetch.sh + buck fetch ReactAndroid/src/test/java/com/facebook/react/modules Guessing 168a69309928ba16065cdb33b1775a4af9f924a6 as the last one used version. Using additional configuration options from /Users/hramos/.buckconfig.d/experiments, /etc/buckconfig.d/fb_chef.ini, /etc/buckconfig.d/fb_chef_override.ini Invalidating internal cached state: Watchman failed to start. This may cause slower builds. Parsing buck files: finished in 1.1 sec Configuration 'ANDROID_SDK' points to an invalid directory '/opt/android_sdk'. When creating rule //ReactAndroid/src/main/java/com/facebook/hermes/instrumentation:instrumentation. ``` > Note: I don't have the Android SDK configured in this machine. Verified on Circle CI. `test_android` is now green: https://circleci.com/gh/facebook/react-native/140682?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link Reviewed By: cpojer Differential Revision: D20564934 Pulled By: hramos fbshipit-source-id: 5d843b8f113c4db5391ee39addc3ff259d962290 * Fix TextInput left/right padding Summary: This fixes two things: 1) Currently it only respects Start and End padding, and if there's a Theme default, it will override Left/Right padding. Whoops. 2) Currently it doesn't respect when a TextInput starts with padding, but then is removed. This resolves both. It still does not account for RTL support. Changelog: [Internal] Fix AndroidTextInput padding Reviewed By: mdvacca Differential Revision: D20573151 fbshipit-source-id: e89791641b6699e728cde9dbd661a8c21485fbc8 * Validate selection range passed to setTextAndSelection Summary: Changelog: [Internal] # Fabric 1. If `start` and `end` parameters in `setTextAndSelection` are -1, we don't move the cursor. Previously the cursor would be moved to beginning of text input. 2. In view commands, do not validate `eventCount`. It is passed in as undefined from JS because Fabric's text input doesn't use `eventCount`. # Paper 1. If `start` and `end` parameters in `setTextAndSelection` are -1, we don't move the cursor. Previously the cursor would be moved to beginning of text input. Reviewed By: shergin Differential Revision: D20538290 fbshipit-source-id: c7aeddc25f58697254474058ce901df958321f7c * Remove ReactTypes from fbsource and React sync Summary: See https://github.com/facebook/react/pull/18366 This contains a fork of the upstream Flow types. We shouldn't be syncing this since these leads to conflicting types. As a result, these uses have already been codemodded away. Only the imports remained. Changelog: [React Core] - Remove ReactTypes from sync. Reviewed By: gaearon Differential Revision: D20583740 fbshipit-source-id: fc86a934cbdca8ff90fe90282b86ecc945a85e5f * Fix controlled TextInput with child nodes Summary: Changelog: [Internal] # There are three changes in this diff ## _stateRevision is replaced with a BOOL `_stateRevision` was protecting against setting attributed string that is already visible to the user. Previously this was ok because the change was only coming from native, any changes from JS were ignored. Imagine following scenario: 1. User taps key. 2. Update state is called on component initiated by native. 3. New state is created with incremented revision by one. 4. `_stateRevision` gets set to new state's revision + 1. 5. Now JS wants to change something because it just learnt that user tapped the key. 6. New state is created again with incremented revision by one. 7. Update state is called on the component, but the change isn't applied to the text view because `_state->getRevision()` will equal `_stateRevision`. By having a BOOL instead of number, we very explicitly mark the region in which we don't want state changes to be applied to text view. ## Calling [_backedTextInputView setAttributedText] move cursor to the end of text input This is prevented by storing what the current selection is and applying it after `[_backedTextInputView setAttributedText]` is called. This was previously invisible because JS wasn't changing contents of `_backedTextInputView`. ## Storing of previously applied JS attributed string in state This is the mechanism used to detect when value of text input changes come from JavaScript. JavaScript sends text input value changes through props and as children of TextInput. We compare what previously was set from JavaScript to what is currently being send from JavaScript and if they differ, this change is communicated to the component. Previously only first attributed string send from JavaScript was send to the component. # Problem If children are used to set text input's value, then there is a case in which we can't tell what source of truth should be. Let's take following example We have a text field that allows only 4 characters, again this is only a problem if those 4 characters come as children, not as value. This is a controller text input. 1. User types 1234. 2. User types 5th character. 3. JavaScript updates TextInput, saying that the content should stay 1234. 4. In `TextInputShadowNode` `hasJSUpdatedAttributedString` will be set to false, because previous JS value is the same as current JS value. Reviewed By: shergin Differential Revision: D20587681 fbshipit-source-id: 1b8a2efabbfa0fc87cba210570142d162efe61e6 * Daily `arc lint --take BUCKFORMAT` Reviewed By: zertosh Differential Revision: D20593906 fbshipit-source-id: b056947c698508119dc9d4d1bba202295b8f0fda * RN picker - implement background color Summary: add support to the android implementation of the Picker component for setting the background color. Changelog: [Android] [Added] - Support item background color in Dialog Picker Differential Revision: D20566131 fbshipit-source-id: d693b40803fa1051ec955c5728994c820fecd9e9 * Fabric: Modernizing Yoga Dirty flag test. Summary: Now we using TEST_F thing that allows consilidating initialization. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D20578788 fbshipit-source-id: 103bcb8fdeb3dbf297385cfe56415bd646e16791 * Fabric: Changing signature of `ComponentDescriptor::createState` Summary: This is pure syntactic change. Often we don't have a shared pointer to ShadowNodeFamily and only have just a reference. At the same time, `ComponentDescriptor::createState` does not have to accept a shared pointer. So, it's better to accept just a reference. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20578787 fbshipit-source-id: 905277001e096d41e75007575b59ea2ea15fbf4b * Fabric: View Test: Changing state should not dirty Yoga tree (in some most cases) Summary: Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D20578789 fbshipit-source-id: 4336165217bd39fc8065cfaeb96ef7753433d48a * Get ReactiveNative compiled with Clang 10 (#28362) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/28362 Fixed a few compilation errors emitted by Clang 10. Changelog: [iOS] [Fixed] - Get ready for Clang 10 Differential Revision: D20549970 fbshipit-source-id: dc36a85d90d3e43a05f045feb57c6ab6ded67da7 * Guard against null values in object parameters for bridged methods Summary: Handles the case when a value in an object parameter of a turbo module spec is null (even if the type is nullable). For example, given: ``` export interface Spec extends TurboModule { +myFunc: ({| foo: ?string, |}) => void; } ``` and calling `NativeModule.myFunc({foo: null})`, we see an error like: ``` JSON value '<null>' of type NSNull cannot be converted to NSString ``` Guarding against this by converting NSNull's to nils ## Changelog: [iOS] [Fixed] - Fix crash when passing null value in object parameter of bridged method Reviewed By: fkgozali Differential Revision: D20591590 fbshipit-source-id: fdb90f34131427a235f2e3c99147bf1e6a9c6732 * Modify pending deletion tags to be cross manageChildren Summary: Changelog: [Internal] Removing historic layout animations index adjustment (D20323928) broke the Dating Secret Crush screen. Since flushing animations (D20319824) had to be reverted due to issues with Saved + Privacy Shortcuts (https://fburl.com/tasks/eijtmifu) we need to track pending deletions across `manageChildren` operations. Reviewed By: JoshuaGross Differential Revision: D20601079 fbshipit-source-id: c6f116683750e97abe7f988cf361d2a6449e90e6 * Enable label-actions on the react-native repository (#28374) Summary: Enhance our issue management workflow by having the bot respond automatically whenever a label is applied to the issue. ## Changelog [Internal] - CI Pull Request resolved: https://github.com/facebook/react-native/pull/28374 Test Plan: Not tested. If needed, could be applied to a different, test repository. Reviewed By: cpojer Differential Revision: D20606887 Pulled By: hramos fbshipit-source-id: 874d1464527ea76bf51394a7d3e98e4fd8f69345 * Fix Animated Value initialized with undefined in ScrollView (#28349) Summary: When passing an object to contentOffset that doesn't have `y` prop set it causes the following error: ``` Error: AnimatedValue: Attempting to set value to undefined This error is located at: in ScrollView (at src/index.js:638) ... ``` This happens since a runtime check was added to the `AnimatedValue` constructor. (a3aaa471eca58b31597b9a0669f7ade385ccb175) According to flow types the object passed to contentOffset should always contain both x and y props but since it worked before when y is undefined I think its fine to patch the runtime behaviour defensively, especially since the code change is simple. ## Changelog [General] [Fixed] - Fix Animated Value initialized with undefined in ScrollView Pull Request resolved: https://github.com/facebook/react-native/pull/28349 Test Plan: Tested that the crash no longer reproduces when passing an empty object to contentOffset. Reviewed By: cpojer Differential Revision: D20601664 Pulled By: hramos fbshipit-source-id: b098a2dd1e702f995a9a92fa6e4e9a204187dac4 * xplat/js/react-native-github/ReactCommon/fabric/components/textinput/ Summary: Changelog: [Internal] Reviewed By: scottrice Differential Revision: D20619227 fbshipit-source-id: 674337e6ce585a4e96d020f9624b874ba86e2d80 * Seed ssh known hosts with github's public key (#28370) Summary: The [previous attempt](https://github.com/facebook/react-native/pull/28304) to fix the publish step failed, so now reverting to manually configuring things. This PR adds an entry to SSH’s `known_hosts` file using github.com’s public key that I have verified as per [these instructions](https://serverfault.com/a/807363): ``` ~/C/R/react-native [master] » nmap github.com --script ssh-hostkey Nmap scan report for github.com (140.82.118.4) rDNS record for 140.82.118.4: lb-140-82-118-4-ams.github.com PORT STATE SERVICE 22/tcp open ssh | ssh-hostkey: | 1024 ad:1c:08:a4:40:e3:6f:9c:f5:66:26:5d:4b:33:5d:8c (DSA) |_ 2048 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48 (RSA) ``` These fingerprints line up with [the ones posted by GitHub](https://help.github.com/en/github/authenticating-to-github/githubs-ssh-key-fingerprints), so my setup should be good and can be trusted to grab the public key from the right host: ``` ~/C/R/react-native [master] » ssh-keyscan -t rsa -H github.com # github.com:22 SSH-2.0-babeld-d48c3acd |1|If6MU203eXTaaWL678YEfWkVMrw=|kqLeIAyTy8pzpj8x8Ae4Fr8Mtlc= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== ``` ## Changelog [Internal] [Fixed] - Make automated publishing of packages from CI work again Pull Request resolved: https://github.com/facebook/react-native/pull/28370 Test Plan: I used the command being added in this PR in [a failed CI job](https://app.circleci.com/pipelines/github/facebook/react-native/4104/workflows/916127cb-177f-4583-9f90-cae5318041d8/jobs/140810). When I invoked the publish script manually I was not greeted by the blocking prompt and the package was successfully published: https://www.npmjs.com/package/react-native/v/0.0.0-56cf99a96 Reviewed By: cpojer Differential Revision: D20601527 Pulled By: hramos fbshipit-source-id: b1a4405228408cfc4a1b3b44ab88c79522af3a66 * Fix app bundle size diff not always being compared against latest commit (#28368) Summary: - Timestamp of entries in our Firebase instance sometimes get stored as number. This means that we may not always be diffing against the latest master commit. - Size report of Android and iOS gets overwritten depending on which build finishes first. ## Changelog [Internal] [Fixed] - App bundle size diff not always being compared against latest commit [Internal] [Fixed] - Android and iOS app bundle size diff overwrite each other Pull Request resolved: https://github.com/facebook/react-native/pull/28368 Test Plan: - We are now using Firebase's own [firebase.firestore.Timestamp.now](https://firebase.google.com/docs/reference/js/firebase.firestore.Timestamp#now) to ensure that we always get a timestamp in the preferred format. This has been tested locally but can only be verified when merged to master and we start getting new data. In the meantime, I'll manually fix up all the entries in the store. - There should be one app bundle size comment for Android and one for iOS in this PR. Reviewed By: cpojer Differential Revision: D20601620 Pulled By: hramos fbshipit-source-id: 0c3e4b78a74cbd659f1957a6aa74322b016e0646 * Hopefully fix so loading crashes Summary: Changelog: [Android][Internal] Fix potential initializer interruption threading crashes. Reviewed By: mdvacca Differential Revision: D20615755 fbshipit-source-id: 58b706deeb6df1998caff5bf2ae9ec60114313fe * Fix label-actions configuration Summary: Adds back a missing label key, fixes open source issue: https://github.com/facebook/react-native/issues/28378 Changelog: [Internal] [CI] - Fix label-actions config Reviewed By: cpojer Differential Revision: D20625887 fbshipit-source-id: 63c90db249aa9c15369a4b5bcab71cbe75c6d4b8 * Changing Order Of mOverrideColorScheme In Constructor Summary: Changelog: [Android] [Updated] mOverrideColorScheme should be assigned before the first colorSchemeForCurrentConfiguration call, so the initial setting of mColorScheme will reflect the override Reviewed By: zackargyle Differential Revision: D20630173 fbshipit-source-id: a2a2d174d3fc40c14f27dce6a7fa8e67203480c9 * hermes | inspector | Don't include posix headers on non-posix systems Summary: Changelog: [Internal] Hermes inspector includes pthreads, arpa and sys headers on all OSes that would break vanilla Windows builds. This diff adds a check for posix-compliance before inclusion (Note: this ignores all push blocking failures!) Reviewed By: dulinriley Differential Revision: D20564449 fbshipit-source-id: 8e264bc3104065dc4315bb291e8560609fe65184 * Upgrade Prettier from 1.17 to 2.0.2. Summary: This gets us on the latest Prettier 2.x: https://prettier.io/blog/2020/03/21/2.0.0.html Notably, this adds support for TypeScript 3.8, which introduces new syntax, such as `import type`. Reviewed By: zertosh Differential Revision: D20636268 fbshipit-source-id: fca5833d003804333a05ba16325bbbe0e06d6c8a * Back out "Upgrade Prettier from 1.17 to 2.0.2." Differential Revision: D20639755 fbshipit-source-id: 5028563f9cf0527a30b4259daac50cdc03934bfd * Fabric: Additional temporary checks in prop parsing infra Summary: While ViewConfig infra isn't perfect we need to check some value for correctness during prop-parsing. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D20639055 fbshipit-source-id: 193dcd0769bc7777bc8d60c964ede72ebdaa83e4 * Update React package Summary: This just updates the `react` package to the latest stable version. We updated it to experimental internally earlier so this brings the open source version to the latest before the branch cut. This doesn't include any breaking changes. Changelog: [General][Changed] - Update to React 16.13.1 Reviewed By: cpojer Differential Revision: D20642909 fbshipit-source-id: 68a4c74bfe72f1abdb33b0b9071a4f4e8e568318 * Fix sketchy null checks induced by new formatting in Prettier 2.0 Summary: Update code to prepare for Prettier 2.0, which will reformat `a || (b || c)` to `a || b || c`. Changelog: [Internal] prepare for Prettier 2.0 Reviewed By: kassens Differential Revision: D20639483 fbshipit-source-id: c2932b1495884684172ba9291d56c546f51711b8 * RN picker - fix types in AndroidDialogPickerManagerInterface Summary: according to [this crash report](https://our.intern.facebook.com/intern/logview/details/facebook_android_crashes/7ba7056481015482c6166d65cb97e49d/?trace_key=1506fe36a70dd5e50cdc8968f6317f27), `value` was throwing an NPE despite being null-checked. this is because it was an `int` rather than an `Integer`, so the null check wasn't working Changelog: Fix types in AndroidDialogPickerManagerInterface Reviewed By: mdvacca Differential Revision: D20646343 fbshipit-source-id: a27587e0a48f5782bcf5ffddb604018218e65206 * Remove RCTExportModule log spam Summary: The bridge complains if modules aren't exported, which isn't really helpful with lazily loaded modules and turbo modules. I considered only turning this off when TurboModules is enabled, but figured we'd be killing this soon anyways... If anyone feels strongly I can go that approach. Changelog: [iOS][Internal] Remove RCTExportModule log spam Reviewed By: shergin Differential Revision: D20629575 fbshipit-source-id: d32d9fe244c4d06acfee982fca7c7f63da294dc5 * De-jank DevLoadingView Summary: ## Problems Repro steps: 1. Disable Fabric (because CMD + R doesn't work with Fabric right now). 2. Open up Marketplace and hit `CMD + OPT + R` 3. **Observe:** The progress bar doesn't show up right away. It also doesn't actually show progress. https://pxl.cl/140g1 RN Support post: https://fb.workplace.com/groups/rn.support/permalink/3437652016283389/ ## Fixes The first problem is that progress bar doesn't actually show progress. **Fix:** Bundle load progress is updated in `RCTCxxBridge`, where we first require `RCTDevLoadingView`, and then call its `updateProgress` method. Previously, we wouldn't lazily load `RCTDevLoadingView`, it already didn't exist. Lazily loading `RCTDevLoadingView` causes the progress view to show up. Here: https://pxl.cl/140gt If you look at the above video, you'll notice there are two stages to the progress bar: stage 1 displays the actual progress. Stage 2 prompts that we're downloading the JS bundle. As you can see, stage 1 and stage 2 have different background colors, even though both of them are green. **Fix:** I adjusted the JS to match the Native color. Here: https://pxl.cl/140gT We're almost there, but the progress bar is dismissed twice? **Fix:** I dug into the code, and the reason why was because when we hit `CMD + R`, we invalidate the bridge, and immediately re-initialize it. This means that we asynchronously invalidate the old TurboModuleManager, and immediately create a brand new one. Therefore, two `RCTDevLoadingView` modules can (and do) exist at once. So, I moved `RCTDevLoadingView` to be an instance member of `FBReactModule`, to ensure that it doesn't get cleaned up and re-created when TurboModuleManager is deleted and re-created. This finally fixed the progress bar jank: https://pxl.cl/140hn Changelog: [iOS][Fixed] - Remove RCTDevLoadingView jank Reviewed By: rickhanlonii Differential Revision: D20607815 fbshipit-source-id: 05825c67adaf3cfda70be0fa2dc92d413dc8921b * Fix retaining self in block in LogBox impl Summary: Logbox has a retain cycle (see linked task for my deeper investigation). This diff doesn't fix the retain cycle, but it's just good practice to not retain self strongly in blocks. Changelog: [iOS][Internal] Fix retaining self in block in LogBox implementation Reviewed By: shergin Differential Revision: D20630693 fbshipit-source-id: cf399495e9bcd1917932fcc0e9c9d2d2a32bf6f0 * Flow type infoLog Summary: Changelog: [General][Internal] flow type infoLog Reviewed By: zackargyle Differential Revision: D20577939 fbshipit-source-id: eed4401b2ae0a6bf845fdcb54c6abe1fe98fe7c1 * Replace fbsource// with // in xplat/js/ files [1] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: scottrice Differential Revision: D20495655 fbshipit-source-id: a57b72f694c533e2e16dffe74eccb8fdec1f55f5 * Deploy Flow 0.121 to Xplat (#901) Summary: Deploy Flow 0.121 to Xplat bypass-lint allow-large-files Closes https://github.com/facebook/flipper/pull/901 Changelog: [Internal] Reviewed By: panagosg7 Differential Revision: D20570316 fbshipit-source-id: a76983d6f46c8b995ce2dd5cd1e014534790698a * Replace fbsource// with // in xplat/js/ files [3] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D20656211 fbshipit-source-id: deb91b917d349bc500acbb03d734ff621f6e1fc7 * Replace fbsource// with // in xplat/js/ files [4] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: JoshuaGross, shergin Differential Revision: D20656696 fbshipit-source-id: 10f02decb1dc969fd3491ac90d97f09e2bda59e7 * Add Needs: Repro bot action (#28397) Summary: Add automated response for Needs: Repro ## Changelog [Internal] [Added] - Add automated response for Needs: Repro Pull Request resolved: https://github.com/facebook/react-native/pull/28397 Test Plan: Bot should add a comment with the Needs: Repro label. Reviewed By: cpojer Differential Revision: D20665378 Pulled By: hramos fbshipit-source-id: 1c7d878faacf935a640849f74c81f119e5c7e92d * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D20666684 fbshipit-source-id: 32255ac7509e0257693969a7b4b044569af30df7 * ✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392) Summary: Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`. Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job. What was done in this PR: * The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use. * The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument. * The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument * The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument ## Changelog [Internal] [CI] - ✅ Green CI, disabled test infrastructure work Pull Request resolved: https://github.com/facebook/react-native/pull/28392 Test Plan: Verified on Circle CI Reviewed By: cpojer Differential Revision: D20665512 Pulled By: hramos fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726 * Upgrade internal packages to support ESLint >= 6 (#28393) Summary: Fixes https://github.com/facebook/react-native/issues/28293 I've tested it with https://github.com/react-native-community/react-native-template-typescript and it seems to be working as expected - no warnings, supports typescript 3.8. (note: I didn't upgrade the package version as I don't know how the releases work for this package) ## Changelog [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/28393 Reviewed By: hramos Differential Revision: D20647112 Pulled By: cpojer fbshipit-source-id: ca6b67971f625dc8125a58f9220dfcd86250ba94 * Fabric: Fixing a deadlock in RCTSurfacePresenter Summary: This is another attempt to fix an issue very similar to T59424871. The previous attempt was in D19249490. I don't know why we don't see production crashes (stalls) but it happened to me (and not to me) in the debugger. The previous attempt didn't work because we still could have a deadlock because we tried to acquired shared mutex already owned exclusively by the `suspend` method. Here is another approach: Instead of using one shared mutex, now we use two. One is similar to what we had and another that protects `suspend` and `resume`. Besides that, now we pass a Scheduler to functions that use that explicitly. This way we can be more explicit about acquiring mutexes and the overall flow of execution. The idea is: Now an arbitrary code that can be reentrant does not cover with mutexes, so the deadlock is not possible. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20639228 fbshipit-source-id: 98515742f00f2ae94b50b585c9f1f0611e169ebe * Update React Hooks Plugin Summary: Updates `eslint-plugin-react-hooks` to 3.0.0. This introduces a new lint error when you use a Hook inside a class. Changelog: [General][Changed] - Updated the React Hooks ESLint Plugin Reviewed By: cpojer Differential Revision: D20675528 fbshipit-source-id: d0cbe9748fd15df7a4c6de00bd1462610e0a43d6 * Upgrade React DevTools 4.0.6 -> 4.6.0 Summary: Upgrading the embedded version of React DevTools, primarily to pull in [this PR](https://github.com/facebook/react/pull/18397) which will reduce the impact of this package on `node_modules` size. # Update process Following a similar process as D15973709, I began by searching for [all of the references](https://our.intern.facebook.com/intern/biggrep/?corpus=xplat&filename=.json&case=false&view=default&extre=&s=%22react-devtools&engine=apr_strmatch&context=false&filter[uninteresting]=false&filter[intern]=false&filter[test]=false&grep_regex=) to the `react-devtools-core` package and updated all v4 usage to to point to the new 4.6.0 release: 1: Manually update "react-devtools-core" versions: ``` js/package.json js/react-native-github/package.json nuclide/package.json sonar/desktop/app/package.json sonar/desktop/plugins/reactdevtools/package.json vscode/modules/vscode-webview/package.json ``` 2: Setup Yarn proxy: ``` yarn config set proxy http://fwdproxy:8080/ yarn config set https-proxy http://fwdproxy:8080 ``` 3: Run "yarn" in each of the above directories. 4: Run the lockfile shell script: ``` ~/xplat/js/scripts/update-oss-yarn-lockfile.sh ``` 5: Update the generated `MOBILE_JS_NODE_MODULE_DEPS.bzl` by running ``` js1 build buckfiles ``` ## Changelog: [General] [Changed] - Upgrade embedded React DevTools backend from v4.0.6 to v4.6.0. Reviewed By: cpojer, gaearon Differential Revision: D20676091 fbshipit-source-id: 99865bdba9bce45e2a7d582d5fb550cfdbeeca3a * Make ScrollView use ForwardRef Summary: Have ScrollView use forwardRef so that the host component methods like `measure` and `measureLayout` are available without having to call `getNativeScrollRef`. Instead, you can use `<ScrollView ref={myRef} />` and directly call all methods of ScrollView and host components on `myRef`. Previous usage: ``` const myRef = React.createRef<React.ElementRef<typeof ScrollView>>(); <ScrollView ref={myRef} /> const innerViewRef = myRef.current.getNativeScrollRef(); innerViewRef.measure(); ``` New usage: ``` const myRef = React.createRef<React.ElementRef<typeof View>>(); <ScrollView ref={myRef} /> // now, myRef.current can be used directly as the ref myRef.current.measure(); myRef.current.measureLayout(); // Additionally, myRef still has access to ScrollView methods myRef.current.scrollTo(...); ``` Changes: * Added deprecation warnings to ScrollView methods `getNativeScrollRef`, `getScrollableNode`, and `getScrollResponder` * Added the forwardRef call to create `ForwardedScrollView` - this takes in `ref` and passes it into the class ScrollView as `scrollViewRef`. * Forwarded the ref to the native scroll view using `setAndForwardRef`. * Added statics onto `ForwardedScrollView` so that `ScrollView.Context` can still be accessed. * Added type `ScrollViewImperativeMethods`, which lists the public methods of ScrollView. * Converted all public methods of ScrollView to arrow functions. This is because they need to be bound to the forwarded ref. * Bound all public methods of ScrollView to the forwarded ref in the `setAndForwardRef` call. * Flow typed the final output (ForwardedScrollView) as an abstract component that takes in the props of the `ScrollView` class, and has all methods of both the inner host component (`measure`, `measureLayout`, etc) and the public methods (`scrollTo`, etc). Changes to mockScrollView: * Changed mockScrollView to be able to mock the function component instead of a class component * Updated necessary tests Changelog: [General] [Changed] - Make ScrollView use forwardRef Reviewed By: TheSavior Differential Revision: D19304480 fbshipit-source-id: 6c359897526d9d5ac6bc6ab6d5f9d82bfc0d8af4 * Fix issue with onEndReached Summary: onEndReached can be triggered twice when more items are added to the end of the list. This change makes it so that a second call to onEndReached won't happen until the user scrolls down to the new end of the list. Changelog: [General] [Fixed] - Fix double call to onEndReached in VirtualizedList Reviewed By: sahrens Differential Revision: D20066740 fbshipit-source-id: 129d7ae6bfd241eeea18fe0bb12b82be67735874 * Remove console warnings from ScrollView methods Summary: The newly added console warnings in D19304480 are adding a lot of warning noise due to missed infra callsites. Those callsites need to be updated before these warnings can be added. Changelog: [Removed] Remove console warnings from ScrollView methods Reviewed By: rickhanlonii Differential Revision: D20700917 fbshipit-source-id: cb618ee3a291d26e1942e4f91bbc02dee41fb78b * Upgrade react-docgen, jscodeshift and flow-parser Summary: In preparation for upgrading babel, I'm updating some of our source transform tools to the latest versions. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D20675201 fbshipit-source-id: fa4fee2652529c6677087e42cdd1325a8080e46f * Ship State Reconciliation 100% on all platforms Summary: State Reconciliation has been running 50/50 for a while and all metrics look stable. This is necessary for providing a good experience so we should ship to everyone unconditionally. Changelog: [Internal] Fabric diffing reconciliation process improvement Reviewed By: mdvacca Differential Revision: D20715694 fbshipit-source-id: 25b2635ecc29b67e2911679c9db66bc84d37dec1 * Core telemetry tests: update so they pass on my machine Summary: `std::this_thread::sleep_for` is not really precise and will attempt to sleep for "at least" that much time, but may sleep much longer depending on what CPUs are doing and scheduling policies. To get this to pass on my machine, I had to substantially increase the thresholds. Changelog: [Internal] Reviewed By: shergin Differential Revision: D20689571 fbshipit-source-id: f159420d24a95da2b5d95d49ed7882e783291e98 * Optimize diff algorithm to produce fewer remove+insert ("move") paired instructions Summary: An evolution of D20633188 but more performant. There are three optimized paths before the slow path. The first optimized path tries to pair identical nodes from old/new tree, and generate Update mutations, until we hit nodes that are different (indicating either a remove or an insert). This already existed. The next two optimizations, introduced by Tim in his JS pseudocode, were inspired by ReactJS's diffing algorithm. They work in cases where the rest of the nodes are (1) all removals/deletes or (2) all creates+inserts. Finally, if those final two optimized paths can't run, it's because there is a mix of delete+remove, create+insert, and "move" operations, mixed at the beginning, middle, and/or end of the list. This has slightly better average/best-case complexity as the previous implementation. In particularly pathological cases where all nodes are arbitrarily reordered, or reversed, for instance (ABCDE->EDCBA) the algorithm has the same complexity as the previous algorithm (quadratic). For now iOS is pinned to the older differ Changelog: [Internal] Experiment to optimize diffing algorithm in Fabric Reviewed By: shergin Differential Revision: D20684094 fbshipit-source-id: d29fba95a0328156c023e1c87804f23770ee1d91 * Unit test for V2 "minimal instruction" diffing algorithm Summary: This unit test is to verify that the new diffing algorithm generates a "minimal" instruction set, with regards to removes and inserts ("moves"). These unit tests are here to verify the expected behavior in this new algorithm, but these tests may be modified or deleted in the future if we decide we want to change this behavior. Changelog: [Internal] fabric unit test Reviewed By: mdvacca Differential Revision: D20706592 fbshipit-source-id: 5f9991498e0d788ecbf88d938bfe6d3f0f27af40 * Add ES Lint rules for `DynamicColorIOS()`and `ColorAndroid()` (#28398) Summary: The [PlatformColor PR](https://github.com/facebook/react-native/pull/27908) added support for iOS and Android to express platform specific color values. The primary method for an app to specify such colors is via the `PlatformColor()` method that takes string arguments. The `PlatformColor` method returns an opaque Flow type enforcing that apps use the PlatformColor method instead of creating Objects from scratch -- doing so would make it harder to write static analysis tools around Color values in the future. But in addition to `PlatformColor()`, iOS has a `DynamicColorIOS()` method that takes an Object. The Flow type for this Object cannot be opaque, but we still want to enforce that app code doesn't pass variables instead of Object literals or that values in the Objects are variables. To ensure `DynamicColorIOS()` can be statically analyzed this change adds an ESLint rule to enforce that `DynamicColorIOS()` takes an Object literal of a specific shape. A `ColorAndroid()` was also introduced not for practical use but just to test having platform specific methods for more than one platform in the same app. A second ESLint rule is created for `ColorAndroid` as well. ## Changelog [General] [Changed] - Add ES Lint rules for `DynamicColorIOS()`and `ColorAndroid()` Pull Request resolved: https://github.com/facebook/react-native/pull/28398 Test Plan: `yarn lint` passes. Reviewed By: cpojer Differential Revision: D20685383 Pulled By: TheSavior fbshipit-source-id: 9bb37ccc059e74282b119577df0ced63cb9b1f53 * fix: Android gradle config when bundling for release (#28415) Summary: This fix aims to address the issue when bundling an Android app for release and getting the error exhibited in https://github.com/facebook/react-native/issues/28002 which I also encountered myself. The config was changed sometime in November 2019 (as part of https://github.com/facebook/react-native/issues/26940, commit https://github.com/facebook/react-native/commit/a3b08048674e324dbe1f0ca816f35607e9e06a2f) to be very opinionated when it comes to the use of `npx` which Gradle itself cannot find anyway (I have `npx` installed globally and it didn't pick it up). Another issue that the use of `npx` creates is that Gradle should only ever use the currently installed react-native cli rather than a (possibly) higher version which may not always have backward compatibility. The proposed change simply throws a more descriptive error rather than defaulting to a tool which may or may not exist on the machine, be it CI or a development environment. I've also modified the RNTester app to reflect the correct config implementation relative to the RNTester app itself. In real projects, the config inside `android/app/build.gradle` should look similar to the following snippet: ``` project.ext.react = [ cliPath: "$rootDir/../node_modules/react-native/cli.js", entryFile: "index.js" ]; ``` ## Changelog [Android] [Fixed] - Gradle release config Pull Request resolved: https://github.com/facebook/react-native/pull/28415 Test Plan: - [x] Successfully bundled an Android release build with correct config - [x] Works with RNTester app Reviewed By: mdvacca Differential Revision: D20714372 Pulled By: hramos fbshipit-source-id: 4d66139249c6f840582a71a48c64e6a6595f7af0 * Reimplement D19965405: Small improvements in Differentiator/TinyMap Summary: Two things: 1) I reimplement Valentin's idea in D19965405, so that TinyMaps can be iterated over, with a couple of bugfixes (calling front() or back() on an empty vector will crash). 2) I now use TinyMap instead of better::map in the "optimized" diffing algorithm. 3) `erase` now actually removes elements from the vector, but only when more than half of elements have been erased. 4) If you repeatedly erase elements at the beginning of the vector, they will no longer be iterated over. This is a specific optimization for our heaviest TinyMap use-cases. These amount to some small but hopefully somewhat meaningful perf improvements. Changelog: [Internal] Fabric perf Reviewed By: shergin Differential Revision: D20718719 fbshipit-source-id: 91f4b2e2e0f6387ae484e43d5b0095103087baa6 * Remove LayoutInspectingPolicy.includeScrollViewContentOffset Summary: `LayoutInspectingPolicy` has two flags, `includeTransform` and `includeScrollViewContentOffset`. `includeScrollViewContentOffset` seems to be redundant for two reasons. # 1st From looking at callers, they have always the same value. I looked at all call sites, and they are either always both set to true or both set to false. # 2nd The way we include scroll view content offset, is through transformation, so setting `includeTransform` to true and `includeScrollViewContentOffset` to false will include content offset anyway. In order to make both flags work, we would need to introduce further changes to `getRelativeLayoutMetrics`. But since the flag isn't used anyway, I think it is better to get rid of it for now. If we need it in the future, we could re-introduce it. Reviewed By: shergin Differential Revision: D20622256 fbshipit-source-id: fb6156c66b752319ea928239fa723ff90688b0a0 * Add support for translation and rotation to operator * between Rect and Transform Summary: Changelog: [Internal] Until now `Rect operator*(Rect const &rect, Transform const &transform)` supported only scaling. Now it supports translation and rotation as well. Reviewed By: shergin Differential Revision: D20622876 fbshipit-source-id: 1b65393bd3fd6fd9a8941903e0f2681a10097e4a * Include transform property when calling getRelativeLayoutMetrics Summary: Changelog: [Internal] Current implementation of `measure` doesn't take transform into account.. So if you had a view which has width and height 100 and had `Scale(0.5, 0.5, 1)` (this will shrink view by half). Calling `getRelativeLayoutMetrics` would report its size being `{100, 100}`. This applies if view's parent has transformation as well, because transformation is applied to all subviews of the view as well. Reviewed By: mdvacca Differential Revision: D20621590 fbshipit-source-id: 2cf902a0494291c821ecada56f810c5e6620db5a * feat: migrate appveyor to circleci (#28245) Summary: This issue closes https://github.com/facebook/react-native/issues/28241 Migrated Windows test from AppVeyor to CircleCI ## Changelog [Internal] [Changed] - Migrated Windows test from AppVeyor to CircleCI Pull Request resolved: https://github.com/facebook/react-native/pull/28245 Test Plan: For CircleCI to Pass Reviewed By: cpojer Differential Revision: D20689163 Pulled By: hramos fbshipit-source-id: 285c762457ef00f7884ee9157b3f336044c0452f * Remove "Debug with Nuclide" option Summary: This is no longer needed. Reviewed By: cpojer Differential Revision: D20722274 fbshipit-source-id: 5bc3104e90811d724f42aadbf137ab8eff718ca0 * experiment to preload RN bridge after fb4a bookmarks render Summary: Changelog: [Android][Internal] add internal supermodule label Reviewed By: mdvacca Differential Revision: D20434200 fbshipit-source-id: fae50309cdd0df4a4523c2f88d1c8e01a7163575 * Fix CursorDrawable Color Tint for Android 10+ Summary: Accessing this field via reflection is explicitly blacklisted by Google in Android 10 and higher. They have provided a new API to change the color, which I have implemented here. [The old setColorFilter is deprecated](https://developer.android.com/reference/android/graphics/drawable/Drawable#setColorFilter(int,%20android.graphics.PorterDuff.Mode)) so I also updated that method call as well. Changelog: [General] [Fixed] Use new setTextCursorDrawable API for Android 10 Reviewed By: JoshuaGross Differential Revision: D20656068 fbshipit-source-id: 58a92b57c0a892c7c87fc5d735e4ceaa4e987ec7 * Early return on tinting CursorDrawable if no color supplied Summary: There's (potentially) a lot of expensive reflection calls here that, as best I can tell, end up being ignored if the supplied color is null. Better to early return. Changelog: [General] [Internal] Preclude reflection when setting cursor color if color is null Reviewed By: JoshuaGross Differential Revision: D20670594 fbshipit-source-id: 480a988355bbd79008002c4326d4b35035ec2a95 * Partial React Sync for Inspector Summary: Partial sync for React that includes: - https://github.com/facebook/react/pull/18388 - https://github.com/facebook/react/commit/dd7e5e4f5ac2ffac3171ef61daee2cb1edc69635 Created from this branch: https://github.com/facebook/react/compare/master...rickhanlonii:rh-partial-3-24?expand=1 Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20651395 fbshipit-source-id: 67baf7c407f75d9fd01c17f2203a77a38567100e * Enable inspector for Fabric Summary: ## Overview This diff refactors the Inspector, moving logic to look up view data for a touched view inside the renderer as `getInspectorDataForViewAtPoint`. We then implement that same function for Fabric in order to support the inspector in that renderer. Requires https://github.com/facebook/react/pull/18388 ## Motivation Reason one for this refactor is that, previously, the inspector held all of the logic to look up view data for a given x,y touch coordinate. To do this, it would take the React tag and coordinates, look up the native view tag, measure it, and then ask React internals for the Fiber information of that tag. All of this is deeply coupled to React internals, yet the logic is outside of React core in the Inspector. Reason two is that, for Fabric, the logic for getting the view data is different than Paper. In Fabric, we pass the x,y coordinates to native directly, which returns an instance handle. That handle can be used to measure the ShadowNode, or retrieve the Fiber information. By moving the logic into the renderer in React core, we decouple the implementation details of looking up view data for a tapped point and allow ourselves the ability to add and change renderer-specific code for the actual lookup without impacting outsiders like the Inspector. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D20291710 fbshipit-source-id: a125223f2e44a6483120c41dc6146ad75a0e3e68 * chore: update url of warning message from deprecated imports (#28452) Summary: Some of the repository name of Lean Core(https://github.com/facebook/react-native/issues/23313) libraries has been renamed. This PR updates the warning message to display the updated url. ## Changelog [General] [Changed] - Update warning message of deprecated imports Pull Request resolved: https://github.com/facebook/react-native/pull/28452 Test Plan: updated URL can be accessed. Reviewed By: cpojer Differential Revision: D20745184 Pulled By: TheSavior fbshipit-source-id: 2c3ed6a000b45022ca6c4862305aa567c4d18b2e * Add `upgrade-support` link on issue creation (#28411) Summary: This PR adds a https://github.com/react-native-community/upgrade-support link for the user when creating an issue. Changelog: [Internal] Pull Request resolved: https://github.com/facebook/react-native/pull/28411 Reviewed By: cpojer Differential Revision: D20714274 Pulled By: hramos fbshipit-source-id: 4ca42224a50e386b95f21f0fb236a917e1b6b982 * Update PixelRatio 'getFontScale' method description (#28407) Summary: Refs facebook/react-native-website#1776. Despite in-code description `PixelRatio.getFontScale()` is working properly on the iOS (it also reflects the user settings). This PR updates the in-code description to match current behaviour. I have decided to skip in the code information about additional setting in `Accessibility` menu and in `Control Centre`, but if you think it is important just let me know, I can update this PR. ## Changelog [Internal] [Fixed] - Fix PixelRatio getFontScale method description Pull Request resolved: https://github.com/facebook/react-native/pull/28407 Test Plan: N/A Differential Revision: D20750260 Pulled By: shergin fbshipit-source-id: c40ec2fd49cd60e2975351c3a1c453aab0045da4 * Remove allowDisablingImmediateExecutionOfScheduleMountItems feature flag Summary: No longer needed. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20747684 fbshipit-source-id: a8077519b7670d72e23267b1c1423556ec97be3f * RuntimeExecutor helpers that modify the way of the callback is being executed. Summary: Here we implement a bunch of helper methods that allow customizing the behavior of a RuntimeExecutor "on-demand" on the caller side. We will use it in the next diff(s). Changelog: [Internal] Fabric-specific internal change. Reviewed By: PeteTheHeat Differential Revision: D20551411 fbshipit-source-id: 51d3cd02b69753110c0e1155347c6e52eb882c7d * Fabric: Using `executeSynchronouslyOnSameThread_CAN_DEADLOCK` in MainRunLoopEventBeat Summary: We are replacing inline-ed implementation with practically the same one implemented as the helper method. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20551409 fbshipit-source-id: fcc6f497cd240af65fba534051c217fe5746ce82 * Set RootNodeKind trait in ModalHostViewShadowNode Summary: Changelog: [internal] `ModalHostViewShadowNode` didn't have `RootNodeKit` trait, therefore `getRelativeLayoutMetrics` was including nodes in ancestors that it shouldn't have. Reviewed By: shergin Differential Revision: D20735801 fbshipit-source-id: 6b81e3b174c2f82e530abc2bca2da8bebc2270b0 * mention RNTester app in contributor guide (#28042) Summary: motivation is following - the RNTester app is imho the best place to try out any changes that a contributor would make, yet it is not directly mentioned in the contributor guide. This fixes it. ## Changelog [Internal] - Docs Pull Request resolved: https://github.com/facebook/react-native/pull/28042 Test Plan: not necessary Reviewed By: TheSavior Differential Revision: D20401260 Pulled By: hramos fbshipit-source-id: 01c1b7dff56b59909c94b2feb609650f0baba1a9 * Buck: Use Android SDK 29 during build (#28455) Summary: Fixes `test_android` and `test_docker` build failures. Thanks to dulmandakh for identifying the fix. Changelog: [Internal] [Android] [Changed] - Use Android SDK 29 to build during CI tests Pull Request resolved: https://github.com/facebook/react-native/pull/28455 Test Plan: Circle CI shows `test_android` and `test_docker` passing: https://app.circleci.com/jobs/github/facebook/react-native/142273 Reviewed By: sturmen Differential Revision: D20766589 Pulled By: hramos fbshipit-source-id: 8ef8a8ce3a6e7353ae47425accb3bd26cf1608c4 * Assign orderIndex_ in ConcreteViewShadowNode constructor instead of ViewShadowNode's constructor Summary: Changelog: [Internal] `orderIndex_` was only being assigned for `ViewShadowNode`, not for other `ShadowNodes` that are later represented on the screen. Reviewed By: shergin Differential Revision: D20746477 fbshipit-source-id: c04c2cfea14b9141d22bc3d9e9bb4c0c59925754 * Implement nativePerformanceNow to improve Profiler API results (#27885) Summary: When experimenting with React Profiler API (https://reactjs.org/docs/profiler.html), I noticed that durations are integers without a debugger, but they are doubles with higher precision when debugger is attached. After digging into React Profiler code, I found out that it's using `performance.now()` to accumulate execution times of individual units of work. Since this method does not exist in React Native, it falls back to Javascript `Date`, leading to imprecise results. This PR introduces `global.nativePerformanceNow` function which returns precise native time, and a very basic `performance` polyfill with `now` function. This will greatly improve React Profiler API results, which is essential for profiling and benchmark tools. Solves https://github.com/facebook/react-native/issues/27274 ## Changelog [General] [Added] - Implement `nativePerformanceNow` and `performance.now()` Pull Request resolved: https://github.com/facebook/react-native/pull/27885 Test Plan: ``` const initialTime = global.performance.now(); setTimeout(() => { const newTime = global.performance.now(); console.warn('duration', newTime - initialTime); }, 1000); ``` ### Android + Hermes ![Screenshot_1580198068](https://user-images.githubusercontent.com/13116854/73245757-af0d6c80-41b5-11ea-8130-dde14ebd41a3.png) ### Android + JSC ![Screenshot_1580199089](https://user-images.githubusercontent.com/13116854/73246157-92256900-41b6-11ea-87a6-ac222383200c.png) ### iOS ![Simulator Screen Shot - iPhone 8 - 2020-01-28 at 10 06 49](https://user-images.githubusercontent.com/13116854/73245871-f136ae00-41b5-11ea-9e31-b1eff5717e62.png) Reviewed By: ejanzer Differential Revision: D19888289 Pulled By: rickhanlonii fbshipit-source-id: ab8152382da9aee9b4b3c76f096e45d40f55da6c * Save/restore IP when leaving the interpreter Summary: This diff implements the instruction pointer save/restore trick Tzvetan came up with; allowing us to observe and modify the IP from outside the interpreter loop with negligible overhead. From Tzvetan's internal post on the subject: > [Today] the interpreter IP is just a local variable in the interpreter function, so there is no way to get to its value from outside the function. It lives in a register and we don't want to make it a Runtime field since the overhead [of accessing it via memory in the interpeter loop] would kill us. > However, if you really think about it, it only lives in a register while the interpreter function is running. For the rest of the time, it is spilled by the C++ compiler onto the stack. So, precisely when we need it, it is actually stored in memory. The only problem is, we don't know where! Admittedly, that is an annoying problem, but it feels like it should be solvable. > What if, instead of relying on the compiler to spill the IP register, we manually spill it ourselves, to a known location? It works. Example: https://godbolt.org/z/ftSDnp This diff implements this approach across the whole interpreter loop: whenever we call out of the loop we capture/publish the IP and restore it again immediately after the external call returns. This means we can now see the IP outside the interpret loop and even change it. This is effectively "for free" as the compiler now skips spilling/restoring the IP behind the scenes. The immediate benefit of this is knowing the current IP allows us to have more accurate stack-traces during execution. In future this may enabled tricks like changing the IP before returning to the interpreter loop, allowing things outside the interpreter to affect program flow without adding logic to the interpreter loop. Reviewed By: tmikov Differential Revision: D20151091 fbshipit-source-id: 3814382639800208d8985a32ede31ba8f7ff7c80 * Plumb through memory allocation profiler feature to Chrome Inspector Summary: Changelog: Make allocation profiler feature of Chome Inspector work Reviewed By: dulinriley Differential Revision: D20383003 fbshipit-source-id: 8a10c310d5a639a6644763adb53f2f0017057587 * chore: update lint config in template (#28443) Summary: Updating the eslint config and metro-preset used in project template. ## Changelog [General] [Changed] - Upgrade eslint-config and metro-preset in project template Pull Request resolved: https://github.com/facebook/react-native/pull/28443 Test Plan: - Start new project with `npx react-native init TestLint` - upgrade lint and metro-config - run lint and start up emulator on iOS and android Reviewed By: cpojer Differential Revision: D20771048 Pulled By: hramos fbshipit-source-id: a6d387b8687cee348681bcb10d22c7e3de291ed7 * Apply buckformat in preparation for updating buildifier Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D20773287 fbshipit-source-id: 144bb13191312eef246646b99e1dc06304c6d210 * Circle CI Housekeeping: Windows, e2e (#28471) Summary: Circle CI Housekeeping: * Integrate Windows job into `tests` workflow * Add parametrized e2e tests command * Move js e2e tests out of the disabled test quarantine area * Parametrize and split `test_ios` job to reduce total execution time by ~13 minutes **Before:** Longest running iOS job at 39 minutes. | Setup Job Runtime | Job | Job Runtime | Total Runtime | | - | - | - | - | | 01:24 | test_ios | 38:04 | **39:28** | | 01:24 | test_ios_frameworks | 38:02 | 39:26 | ![Screen Shot 2020-03-31 at 12 40 29 PM](https://user-images.githubusercontent.com/165856/78068308-044c3280-734d-11ea-96bf-2e50691a0ef7.png) **After:** Longest running iOS job down to 26 minutes. | Setup Job Runtime | Job | Job Runtime | Total Runtime | | - | - | - | - | | 01:26 | test_ios_unit | 20:48 | 22:14 | | 01:26 | test_ios_unit_frameworks | 22:52 | 24:18 | | 01:26 | test_ios_detox | 24:35 | 39:28 | | 01:26 | test_ios_detox_frameworks | 24:54 | **26:20** | ![Screen Shot 2020-03-31 at 12 39 22 PM](https://user-images.githubusercontent.com/165856/78068294-fe565180-734c-11ea-96da-8836231d7747.png) ## Changelog [Internal] [CI] - CI Housekeeping Pull Request resolved: https://github.com/facebook/react-native/pull/28471 Test Plan: Circle CI Reviewed By: cpojer Differential Revision: D20774521 Pulled By: hramos fbshipit-source-id: 4a2f5a4083cd76dcb51d5ccaf726cd204fca222e * Fix bug in optimized differ Summary: The differ was still producing correct, but not minimal, instruction sets in some cases due to an optimization that was buggy. This affected cases where 2+ nodes were inserted at the beginning of a list. It would trigger the old behavior where all nodes after the first would be removed, deleted, then reinserted. See the test case (which was failing and now passed) and P128190998 (the 3->4 transition) for samples. Changelog: [Internal] Fabric differ Reviewed By: mdvacca Differential Revision: D20785729 fbshipit-source-id: 2fea6a816753066abb358ed7bb51003140cd5fc4 * Use `buildCodeFrameError` in babel-plugin-inline-view-configs Summary: The next version of Babel changes how it prints file names in errors. This diff fixes the test by using `/` as the `cwd` and switches the plagin to use `path.buildCodeFrameError` so errors will be more helpful for users. I renamed the `nodePath` variable to `path` because that's what babel plugins usually do. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D20781805 fbshipit-source-id: cc149dce6389aa9402ce70ea30035c74a6150ea3 * Swap left and right yoga position with start and end in RTL context Summary: Changelog: [Internal] Paper swaps right and left in RTL setting, this logic is in [RCTShadowView.m](https://our.intern.facebook.com/intern/diffusion/FBS/browse/master/xplat/js/react-native-github/React/Views/RCTShadowView.m?commit=cdd504cfbee66ae0659495604c4ff7b5764a1d9e&lines=529-549). For Fabric instead of doing it during yoga props assignment, I swap the left/right with start/end just before we pass yoga nodes to layout calculation. Reviewed By: shergin Differential Revision: D20420040 fbshipit-source-id: b777f2658f56c173743b2034b8b5059e3e0c9840 * Fix inline-view-configs test on Windows. Summary: *facepalm* The file path is platform specific. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D20793023 fbshipit-source-id: 4fbcbf982911ee449a4fa5067cc0c5d81088ce04 * Pass isRTL flag from FabricUIManager Fabric core Summary: Changelog: [Internal] Send `isRTL` flag and `doLeftAndRightSwapInRTL` flags from Java to Fabric Core. Reviewed By: JoshuaGross, mdvacca Differential Revision: D20776005 fbshipit-source-id: 946c239d9a11ebea958b0a6d04f2316b7cd77311 * Promote shadowColor to formsStackingContext property Summary: Changelog: [Internal] View with `ShadowColor` was getting flattened and therefore views didn't have shadow property set. This is fixed by promoting ShadowColor so in case it is set, it forms stacking context. Reviewed By: shergin Differential Revision: D20792201 fbshipit-source-id: 1033ac00e32047ffbb14e61b7c26348c578d132d * Get CallInvokers from the bridge Summary: ## Context For now, assume TurboModules doesn't exist. **What happens when we call an async NativeModule method?** Everytime JS calls an async NativeModule method, we don't immediately execute it. The legacy infra pushes the call into some queue managed by `MessageQueue.js`. This queue is "flushed" or "emptied" by the following events: - **Flushed:** A C++ -> JS call. NativeModule async methods can called with an `onSuccess` and/or `onFail` callback(s). Calling `NativeToJsBridge::invokeCallback` to invoke one of these callbacks is one way for ObjC++/C++/Java to call into JS. Another way is via JSModule method calls, which are initiated by `NativeToJsBridge::callFunction`. - **Flushed:** When `JSIExecutor::flush` is called. Since TurboModules don't exist, this only happens when we call `JSIExecutor::loadApplicationScript`. - **Emptied:** When more than 5 ms have passed, and the queue hasn't been flushed/emptied, on the next async NativeModule method call, we add to the queue. Afterwards, we empty it, and invoke all the NativeModule method calls. **So, what's the difference between flushed and emptied?** > Note: These are two terms I just made up, but the distinction is important. If the queue was "flushed", and it contained at least one NativeModule method call, `JsToNativeBridge` dispatches the `onBatchComplete` event. On Android, the UIManager module is the only module that listens to this event. This `onBatchComplete` event doesn't fire if the queue was "emptied". **Why does any of this matter?** 1. TurboModules exist. 2. We need the TurboModules infra to have `JsToNativeBridge` dispatch `onBatchComplete`, which depends on: - **Problem 1:** The queue being flushed on calls into JS from Java/C++/ObjC++. - **Problem 2:** There being queued up NativeModule async method calls when the queue is flushed. In D14656466, fkgozali fixed Problem 1 by making every C++/Java/Obj -> JS call from TurboModules also execute `JSIExecutor::flush()`. This means that, with TurboModules, we flush the NativeModule async method call queue as often as we do without TurboModules. So far, so good. However, we still have one big problem: As we convert more NativeModules to TurboModules, the average size of the queue of NativeModule method calls will become smaller and smaller, because more NativeModule method calls will be TurboModule method calls. This queue will more often be empty than not. Therefore, we'll end up dispatching the `onBatchComplete` event less often with TurboModules enabled. So, somehow, when we're about to flush the NativeModule method call queue, we need `JsToNativeBridge` to understand that we've executed TurboModule method calls in the batch. These calls would have normally been queued, which would have led the queue size to be non-zero. So if, during a batch, some TurboModule async method calls were executed, `JsToNativeBridge` should dispatch `onBatchComplete`. **So, what does this diff do?** 1. Make `Instance` responsible for creating the JS `CallInvoker`. 2. Make `NativeToJsBridge` responsible for creating the native `CallInvoker`. `Instance` calls into `NativeToJsBridge` to get the native `CallInvoker`. 3. Hook up `CatalystInstanceImpl`, the Android bridge, with the new JS `CallInvoker`, and the new native `CallInvoker`. This fixes `onBatchComplete` on Android. iOS work is pending. Changelog: [Android][Fixed] - Ensure `onBatchComplete` is dispatched correctly with TurboModules Reviewed By: mdvacca Differential Revision: D20717931 fbshipit-source-id: bc3ccbd6c135b7f084edbc6ddb4d1e3c0c7e0875 * Make HermesRuntime::description() always include "HermesRuntime" Summary: If name is passed in as part of RuntimeConfig, that is included in the description, too. Changelog: [Internal] Reviewed By: dulinriley Differential Revision: D20716320 fbshipit-source-id: f2fba6df32f496090dee787d8b7f55a6a4dd8ed8 * Fix Yoga flexshrink with min-width sizing issue Summary: While resolving the flexible items we calculate totalFlexShrinkScaledFactors which uses the flexBasis or initial width of node (Not min-width). At a later stage during distribution of space we are subtracting value from this which also takes care of min-width. For example If node has flexShrink 1 and width 100 and min-width 301 then totalFlexShrinkScaledFactors will become -1*100 = -100 but later we are subtracting -1 * 301 (min-width) = -301 which is ambiguous and causing layout inconsistencies with how web behaves. Fixed this by only using the flexBasis or width for these calculations. Changelog: [Internal][Yoga] Fix layout issue when flexShrink and min-width are used together Reviewed By: pasqualeanatriello Differential Revision: D20219419 fbshipit-source-id: 948fbc06ca541d4ad307c88c8a2df65d157778b1 * More consistent snapshots on windows (#28482) Summary: Get jest tests to be runnable on windows, and match current snapshots ## Changelog [Internal] [Fixed] - More consistent snapshots on windows Pull Request resolved: https://github.com/facebook/react-native/pull/28482 Test Plan: run `yarn test` on a windows machine, and hit the test_windows circleci tests Reviewed By: hramos Differential Revision: D20799002 Pulled By: cpojer fbshipit-source-id: da3db0171c34a43199c7d3dc17b622b37bc91701 * Improve component stack parsing Summary: Update the error log message parsing to fix missing component stacks in console.errors. Changelog: [Internal] Reviewed By: cpojer Differential Revision: D20801985 fbshipit-source-id: ae544200315a8c3c0310e8370bc38b0546734f38 * Implement RCTWarn equivalent on Android Summary: ## Overview This diff is an RFC to port a logging feature from iOS to Android. Changelog: [Internal] ## Motivation On iOS we have the following log functions and behaviors available for logging native warnings and errors: - **Warnings** (`RCTLogWarn`) - Log level 'warn' to console - Display warning in LogBox - **Errors** (`RCTLogError`) - Log level 'error' to console - Display a native RedBox (needs converted to show a LogBox if available) - **Logs** - We also have `RCTLog`, `RCTTrace`, `RCTAdvice`, `RCTInfo`, which just log to the console. In Java, we have: - **Warnings** - **None**, added in this diff - **Errors** (`DevSupportManager.showNewJavaError`) - Log level 'error' to console with `FLog.e` - Display a native RedBox (needs converted to show a LogBox if available - **Logs** - `ReactSoftException` (crashes the app??) - `ReactNoCrashSoftException` (only logs??) - Others? ## Details This diff adds a method to pair with `RCTLogWarn`, `DevSupportManager.showNewJavaWarning`, which will log to the console and show a LogBox warning if LogBox is available. ## Concerns I have a few concerns/questions about the state of logging on Android: - Should/can we move all of the logging to it's own class, like how RCTLog works? - Why does some logging happen on DevSupportManager and some in other classes? - If we moved it all to it's own class, how could we access the reactContext to call the RCTLog JS module Reviewed By: JoshuaGross Differential Revision: D20056394 fbshipit-source-id: 32d57e300685e46da8039fc77cb22b4084acf81a * Remove unused feature flag: useMapNativeAccessor Summary: useMapNativeAccessor isn't being used anywhere. Changelog: [Internal] Removing unused internal feature flags: mUseMapNativeAccessor and mUseArrayNativeAccessor Reviewed By: mdvacca Differential Revision: D20788147 fbshipit-source-id: bf670508326813602cb544f86d3d2164651d3394 * Remove unused Feature Flag: lazilyLoadViewManagers Summary: Remove unused feature flag. This is not used within Facebook and I'm not aware of usage outside of FB. Changelog: [Removed] Removing Android feature flag: lazilyLoadViewManagers Reviewed By: mdvacca Differential Revision: D20788210 fbshipit-source-id: 435316e3de7830d7cb7f14537351883e4fc6eeaa * Remove unused feature flag: enableExtraWebViewLogs Summary: Hard-coded to false everywhere, and write-only. We never read from this. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20788252 fbshipit-source-id: ae117ebc51db7045947b9713602527ff4220833e * Remove unused feature flag: logDroppedViews Summary: Remove unused internal feature flag, logDroppedViews. Changelog: [Internal] Reviewed By: lunaleaps Differential Revision: D20797353 fbshipit-source-id: 1bfea7fcce9e80cdb92cda59a89c7dd817d4a581 * Split loadApplicationScript into initializeRuntime and loadBundle (#27844) Summary: This is the first of three PRs related to enabling multi-bundle support in React Native. More details, motivation and reasoning behind it can be found in RFC [here](https://github.com/react-native-community/discussions-and-proposals/issues/152). Logic responsible for installing globals was pulled out from `loadApplicationScript` to `initializeRuntime` since it should be ran only once, what was left was renamed to `loadBundle`. It's based on dratwas work from [here](https://github.com/callstack/react-native/tree/feat/multibundle/split-load-application), but applied to current `master` to avoid rebasing 3-months old branch and issues that come with that. ## Changelog [Internal] [Changed] - split `loadApplicationScript` into `initializeRuntime` and `loadBundle` to enable multi-bundle support in the future Pull Request resolved: https://github.com/facebook/react-native/pull/27844 Test Plan: Initialized new RN app with CLI, set RN to build from source and verified the still app builds and runs OK using code from this branch. Reviewed By: rickhanlonii Differential Revision: D19888605 Pulled By: ejanzer fbshipit-source-id: 24ace48ffe8978796591fe7c6cf53a61b127cce6 * Back out "Fix controlled TextInput with child nodes" Summary: Changelog: [Internal] Original commit changeset: 1b8a2efabbfa Original diff D20587681 breaks non-controlled text input. Reviewed By: motiz88 Differential Revision: D20815935 fbshipit-source-id: 70577ed1e5701850ff0e30a6592945a31c2a8bec * Fixed crash in JSIExecutor::NativeModuleProxy Summary: JSIExecutor::NativeModuleProxy is an object created by JSIExecutor and essentially representing that in JavaScript world. Before this change, JSIExecutor::NativeModuleProxy had a raw reference to JSIExecutor which (I believe) caused a crash because JSIExecutor can be deallocated before JSIExecutor::NativeModuleProxy. Now, instead of storing a pointer to JSIExecutor, we store a weak pointer to JSINativeModules which we can safely validate before calling on it. Changelog: [Internal] Fixed crash in JSIExecutor Now the configuration looks like this: ``` + - - - - - - - - - - - - - - - - - - - - - Something else | | shared_ptr<jsi::Runtime> runtime --+ | | + - - - - - - - - - - - - - - - - - - - - - | | | +------------------------------------------+ | | | | | JSExecutorFactory | | +--------------------------------+-------------------------------+ | | +-----------------------+ | | | +------------------------------------------+ | | v | | | +------------------------------------------+ | +--------------------------+ | | | | | | | | ModuleRegistry | | v | | | | | +------------------------------------------+ | | +------------------------------------------+ | | HermesRuntimeImpl | | | | | | (jsi::Runtime) |--+ | | +->+------------------------------------------+ | | | | | | | |std::unordered_map<std::string, size_t> | | +------------------------------------------+ | | | | |modulesByName_ | | | | | | | | | | | | | +------------------------------------------+ | | | | +->+------------------------------------------+ | +-----------------------+ | | |std::vector<std::unique_ptr<NativeModule>>| | | | | |modules_ | | | | | | | | v | | +------------------------------------------+ | +------------------------------------------+ | | | | | | | | | JSIExecutor::NativeModuleProxy | | | | | | | | | +------------------------------------------+ | | | +------------------------------------------+ | | | | | | +->+------------------------------------------+ | | | | NativeToJsBridge | |shared_ptr<JSINativeModules> | | | | | | |nativeModules_ | | | | +------------------------------------------+ +------------------------------------------+--+-----+------------------------------------+ | | | | | | +->+------------------------------------------+ | | | | | |unique_ptr<JSExecutor> | | | | | | |m_executor | | | | | | |(`::destroy()` resets it.) | | | | | | +------------------------------------------+--------------------------------+ | | | | +->+------------------------------------------+ | | | | | | |shared_ptr<JsToNativeBridge> | | | | | | | |m_delegate | | | | | | | +------------------------------------------+--+ v | | | | +->+------------------------------------------+ | +------------------------------------------+ | | | | |shared_ptr<MessageQueueThread> | | | | | | | | |m_executorMessageQueueThread | | | HermesExecutor: JSIExecutor: JSExecutor | | | | | +------------------------------------------+ | | | | | | | | +------------------------------------------+ | | | | | | | | | | | +->+------------------------------------------+ | | | | | | |shared_ptr<jsi::Runtime> | | | | | | | |runtime_ | | | | | | | +------------------------------------------+--+ | | | | +->+------------------------------------------+ | | | | | |shared_ptr<JSINativeModules> | | | | | | |nativeModules_ | | | | | | +------------------------------------------+--------+------------------------------------+ | +--------------------------+ +->+------------------------------------------+ | | | | |std::shared_ptr<ExecutorDelegate> | | v | | |delegate_ | | +------------------------------------------+ | | +------------------------------------------+--+ | | | | | | | | JSINativeModules | | | | | | | | | | | +------------------------------------------+ | | | | | | | | | +-->+------------------------------------------+ | +-----------------------------------------------------------------------------------+ | |m_moduleRegistry | | | | |(shared_ptr) | | | | +------------------------------------------+--+ | | | | v | +------------------------------------------+ | | | | | JsToNativeBridge: ExecutorDelegate | | | | | +------------------------------------------+ | | | +->+------------------------------------------+ | |shared_ptr<ModuleRegistry> | | |m_registry | | +------------------------------------------+-----------------------------------------------------------------+ ``` Reviewed By: RSNara Differential Revision: D20817257 fbshipit-source-id: 9ae378dbe880aaabfef7ae783dae2f94ee4b0af5 * Fix crash caused by <Modal> trying to present view controller twice Summary: Changelog: [Internal] `_viewController` was being presented twice causing following exception ``` 'Application tried to present modally an active controller <FBReactRootViewController: 0x7fe741818b80; ``` Reviewed By: shergin Differential Revision: D20820395 fbshipit-source-id: 5c9489011e5f99d8bd37befbd544d2d55a650589 * Loosen up restrictions for internal changelogs (#28486) Summary: Do not nag on PRs that contain internal changelogs (meaning, the change doesn't need to be called out in release notes). ## Changelog [Internal] - This should be acceptable. Pull Request resolved: https://github.com/facebook/react-native/pull/28486 Test Plan: See PR. Reviewed By: cpojer Differential Revision: D20817454 Pulled By: hramos fbshipit-source-id: a7082c4db05ec53ad27349db7e5bce2cfffd6930 * Fix TextInlineViews when UIImplementation processes two roots at the same time Summary: This diff cleans the variable NativeViewHierarchyOptimizer.mTagsWithLayoutVisited right after all the view updates for a rootShadowNode have been processed by the UIImplementation class. This intends to fix the bug reported in the task: T61185028, which root cause seems related to the fact that the variable NativeViewHierarchyOptimizer.mTagsWithLayoutVisited is not cleaned up when updating multiple rootShadowNodes as part of the same batch changelog: [Android][internal] internal bug fix Reviewed By: JoshuaGross Differential Revision: D20812921 fbshipit-source-id: 28067ee29a931d7a9e9c33c90aceb4e3512dac1a * Add a React Feature Flag to control TextInlineView fix Summary: This diff adds a temporary Feature Flag to control a fix in TextInlineView (see previous diffs of the stack) changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D20812920 fbshipit-source-id: 90fece9b29ba173546d96e4d9baf1ccabb3031b2 * Pass native CallInvoker to ObjCTurboModule constructor Summary: This is necessary to integrate TurboModule async method dispatch with the bridge's `onBatchComplete` event. See D20717931 for more details. This diff is similar to D20480971. **Note:** This stack doesn't really make any functional changes, since the native CallInvoker is `nullptr` right now. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809199 fbshipit-source-id: bf465a3a51bdddb8b56d1e696ca510fdf071f9ec * Manual changes required to make ObjCTurboModule accept native CallInvoker Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809200 fbshipit-source-id: d540eec9a3360a031f75d76a6ab9fb15303f8af5 * Codemod all getTurboModuleWithJsInvoker methods to accept a native CallInvoker Summary: To make iOS TurboModules integrate with the bridge's onBatchComplete event, they need to use a native CallInvoker. This call invoker is created by the `NativeToJsBridge`, and ObjCTurboModule will use this native CallInvoker to dispatch TurboModule method calls. This diff makes sure that ObjCTurboModules are created with that native CallInvoker. ## Script ``` var withSpaces = (...args) => args.join('\s*') var regexString = withSpaces( '-', '\(', 'std::shared_ptr', '<', '(?<turboModuleClass>(facebook::react::|react::|::|)TurboModule)', '>', '\)', 'getTurboModuleWithJsInvoker', ':', '\(', 'std::shared_ptr', '<', '(?<callInvokerClass>(facebook::react::|react::|::|)CallInvoker)', '>', '\)', '(?<jsInvokerInstance>[A-Za-z0-9]+)', 'perfLogger', ':', '\(', 'id', '<', 'RCTTurboModulePerformanceLogger', '>', '\)', '(?<perfLoggerInstance>[A-Za-z0-9]+)', '{', 'return', 'std::make_shared', '<', '(?<specName>(facebook::react::|react::|::|)Native[%A-Za-z0-9]+SpecJSI)', '>', '\(', 'self', ',', '\k<jsInvokerInstance>', ',', '\k<perfLoggerInstance>', '\)', ';', '}', ) var replaceString = `- (std::shared_ptr<$<turboModuleClass>>) getTurboModuleWithJsInvoker:(std::shared_ptr<$<callInvokerClass>>)$<jsInvokerInstance> nativeInvoker:(std::shared_ptr<$<callInvokerClass>>)nativeInvoker perfLogger:(id<RCTTurboModulePerformanceLogger>)$<perfLoggerInstance> { return std::make_shared<$<specName>>(self, $<jsInvokerInstance>, nativeInvoker, $<perfLoggerInstance>); }` const exec = require('../lib/exec'); const abspath = require('../lib/abspath'); const relpath = require('../lib/relpath'); const readFile = (filename) => require('fs').readFileSync(filename, 'utf8'); const writeFile = (filename, content) => require('fs').writeFileSync(filename, content); function main() { const tmFiles = exec('cd ~/fbsource && xbgs -n 10000 -l getTurboModuleWithJsInvoker:').split('\n').filter(Boolean); tmFiles .filter((filename) => !filename.includes('microsoft-fork-of-react-native')) .map(abspath) .forEach((filename) => { const source = readFile(filename); const newSource = source.replace(new RegExp(regexString, 'g'), replaceString); if (source == newSource) { console.log(relpath(filename)); } writeFile(filename, newSource); }); } if (!module.parent) { main(); } ``` Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809202 fbshipit-source-id: 5d39b3cacdaa5681b70ce1803351d0432dd74550 * Make RCTTurboModuleManagerDelegate getTurboModule accept native CallInvoker and PerfLogger Summary: Might be worthwhile to just kill this method instead, since we're having all NativeModules provide their TurboModule jsi::HostObjects. But I'll leave that decision to a later time. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809201 fbshipit-source-id: ee73d4b5454a76460832a54f9b864841e5b2b9c0 * eslint-config: add version badge and add homepage for eslint-config (#28506) Summary: Add version badge to README of eslint-config, and add specific url for the homepage so people looking at the npm package can find out where the package is from. ## Changelog [Internal] [Changed] - Add version badge to README of eslint-config Pull Request resolved: https://github.com/facebook/react-native/pull/28506 Test Plan: Not required as the only changes are made in README and homepage prop of package.json Differential Revision: D20837085 Pulled By: cpojer fbshipit-source-id: 820d3b44b069780ec8764c6152d2e7fd5220933c * Rename Instance::getNativeCallinvoker to Instance::getDecoratedNativeCallInvoker Summary: Now, instead of accepting a `std::function` that schedules work, and returning a `CallInvoker`, `Instance::getDecoratedNativeCallInvoker` will accept a `CallInvoker` that schedules work, and return a decorated `CallInvoker`. I think this change will help with readability. It also clarifies that the bridge is adding additional behaviour to the native `CallInvoker`. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20826885 fbshipit-source-id: a2c5681d10a4544ee3d2a0d1f1cbd386ef06d0e6 * Add CallInvoker::invokeSync Summary: We'll be using a native CallInvoker to dispatch sync and async method calls to ObjC NativeModules. This native CallInvoker will hold a reference to the ObjC NativeModule's method queue. **Why is the native CallInvoker required for ObjC NativeModules?** In the case where the ObjC NativeModule neither provides nor requests a method queue, we must create a method queue for it. When we go to invoke a method from JS, for these NativeModules specifically, there is no way to access this method queue. A native CallInvoker is a convenient abstraction that holds on to that method queue. For async calls, we'll just call `CallInvoker::invokeAsync`, and for sync calls, we'll just call `CallInvoker::invokeSync`. **Why do we need sync call support for native `CallInvoker`?** In ObjC, sync NativeModule method calls block the JS thread, then execute synchronously on the NativeModule's method queue, and then unblock the JS thread. This is what'll be implemented by `CallInvoker::invokeSync`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20829955 fbshipit-source-id: efb9d5408a1ade81069a943c865f232d4d10acfe * Export Instance::getDecoratedNativeCallInvoker from RCTCxxBridge Summary: `RCTTurboModuleManager` will create a native `CallInvoker` for each ObjC NativeModule. This `CallInvoker` will be used to dispatch calls from JS to native. Before passing the native `CallInvoker` to the `ObjCTurboModule`, it'll first use `RCTCxxBridge decorateNativeCallInvoker` to get a bridge-aware decorated native `CallInvoker`. That way, the bridge remains informed about async TurboModule method calls that took place since the last time it was flushed. This ensures that we don't end up dispatching `onBatchComplete` any less with TurboModules on than we do with TurboModules off. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20831546 fbshipit-source-id: b2eb4e0097e0dabf8c4bd8fdc4c850a0858af699 * Add Author Feedback label automatically (#28484) Summary: Improve issue triage by automatically adding the "Needs: Author Feedback" label. NOTE: The old label-actions app should be disabled when this PR is merged: https://github.com/apps/label-actions/installations/7445225 ## Changelog [Internal] - Issue Triage Pull Request resolved: https://github.com/facebook/react-native/pull/28484 Test Plan: Verified the same `label-actions.yml` and workflow config on a private repo. Reviewed By: cpojer Differential Revision: D20817443 Pulled By: hramos fbshipit-source-id: 39732dd67509c9fb9cf6ff7306913f5ec088266d * docs: add README and specify file in package.json (#28507) Summary: Adding a README for `react-native-codegen` since the package was published. Also added a `files` prop in package.json so unused file won't be included in the package. ## Changelog [Internal] [Changed] - Add README for react-native-codegen. Pull Request resolved: https://github.com/facebook/react-native/pull/28507 Test Plan: verify js files to function correctly without including files other than `src` Reviewed By: rickhanlonii Differential Revision: D20836113 Pulled By: cpojer fbshipit-source-id: e860f14760e9c1dbe121f5fb95ccf72d4ddb2af1 * Make the link easier to copy. (#28516) Summary: Making a PR from GitHub, I need to copy-paste the link, and it would be easier to just triple-click a line with the URL rather than carefully selecting the URL from the text. <img width="723" alt="Screen Shot 2020-04-03 at 17 33 47" src="https://user-images.githubusercontent.com/100233/78378550-6c12af80-75d1-11ea-93a4-2eae568ce602.png"> ## Changelog [General] [Changed] - Make PR template easier to use with changelog URL. Pull Request resolved: https://github.com/facebook/react-native/pull/28516 Reviewed By: fkgozali Differential Revision: D20842238 Pulled By: hramos fbshipit-source-id: 3fef7a994f36a996bbbc52556600d468a56210a9 * Upgrade tests to Xcode 11.3.1 (#28498) Summary: Upgrade Sandcastle and Circle CI tests to use Xcode 11.3.1 across the board. Pull Request resolved: https://github.com/facebook/react-native/pull/28498 Pull Request resolved: https://github.com/facebook/react-native/pull/28501 Changelog: [Internal] - Use Xcode 11.3.1 in iOS tests Reviewed By: fkgozali Differential Revision: D20821844 fbshipit-source-id: b250ca82bdf2c9fb7faa765d3e2433eb46efd692 * Fixes iOS reload through metro "r" command key (#28477) Summary: This allows the iOS device to be reloaded through the metro command line, besides the fact that whenever packagerServerHost is called, it will only get the IP address once when debugging. ## Changelog [iOS] [Fixed] - Fixed connection of metro reload command to iOS device Pull Request resolved: https://github.com/facebook/react-native/pull/28477 Test Plan: - Build any react-native project in debug mode to an iOS device connected through USB - Press the “r” key on the terminal that is running metro - The device should now reload the project Reviewed By: cpojer Differential Revision: D20818462 Pulled By: TheSavior fbshipit-source-id: 6d9792447d205223dad8fbd955518885427cbba8 * Create method queues for NativeModules that neither provide nor request one Summary: ## Problem: Let `A` be the set of all ObjC NativeModules that neither provide nor reqeust a method queue. The TurboModule system dispatches all method calls to NativeModules in `A` synchronously to the JS thread. Here is the relevant logic: **RCTTurboModule.mm:** Link: https://fburl.com/diffusion/nz9gqje8 ``` jsi::Value performMethodInvocation( // ... ) { // ... dispatch_queue_t methodQueue = NULL; if ([instance_ conformsToProtocol:protocol(RCTBridgeModule)] && [instance_ respondsToSelector:selector(methodQueue)]) { methodQueue = [instance_ performSelector:selector(methodQueue)]; } if (methodQueue == NULL || methodQueue == RCTJSThread) { // This is the default mode of execution: on JS thread. block(); } else if (methodQueue == dispatch_get_main_queue()) { ``` **Why does this end up happening?** 1. NativeModules that request a method queue have `synthesize methodQueue = _methodQueue` in their `implementation` section. This generates a `methodQueue` getter for the NativeModule, and also creates an ivar to back that getter. The TurboModule system generates a `dispatch_queue_t` and uses ObjC's KVC API to write to the ivar. So in the above logic, for NativeModules that provide a method queue, methodQueue will neither be `NULL` nor `RCTJSThread`, so we don't dispatch synchronously to the JS thread. 2. NativeModules that provide a method queue will return something that is not `NULL` or something that is `RCTJSThread`. If they return `NULL`, the infra will throw an error early. If they return `RCTJSThread`, we'll dispatch synchronously to the JS thread, as we should (...wait. For async NativeModule methods that dispatch to `RCTJSThread`, should we dispatch asynchronously to the JS thread, via jsInvoker? **Edit:** Nope: https://fburl.com/diffusion/ivt9b40s.). In all other cases, we dispatch to appropriately to the respective method queue. 3. For NativeModules that neither provide nor request a method queue (i.e: NativeModules in `A`), they don't implement the `methodQueue` selector. Therefore, we dispatch synchronously to the JS thread. ## The fix (Part 1): The first step towards fixing this problem is to generate `dispatch_queue_t`s for NativeModules in `A`. That's what this diff accomplishes. Changelog: [iOS][Fixed] - Create method queue for NativeModules that don't provide nor request one. Reviewed By: fkgozali Differential Revision: D20821054 fbshipit-source-id: 17a73550ad96766c5c7e719e28e1cc879e36465c * Rename duplicate name `<ScrollView>` example on RNTester (#28515) Summary: Tiny change. When searching for `scro` in the RNTester, two `<ScrollView>`s come up, from different example files. One is the "simple" one and the other is the "regular" one. Before: <img width="370" alt="Screen Shot 2020-04-03 at 17 14 01" src="https://user-images.githubusercontent.com/100233/78377338-c6ab0c00-75cf-11ea-9c45-2dcdd6460f6d.png"> After: <img width="369" alt="Screen Shot 2020-04-03 at 17 13 38" src="https://user-images.githubusercontent.com/100233/78377371-cf034700-75cf-11ea-89ea-aa3ff2f3988c.png"> ## Changelog [Internal] [Changed] - Rename the "simple" ScrollView example in RNTester to "ScrollSimpleView". Pull Request resolved: https://github.com/facebook/react-native/pull/28515 Test Plan: - Try to search for `scro` in RNTester. Reviewed By: fkgozali Differential Revision: D20842264 Pulled By: hramos fbshipit-source-id: 3db54a826ae774108e62690e7f154e85b541520f * Fix Fabric SSTs, so they actually run in Fabric instead of Paper, convert ServerSnapshotTestsAppImpl to functional component Summary: Update instrumentation test infra for Fabric tests. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D19961919 fbshipit-source-id: 17264b6308712dddece730effd57832817e148cf * Fixed scrollview inset when RN view is embedded in another view (#27607) Summary: I'm using RNN, which embeds RN view inside native view controllers. On iOS 13, a modal view controller is "floating" and is offset from the top of the screen. This causes the calculation of inset in `KeyboardAvoidingView` incorrect as it mixes local view controller coordinate space, with keyboard's screen coordinate space. ## Changelog [iOS] [Fixed] - Fixed `KeyboardAvoidingView` inset in embedded views (i.e modal view controllers on iOS 13) Pull Request resolved: https://github.com/facebook/react-native/pull/27607 Test Plan: 1. Tested before and after in a simple view controller (should stay the same) 2. Tested before and after in a modal view controller (should be offset before, and fixed after) 3. Repeated no. 2 with each device rotation (upsideDown, landscapeLeft, landscapeRight) Reviewed By: cpojer Differential Revision: D20812231 Pulled By: TheSavior fbshipit-source-id: fbd72739fb7152655028730e284ad26ff4a5da73 * Bump react-native-codegen to 0.0.2 Summary: Changelog: [Internal] Reviewed By: cpojer Differential Revision: D20843514 fbshipit-source-id: c611bf91d311c6ce8a7e469d267a0417b2ee58e5 * Rename ScrollViewSimpleExample Summary: Changelog: [Internal] - Rename ScrollViewSimpleExample in RNTester Reviewed By: fkgozali Differential Revision: D20846977 fbshipit-source-id: 397589cb0a17beaf37a25b91ad8efa4a2bc62358 * Remove console warnings for innerViewNode/Ref Summary: Remove these warnings until the methods in ScrollResponder have been moved into ScrollView, so that unactionable warnings aren't firing. Changelog: [General][Removed] Remove console warnings for innerViewNode/Ref in ScrollView Reviewed By: TheSavior Differential Revision: D20850624 fbshipit-source-id: ce90988e204c3cc3b93536842ec3caa12cf6994e * Make TurboModules dispatch method calls via native CallInvoker Summary: This diff: 1. Has ObjC NativeModules use the native `CallInvoker` to invoke JS -> native sync/async calls. 2. Integrates the native `CallInvoker` for each ObjC NativeModule with the bridge. This way, the bridge is informed of all JS -> native TurboModule method calls, and dispatches `onBatchComplete` appropriately. Changelog: [iOS][Fixed] Integrate ObjC TurboModules async method calls with the bridge Reviewed By: fkgozali Differential Revision: D20831545 fbshipit-source-id: da1cbb4ecef4cae85841ca7ef625ab8e380760cd * add ripple config object to Pressable (#28156) Summary: Motivation is to support ripple radius just like in TouchableNativeFeedback, plus borderless attribute. See https://github.com/facebook/react-native/pull/28009#issuecomment-589489520 In the current form this means user needs to pass an `android_ripple` prop which is an object of this shape: ``` export type RippleConfig = {| color?: ?ColorValue, borderless?: ?boolean, radius?: ?number, |}; ``` Do we want to add methods that would create such config objects - https://facebook.github.io/react-native/docs/touchablenativefeedback#methods ? ## Changelog [Android] [Added] - support borderless and custom ripple radius on Pressable Pull Request resolved: https://github.com/facebook/react-native/pull/28156 Test Plan: Tested locally in RNTester. I noticed that when some content is rendered after the touchables, the ripple effect is "cut off" by the boundaries of the next view. This is not specific to Pressable, it happens to TouchableNativeFeedback too but I just didn't notice it before in https://github.com/facebook/react-native/pull/28009. As it is an issue of its own, I didn't investigate that. ![pressable](https://user-images.githubusercontent.com/1566403/75098762-785f2200-55ba-11ea-8842-e648317610e3.gif) I changed the Touchable example slightly too (I just moved the "custom ripple radius" up to show the "cutting off" issue), so just for completeness: ![touchable](https://user-images.githubusercontent.com/1566403/75098763-81e88a00-55ba-11ea-9528-e0343d1e054b.gif) Reviewed By: yungsters Differential Revision: D20071021 Pulled By: TheSavior fbshipit-source-id: cb553030934205a52dd50a2a8c8a20da6100e23f * Make TurboModule creation thread-safe Summary: NativeModules can be created from any number of threads. In the legacy system, `ModuleHolder`, the class responsible for creating NativeModules, has built-in concurrency control to ensure that NativeModule creation is thread-safe. This diff introduces that thread-safety to the TurboModule infra. Basically, after this diff, if `n` threads race to create a TurboModule x, only the first thread will create x. All other threads will wait until x is created. Changelog: [Android][Fixed] - Make TurboModule creation thread-safe Reviewed By: mdvacca Differential Revision: D20659799 fbshipit-source-id: 2b720fe1ea49e40ae0d6dae50d422f23a6f45520 * Remove unused fields from error dialog Summary: Removed in https://github.com/facebook/react/pull/18487 Changelog: [React Core] Logging changes Reviewed By: gaearon Differential Revision: D20853086 fbshipit-source-id: 4b0002f21269f415769a2ac8305ba5750245f7d1 * Fix crash when enabling Performance Monitor on iOS 13.4 (#28512) Summary: This PR fixes a crash when opening the Performance Monitor on iOS 13.4. Detailed info: https://github.com/facebook/react-native/issues/28414 ## Changelog `[iOS] [Fixed] - Fix crash when enabling Performance Monitor on iOS 13.4` ## How This PR prevents the JavaScriptCore option from being set altogether. This ensures that the performance monitor keeps working, but on iOS 13.4 and higher, it will no longer crash trying to show the GC usage. Pull Request resolved: https://github.com/facebook/react-native/pull/28512 Test Plan: Tested on iOS 13.4 (simulator): ![image](https://user-images.githubusercontent.com/6184593/77903803-c6370c00-7283-11ea-8b71-b6b6546c82f6.png) Tested on iOS 13.1 (simulator) ![image](https://user-images.githubusercontent.com/6184593/77903499-41e48900-7283-11ea-9d14-83f67a3b7b77.png) - Verified that the `setOption` was called, but the Performance Monitor didn't show any GC usage regardless. - Identical PR https://github.com/expo/react-native/pull/21 has been shipped and tested in Expo Client 37 Fixes https://github.com/facebook/react-native/issues/28414 Reviewed By: PeteTheHeat Differential Revision: D20851131 Pulled By: TheSavior fbshipit-source-id: ff96301036e8487db59f95947bbe6841fe230e1e * Modify warning message (#28514) Summary: Modify deprecation warning message for `AccessibilityInfo.fetch` - https://reactnative.dev/docs/accessibilityinfo#isscreenreaderenabled - https://github.com/facebook/react-native/commit/523ab8333800afbfb169c6fd70ab6611fe07cc2a ## Changelog [Internal] [Changed] - Modify deprecation warning message for `AccessibilityInfo.fetch` Pull Request resolved: https://github.com/facebook/react-native/pull/28514 Test Plan: Try using `AccessibilityInfo.fetch` and check log Reviewed By: cpojer Differential Revision: D20850223 Pulled By: TheSavior fbshipit-source-id: e21bb20b7a02d9f2ed6e27e2bfecbac0aebf9e09 * Set _borderLayer.frame when border changes Summary: Changelog: [Internal] Setting `_borderLayer.frame` inside `-[RCTViewComponentView layoutSubviews]` causes unwanted animation because it is not wrapped in `CATransaction`. Moving it to `-[RCTViewComponentView updateLayoutMetrics]` which is called inside `CATransaction`. Reviewed By: shergin Differential Revision: D20836890 fbshipit-source-id: 2048a25fd2edb8109f6275c1186c0adae4b9f504 * Add API for getting sourceURL directly from ReactContext Summary: In bridgeless mode, the CatalystInstance doesn't exist, but we still need to be able to access the sourceURL in SourceCodeModule (which is needed to render the images in LogBox warnings and errors). This diff adds a new API for getting the sourceURL directly from ReactContext, instead of having to call context.getCatalystInstance().getSourceURL(), and updates SourceCodeModule to use it. Changelog: [Internal] Reviewed By: RSNara Differential Revision: D20848700 fbshipit-source-id: 3ecda81a17121178b76bbb3e9b0f27f103c1961a * imp: Remove unused `npx` reference (#28544) Summary: Recently we removed `npx` usage from `react-native-cli` flow. After checking usages in this repo I found unused reference. ## 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] [Removed] - Remove unused `npx` reference Pull Request resolved: https://github.com/facebook/react-native/pull/28544 Test Plan: Tests pass Reviewed By: cpojer Differential Revision: D20873090 Pulled By: hramos fbshipit-source-id: 12e05e9635a83f19439024766817e4599320af98 * Add debug logs to track down T62192299 exception source Summary: Add debug logs to track down T62192299 exception source Changelog: [Internal] Reviewed By: RSNara Differential Revision: D20878063 fbshipit-source-id: 94acd56c45d4b529a695d1b4d2bfd10d8f725e63 * Back out "Fixed scrollview inset when RN view is embedded in another view" Summary: Original commit changeset: fbd72739fb71 Changelog: Back out "[react-native][PR] Fixed scrollview inset when RN view is embedded in another view" Reviewed By: TheSavior Differential Revision: D20878607 fbshipit-source-id: 0d77b9fb08c637f7894c399a219a242e472b0700 * Fail silently in AppStateModule.sendEvent if CatalystInstance is not available Summary: According to our logs, 80% of these warnings are coming from AppStateModule. It's not particularly interesting or surprising that the CatalystInstance would be torn down when there's some app event, so let's stop taking up DB space with a useless message. Reviewed By: ejanzer, mdvacca Differential Revision: D20879426 fbshipit-source-id: b1182461aed4a66d82cb34bbd4b12782af6ed7b3 * Move DebugEnvironment helper to open source Summary: This is an internal only module that we use to detect whether we are in async debugging mode. Changelog: [Internal] Reviewed By: yungsters Differential Revision: D20879780 fbshipit-source-id: 5915f4e1c54a3fda0cf607c77f463120264fdbc4 * Fix Appearance module when using Chrome Debugger Summary: The appearance module uses sync native module methods which doesn't work with the chrome debugger. This broke in 0.62: https://github.com/facebook/react-native/issues/26705 This fix makes the appearance module return 'light' when using the chrome debugger. Changelog: [Fixed] Appearance `getColorScheme` no longer breaks the debugger Reviewed By: yungsters Differential Revision: D20879779 fbshipit-source-id: ad49c66226096433bc9f270e004ad4a6f54fa8c2 * Extend Android ImageViewManager to support analyticsTag prop Summary: This diff extends the Android Image View manager to support the new analyticsTag prop. this prop is going to be used to track performance for images in android changelog: [Android][Added] Add analyticsTag prop into ImageView component Reviewed By: JoshuaGross Differential Revision: D20880602 fbshipit-source-id: e302e8fa83706e6517b228d44a3094a1686830f7 * Extend Image.android to support analyticsTag prop Summary: Quick diff to extend Image.android component to support analytics tag prop changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D20880601 fbshipit-source-id: 99bc11f36ce46953c00480f7c8d628cf6c0a9263 * Create ImageContext object to allow udpating the analyticsTag prop for RN sections Summary: As part of this diff I create the new ImageContext object that will be used to allow the update of the analyticsTag prop for components that contain multiple images in their view hierarchy changelog: [JS][Added] Add ImageContext object, this object can be used to update the Imageview's analyticsTag prop on RN components that contain multiple images in their view hierarchy Reviewed By: JoshuaGross Differential Revision: D20880603 fbshipit-source-id: f2094bfd3ab1c867cf7c107e678a098aab7e94a8 * Ez cleanup in ImageProps Summary: Ez cleanup in ImageProps, this import is not being used anymore changelog: [internal] internal change Reviewed By: JoshuaGross Differential Revision: D20880600 fbshipit-source-id: 7d903b5a6e16c37e61dec661b6bd1f9a6b442cc3 * Exclude all FlipperKit transitive dependencies from iOS Release builds (#28504) Summary: The `:configuration` option from `pod` only affects the specified pod and not its dependencies [1]. Therefore in order to avoid all transitive dependencies being linked in the resulting Release IPA we need to list them in the `Podfile`. Note that this will still build Flipper's pods when doing a Release, but it won't link it in the resulting IPA. [1] https://guides.cocoapods.org/syntax/podfile.html#pod Fixes https://github.com/react-native-community/upgrade-support/issues/28 Related https://github.com/CocoaPods/CocoaPods/issues/9658 ## Changelog * [iOS] [Fixed] - Exclude Flipper from iOS Release builds Pull Request resolved: https://github.com/facebook/react-native/pull/28504 Test Plan: Create a new React Native 0.62 project, run `pod install`, then diff: ``` ProjectName/ios/Pods/Target Support Files/Pods-ProjectName/Pods-ProjectName.debug.xcconfig` ``` and ``` ProjectName/ios/Pods/Target Support Files/Pods-ProjectName/Pods-ProjectName.relaese.xcconfig ``` ![image](https://user-images.githubusercontent.com/855995/78337679-a3fa0280-7591-11ea-8142-6f82cbc6be58.png) Reviewed By: passy Differential Revision: D20894406 Pulled By: priteshrnandgaonkar fbshipit-source-id: 680780f0f5a85fd8423b85a271a499bd12f06d00 * Fix crash in FabricUIManager.onMeasure Summary: Changelog: [Internal] The cause of crash was `NullPointerException`, which happened because of `mReactContextForRootTag.get(rootTag)` returning `null`. This is solved by checking whether it returns `null` before passing it to `I18nUtil`. Reviewed By: mdvacca Differential Revision: D20890623 fbshipit-source-id: c884c6838b83b944a5438375a4c060c1f5b1dc6e * Fix flow types of ImageContext Summary: ez diff to Fix flow types of ImageContext changelog: [internal] internal change to update flow types of ImageContext Reviewed By: TheSavior Differential Revision: D20883647 fbshipit-source-id: 6dba83ab431e56a71f96c39005ebcccf39a7da9a * Avoid passing analyticsTag prop to native if this is set to null Summary: This diff avoids passing the analyticsTag prop to native if this is set to null changelog: [internal] internal optimization Reviewed By: TheSavior Differential Revision: D20904498 fbshipit-source-id: f1ea1e5aa3199ef073668df86ca7cf6e20f70c5b * Rename analyticsTag -> internal_analyticsTag in ImageView component Summary: This diff renames the analyticsTag prop for the intenral_analyticsTag in ImageView component changelog: [internal] Creation of internal_analyticTag prop in ImageView, for now this prop is meant to be used internally. Reviewed By: TheSavior Differential Revision: D20904497 fbshipit-source-id: 2a28f746772ee0f9d657ec71549020c1f3e9d674 * Make Vibration.vibrate compatible with TurboModules (#27951) Summary: This PR fixes a compatibility issue with the Vibration module and TurboModules. The TurboModules spec doesn't allow nullable arguments of type Number, causing the following problem: ![IMG_3758](https://user-images.githubusercontent.com/1247834/73803879-10be6f80-4790-11ea-92d4-a008f0007681.PNG) ## Changelog [iOS] [Fixed] - Make Vibration library compatible with TurboModules. Pull Request resolved: https://github.com/facebook/react-native/pull/27951 Test Plan: Just submitted a PR to my own app to fix the issue [here](https://github.com/rainbow-me/rainbow/pull/340) The problem should be reproducible on RNTester due to this line: https://github.com/facebook/react-native/blob/91f139b94118fe8db29728ea8ad855fc4a13f743/RNTester/js/examples/Vibration/VibrationExample.js#L66 and should be working on this branch. Reviewed By: TheSavior Differential Revision: D19761064 Pulled By: hramos fbshipit-source-id: 84f6b62a2734cc09d450e906b5866d4e9ce61124 * Fix Cocoapods builds Summary: ## Problem For some reason, D20831545 broke the `use_frameworks!` build of RNTester. ## Building RNTester ``` pushd ~/fbsource/xplat/js/react-native-github/RNTester && USE_FRAMEWORKS=1 pod install && open RNTesterPods.xcworkspace && popd; ``` ## Error I built RNTester locally, and the error was this: ``` Undefined symbols for architecture x86_64: "facebook::jsi::HostObject::set(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&, facebook::jsi::Value const&)", referenced from: vtable for facebook::react::ObjCTurboModule in RCTImageEditingManager.o vtable for facebook::react::ObjCTurboModule in RCTImageLoader.o vtable for facebook::react::ObjCTurboModule in RCTImageStoreManager.o "facebook::jsi::HostObject::getPropertyNames(facebook::jsi::Runtime&)", referenced from: vtable for facebook::react::ObjCTurboModule in RCTImageEditingManager.o vtable for facebook::react::ObjCTurboModule in RCTImageLoader.o vtable for facebook::react::ObjCTurboModule in RCTImageStoreManager.o ld: symbol(s) not found for architecture x86_64 ``` ## Fix It looked like libraries that depend on "ReactCommon/turbomodule/core" weren't linking to JSI correctly. So, I modified all such Podspecs to also depend on "React-jsi": ``` arc rfr ' s.dependency "ReactCommon/turbomodule/core", version' ' s.dependency "ReactCommon/turbomodule/core", version\n s.dependency "React-jsi", version' ``` This seemed to do the trick. In buck, we'd fix this problem using exported_dependencies. I skimmed through cocoapods, and couldn't find such a configuration option there. So, I guess this will have to do? Changelog: [iOS][Fixed] - Fix Cocoapods builds of RNTester Reviewed By: fkgozali, hramos Differential Revision: D20905465 fbshipit-source-id: 60218c8274ec165752a428f2a7a9a546607c8fec * Add minimumSize to RCTRootView & RCTRootShadowView Summary: This adds a `minimumSize` property to RCTRootView, and forwards any changes to it's shadow view. This **does not** change any default behaviour, as the default minimum size is `CGSizeZero` before & after this diff. Changelog: [iOS][Internal] Add minimumSize to RCTRootView & RCTRootShadowView Reviewed By: RSNara Differential Revision: D20905456 fbshipit-source-id: a03f880e782891f60ef86b9c898965e05a5e796e * Make RCTNativeAnimatedModule into a TurboModule Summary: D20831545 integrated TurboModules with the bridge's `onBatchComplete` event. This fixed the RCTNativeAnimatedModule jank, so I'm re-converting RCTNativeAnimatedModule into a TurboModule. Changelog: [iOS][Fixed] - Make RCTNativeAnimatedModule TM-compatible Reviewed By: PeteTheHeat Differential Revision: D20850744 fbshipit-source-id: bb85a1bb27963e7d39bf149d0a3d7b71c88175da * upgrade to flow 0.122.0 Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D20919782 fbshipit-source-id: 3d5dc54ea4daafb8a1d96cad6c35a2dab4c24097 * Switch order of onSelectionChange and onChange events send from native Summary: Changelog: [Internal] UIKit uses either `UITextField` or `UITextView` as its UIKit element for `<TextInput>`. `UITextField` is for single line entry, `UITextView` is for multiline entry. There is a problem with order of events when user types a character. In `UITextField` (single line text entry), typing a character first triggers `onChange` event and then `onSelectionChange`. JavaScript depends on this order of events because it uses `mostRecentEventCount` from this even to communicate to native that it is in sync with changes in native. In `UITextView` (multi line text entry), typing a character first triggers `onSelectionChange` and then `onChange`. As JS depends on the correct order of events, this can cause issues. An example would be a TextInput which changes contents based as a result of `onSelectionChange`. Those changes would be ignored as native will throw them away because JavaScript doesn't have the newest version. Reviewed By: JoshuaGross Differential Revision: D20836195 fbshipit-source-id: fbae3b6c0d388fc059ca2541ae980073b8e5f6c7 * Maintain selection and cursor location when setting string on TextInput Summary: Changelog: [Internal] Calling `_backedTextInputView.attributedText = attributedString` causes cursor to be moved to the end of text input. This applies to both, `UITextField` and `UITextView`. This is not desired as when JS sets a new text, we don't want the cursor to be moved to the end of text input. JS has the option to use view commands if it wishes to move cursor somewhere. Reviewed By: JoshuaGross Differential Revision: D20836201 fbshipit-source-id: 9234e54cfbc5fc206f723626988e505275788aae * Implement event count for TextInput Summary: Changelog: [Internal] Implementation of event count for Fabric's Text input. Reviewed By: JoshuaGross Differential Revision: D20800185 fbshipit-source-id: 988692cb2fc786649821cccb06e629b40b9b0479 * Migrate setNativeProps to commands in iOS text input Summary: Changelog: Move from setNativeProps to ViewCommands. Reviewed By: JoshuaGross Differential Revision: D20843018 fbshipit-source-id: 9be9d2bbee01f2e15279e3c3ae785c1a5b163765 * Update default Podfile to not depend on a path (#28572) Summary: Recently, a default Podfile has been modified to not contain all the React Native pods, but use a helper method `use_react_native!`. While this is great, it assumes a hardcoded path of `../node_modules/react-native` to be always the correct location of the React Native. https://github.com/facebook/react-native/blob/d4d8887b5018782eeb3f26efa85125e6bbff73e4/scripts/autolink-ios.rb#L7-L9 Unfortunately, due to the way Ruby works, this completely hides the path away from the users. Before, they could have seen the wrong path explicitly in a Podfile and knew to update it to resolve path-related issues. With the current version in `master`, I can see a lot of issues where developers wonder how to resolve the path issues and how to pass the path itself. https://github.com/facebook/react-native/blob/4118d798265341061105f3a53550db83c66a71cb/template/ios/Podfile#L5-L10 This PR uses React Native CLI configuration (that is already used to link 3rd party dependencies) to explicitly define the correct path to the React Native. As a result, we don't have to change the paths here whether we're running monorepo or not. ## Changelog [IOS] [INTERNAL] - Always provide an explicit path to React Native Pull Request resolved: https://github.com/facebook/react-native/pull/28572 Differential Revision: D20945194 Pulled By: TheSavior fbshipit-source-id: 010f9754f2ed78ef62fd52f4d201f296f5af6d27 * chore: update CLI * fix: do not throw on missing `cliPath`, use the default value (#28625) Summary: The `cliPath` has always been optional value and in fact, even had its default value hardcoded in the React gradle file. In this PR, I am just taking use of it and remove throwing an error, which is going to be a really annoying breaking change. ## Changelog [ANDROID] [INTERNAL] - Don't require `cliPath` Pull Request resolved: https://github.com/facebook/react-native/pull/28625 Test Plan: Run Android project, everything works. Provide custom `cliPath`, it gets respected Reviewed By: cpojer Differential Revision: D21044222 Pulled By: TheSavior fbshipit-source-id: 8029f988d92abb9f64f30e05932c0d407d0c997e * chore: remove Kotlin version from the default template * (eslint-config) update community eslint plugin in eslint config (#28642) Summary: Updating the community eslint-plugin used in the eslint-config to the latest version. expecting new eslint-config version to be released with this change so that it can be included in new project template for 0.63 https://github.com/react-native-community/releases/issues/186 ## 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] - Update community eslint plugin in the eslint config Pull Request resolved: https://github.com/facebook/react-native/pull/28642 Test Plan: yarn lint passes Differential Revision: D21048976 Pulled By: cpojer fbshipit-source-id: 2c3ec0ef450cf357d8c88db7873f4ca1154b2034 * [0.63.0-rc.0] Bump version numbers * Upgrade Hermes dependency to 0.5.0 Summary: Use the latest published release of hermes-engine. Update RN to invoke `hermesc` instead of `hermes`. Changelog: [Android] [Changed] - Upgraded to Hermes 0.5.0 allow-large-files Reviewed By: mhorowitz Differential Revision: D20998564 fbshipit-source-id: 4824e273bcb044029a5a7e9379f168d3da47da50 * Remove the post install step (#28651) Summary: Removes the post install step for Flipper, as the latest version of YogaKit is compatible with swift 5. cc alloy ## 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 --> [Flipper] [Template] - Remove the post install step for Flipper Pull Request resolved: https://github.com/facebook/react-native/pull/28651 Test Plan: Tested a newly created RN app without post install step and it built successfully. Reviewed By: passy Differential Revision: D21064653 Pulled By: priteshrnandgaonkar fbshipit-source-id: da56d0754d918e30a0ebe480c77590f0139d48ac * Allow iOS PlatformColor strings to be ObjC or Swift UIColor selectors (#28703) Summary: Per discussion in https://github.com/react-native-community/releases/issues/186 the iOS `PlatformColor()` function is documented to use the semantic color names provided by the system. The referenced HIG documentation itself links to the `UIColor` documentation for semantic colors names. However, these names differ depending on if you are viewing the new Swift API docs or the Objective C docs. The current Objective C implementation in react-native assumes Objective C UIColor selector names that are suffixed 'Color'. But in Swift, Apple provides a Swift Extension on UIColor that makes aliases without the the 'Color' suffix and then makes the original selectors invalid presumably via `NS_UNAVAILABLE_SWIFT`. Since both selector names are valid depending on if you are using Objective C or Swift, let's make both forms be legal for `PlatformColor()`. In `RCTConvert.m` there is a dictionary of legal selector names. The code already supports the ability to have names be aliases of other selectors via a RCTSelector metadata key. The change adds code to the initialization of the map: it iterates over the keys in the map, which are all ObjC style UIColor selectors, and creates aliases by duplicating the entries, creating key names by stripping off the ObjC "Color" suffix, adds the RCTSelector key referring to the original and then appends these new Swift aliases to the map. ## Changelog [iOS] [Changed] - Allow iOS PlatformColor strings to be ObjC or Swift UIColor selectors Pull Request resolved: https://github.com/facebook/react-native/pull/28703 Test Plan: The PlatformColorExample.js is updated to use the new, shorter Swift selector names. There are still other examples in the same file and in unit tests that exercise the ObjC selector names. <img width="492" alt="PlatformColor" src="https://user-images.githubusercontent.com/30053638/79809089-89ab7d00-8324-11ea-8a9d-120b92edeedf.png"> Reviewed By: shergin Differential Revision: D21147404 Pulled By: TheSavior fbshipit-source-id: 0273ec855e426b3a7ba97a87645859e05bcd4126 * Fix folly::dynamic crash when attaching a debugger to Hermes Summary: folly_futures was compiled with and exported -DFOLLY_MOBILE=1, while folly_json did not. This flag disables fancy F14 data structures for folly::dynamic in favor of a simple std::unordered_map. This caused inlined/templated code from modules depending on folly_futures to disagree with the implementations in folly_json, leading to a crash. The only such libraries were libhermes-inspector and (transitively) libhermes-executor-debug, and these only use folly::dynamic for CDP serialization, which is why the problem was not more apparent. Changelog: [Internal] Fix crash when attaching a Hermes debugger Reviewed By: mhorowitz Differential Revision: D21193307 fbshipit-source-id: 2b795bb6f4f7f991e2adaacec62d62616117322b * Update react.gradle (#28776) Summary: Running `./gradlew assembleRelease` fails as the path to the CLI contains a new line at the end. We don't run this command in `debug` mode, hence it passed the testing. My bad. Fixed, checked in both `debug` with `bundleInDebug: true` and `release`. Fixes https://github.com/facebook/react-native/issues/28700 ## Changelog [INTERNAL] [ANDROID] - Fix `React.gradle` to build Android apps in production Pull Request resolved: https://github.com/facebook/react-native/pull/28776 Test Plan: Running `./gradlew assembleRelease` works Reviewed By: hramos Differential Revision: D21287789 Pulled By: TheSavior fbshipit-source-id: dc3ec8eef7a919b072b562d2bd455e2f704bc083 * Revert D21064653: Remove the post install step Differential Revision: D21064653 Original commit changeset: da56d0754d91 fbshipit-source-id: 1086cfdeca9aa3830370ea115ba7b5f05d3fb124 * Bump @react-native-community/eslint-config in new app template Summary: Changelog: [Changed][General] Update react-native-community/eslint-config to 1.1.0, adding the new color rule Reviewed By: rickhanlonii Differential Revision: D21342153 fbshipit-source-id: ac1367353d4d3e69b6df29dc16f9fcb60cde3519 * [0.63.0-rc.1] Bump version numbers * Upgrade Flipper to 0.37.0 (#28545) Summary: Bump flipper to 0.37 for both iOS and Android [Android] [Changed] - Upgrade Flipper to 0.37.0 [iOS] [Changed] - Upgrade Flipper to 0.37.0 Pull Request resolved: https://github.com/facebook/react-native/pull/28545 Test Plan: RNTester build pass Reviewed By: rickhanlonii Differential Revision: D20930069 Pulled By: hramos fbshipit-source-id: a7cb719da3e51e6a42d27d5e64bc664398d0d3c5 * Enable with CocoaPods `:configuration` (#28796) Summary: ~~⚠️ Depends on https://github.com/facebook/flipper/pull/1086 and a new Flipper release.~~ Fixes https://github.com/facebook/react-native/commit/17f025bc26da13da795845a3f7daee65563420c0#commitcomment-38831234 Currently user’s are being told to add a definition of the `FB_SONARKIT_ENABLED` macro and examples, including those in stock React Native templates, set this for the user by making use of a `post_install` hook in the user’s `Podfile`. This leads to confusion, fragile code [when a user’s project dir structure deviates from vanilla], and is ultimately not necessary as CocoaPods already has dedicated mechanisms to: * specify build settings (through the `xcconfig` property); * and selectively include certain pods only in certain build configurations (e.g. debug). ## 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] [Changed] - Entirely control Flipper being enabled through inclusion in Podfile and optionally limiting to certain build configurations using the `:configuration` directive. Pull Request resolved: https://github.com/facebook/react-native/pull/28796 Test Plan: Tested using the changes of https://github.com/facebook/flipper/pull/1086 in a new app that uses RN `master`. Reviewed By: priteshrnandgaonkar Differential Revision: D21449754 Pulled By: passy fbshipit-source-id: 9ff7c7f4ffc32b364b1edd82b94e0b80c3997625 * Pressable: Rename pressRectOffset to pressRetentionOffset to be consistent with other touchables Summary: Text and the other Touchables have this prop called pressRetentionOffset. Pressable should be consistent with that. Changelog: [Breaking][General]: Pressable: Rename pressRectOffset to pressRetentionOffset to be consistent with other touchables Reviewed By: yungsters Differential Revision: D21552255 fbshipit-source-id: 31e64bad9e48ac98e4934dd2f4c0a7f526de5cb6 * iOS: Fix Animated image crash when CADisplayLink target in RCTWeakProxy is nil Summary: When self is nil, this may crash in RCTUIImageViewAnimated.m. ``` _displayLink = [CADisplayLink displayLinkWithTarget:[RCTWeakProxy weakProxyWithTarget:self] selector:selector(displayDidRefresh:)]; ``` Replace `RCTWeakProxy` with a concrete class `RCTDisplayWeakRefreshable` that has the displayDidRefresh method, that calls the displayDidRefresh method in its weak target. https://github.com/facebook/react-native/pull/28070#issuecomment-619295254 Changelog: [iOS] [Fixed] - Fix Animated image crash when CADisplayLink target in RCTWeakProxy is nil Reviewed By: shergin Differential Revision: D21419385 fbshipit-source-id: da7c3c38f81ea54f633da7f59359e07680ea2faf * Pressable: Add Support for Inspector Overlay Summary: Adds support for the debug overlay (enabled via the Inspector) that the legacy touchable components supported. Changelog: [General][Added] - Added Inspector overlay support for Pressable Reviewed By: TheSavior Differential Revision: D21614412 fbshipit-source-id: b884e04f8dba1bfd35e61de25d33d6d47bc34b03 * Changed iOS LaunchScreen from xib to storyboard (#28239) Summary: > Starting April 30, 2020, all apps submitted to the App Store must use an Xcode storyboard to provide the app’s launch screen and all iPhone apps must support all iPhone screens. Updated iOS Launch screen as per [App Store policy change](https://developer.apple.com/news/?id=03042020b). Community discussion: https://github.com/react-native-community/discussions-and-proposals/issues/209 ## Changelog Changed iOS Launch Screen from a `xib` to `storyboard`. The `LaunchScreen.xib` file has been replaced with `LaunchScreen.storyboard`. Xcode automatically picks up the new Launch Screen no additional change is required. [iOS] [Deleted] - Deleted LaunchScreen.xib [iOS] [Added] - Added LaunchScreen.storyboard Pull Request resolved: https://github.com/facebook/react-native/pull/28239 Test Plan: Build the Xcode project under `template/iOS` and verify that the new launch screen is identical to the previous one. Reviewed By: cpojer Differential Revision: D20408892 Pulled By: hramos fbshipit-source-id: 9c38df58d1304088a23f3d73e0fbd87675804f1a * Fix debugging on android for 0.63 (#29204) Summary: Currently on react native 0.63-rc.0 and 0.63-rc.1 enabling debugging throws an exception. It looks like something may have been missed in unregistering JSDevSupport in this commit c20963e ![crash](https://user-images.githubusercontent.com/14797029/85500252-2acae400-b5b1-11ea-938a-674b55e649b2.gif) This should fix https://github.com/facebook/react-native/issues/28746 and https://github.com/facebook/react-native/issues/29136 ## Changelog [Android] [Fixed] - Fix crash when enabling debug Pull Request resolved: https://github.com/facebook/react-native/pull/29204 Test Plan: To recreate the bug: npx react-native init RN063 --version 0.63.0-rc.1 react-native start react-native run-android Enable debug mode from react native dev menu After this commit, the crash no longer occurs ![non crash](https://user-images.githubusercontent.com/14797029/85500241-269ec680-b5b1-11ea-8cfe-85bfda4dd222.gif) Reviewed By: TheSavior Differential Revision: D22395406 Pulled By: RSNara fbshipit-source-id: 046df77ae1c1de96870fb46f409d59e7d6a68c0d * [0.63.0] Bump version numbers * Add ProGuard rule for hermes (#28571) Summary: This adds a ProGuard for `hermes` rule so it does not have to be added by users manually. https://github.com/facebook/react-native/issues/28270 ## 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 --> [Android] [Added] - ProGuard rule for hermes Pull Request resolved: https://github.com/facebook/react-native/pull/28571 Test Plan: 1. Create a project with/without hermes. 2. Enable proguard. Reviewed By: cpojer Differential Revision: D20947095 Pulled By: hramos fbshipit-source-id: 79b166ad2dd060f20041d9f5cfe2f794c754843d * Fix rounded border drawing when border-radius is smaller than border-width (#28358) Summary: This PR fixes the drawing of the border rounded edges when the border-radius is small than the border-width. The current implementation capped the possible border-radius making it impossible to set smaller border-radii when using thicker borders. After inspection it was found that the rounded-rect calculation is incorrect. ## Changelog `[Android] [Fixed] - Fix rounded border-drawing when border-radius is smaller than border-width` Pull Request resolved: https://github.com/facebook/react-native/pull/28358 Test Plan: **Faulty situation:** As you can see, when the border-radius becomes very low, the border is stuck at a minimum value. Only after setting the border-radius fully to 0 is it again rendered correctly. ![ezgif com-video-to-gif (2)](https://user-images.githubusercontent.com/6184593/77183540-c3435b00-6ace-11ea-950d-29a0ea1757bd.gif) **After the fix:** ![ezgif com-video-to-gif (3)](https://user-images.githubusercontent.com/6184593/77183619-e837ce00-6ace-11ea-93a5-910127d352b7.gif) Differential Revision: D21124739 Pulled By: shergin fbshipit-source-id: cefd1776b77b5b9fb335e95fd7fdd7f345579dc4 * Fix border-stroke drawing after resetting border-radius (#28356) Summary: This PR fixes incorrect drawing of the View borders on Android, after changing the border-radius back to 0 *(and when no background-color is defined)*. This happens because the `drawRoundedBackgroundWithBorders` function in ReactViewBackgroundDrawable changes the style on the Paint object to `STROKE`. This style is however never reverted back to `FILL`. This change ensures that the Paint style is set to `FILL` for the full execution of the `drawRectangularBackgroundWithBorders` function. ## Changelog `[Android] [Fixed] - Fix border-drawing when changing border-radius back to 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28356 Test Plan: **Faulty situation:** ![ezgif com-video-to-gif](https://user-images.githubusercontent.com/6184593/77153163-9759b280-6a99-11ea-82bb-33a1e0a4934c.gif) **After the fix:** ![ezgif com-video-to-gif (1)](https://user-images.githubusercontent.com/6184593/77153825-c91f4900-6a9a-11ea-8e0c-a4280b9e72b8.gif) Differential Revision: D21124741 Pulled By: shergin fbshipit-source-id: 2044f8e8ad59a58df42b64d7ee8c4ad1d3b562f1 * Fixes TextInput shaking when typing Chinese (#28805) Summary: Fixes https://github.com/facebook/react-native/issues/28488. ## Changelog [iOS] [Fixed] - Fixes TextInput shaking when typing Chinese Pull Request resolved: https://github.com/facebook/react-native/pull/28805 Test Plan: Demo see https://github.com/facebook/react-native/issues/28488. Differential Revision: D21376803 Pulled By: shergin fbshipit-source-id: b1fe6cc5f67d42ef98a6c12b8ab9990feac0e2a7 * Set black as default text color for <TextInput/> on iOS (#28708) Summary: This is a follow-up pull request to https://github.com/facebook/react-native/issues/28280 (reviewed by shergin). This pull request tried to solve the problem of the default color in a TextInput in dark mode on iOS being white instead of black. I got suggested to solve the problem not on the level of RCTTextAttributes, but on the level of RCTUITextField. Setting `self.textColor = [UIColor black];` in the constructor did not work, because it gets overwritten by nil in `RCTBaseTextInputView.m`. There I implemented the logic that if NSForegroundColorAttributeName color is nil then the color is being set to black. I think the `defaultTextAttributes` property confuses here, because it ends up being the effective text attributes, e.g. if I unconditionally set the default text color to black, it cannot be changed in React Native anymore. So I put the nil check in. ## Changelog [iOS] [Fixed] - TextInput color has the same default (#000) on iOS whether in light or dark mode Pull Request resolved: https://github.com/facebook/react-native/pull/28708 Test Plan: I have manually tested the following: - The default text color in light mode is black - The default text color in dark mode is black - The color can be changed using the `style.color` attribute - Setting the opacity to 0.5 results in the desired behavior, the whole TextInput becoming half the opacity. – Setting the `style.color` to rgba(0, 0, 0, 0.5) works as intended, creating a half-opaque text color. Differential Revision: D21186579 Pulled By: shergin fbshipit-source-id: ea6405ac6a0243c96677335169b214a2bb9ccc29 * Enable array buffers in JSCRuntime.cpp (#28961) Summary: The JavaScriptCore implementation of JSI [does not currently support array buffers](https://github.com/facebook/react-native/blob/master/ReactCommon/jsi/JSCRuntime.cpp#L925-L943). The comments in the code suggest the JSC version used by React Native does not work with array buffers, but this seems to be out of date since the current version of JSC used by React Native does indeed support array buffers. This change just enables array buffers in JSCRuntime.cpp. NOTE: See https://github.com/react-native-community/discussions-and-proposals/issues/91#issuecomment-632371219 for more background on this change. ## Changelog [General] [Added] - Support for array buffers in the JavaScriptCore implementation of JSI Pull Request resolved: https://github.com/facebook/react-native/pull/28961 Test Plan: To test these changes, I just made some temporary changes to RNTester to use JSI to inject a test function into the JS runtime that reads from and writes to an array buffer, and call that function from the JS of the RNTester app (see https://github.com/ryantrem/react-native/commit/28152ce3f4ae0fa906557415d106399b3f072118). For the JS side of this, specifically look at https://github.com/ryantrem/react-native/blob/28152ce3f4ae0fa906557415d106399b3f072118/RNTester/js/RNTesterApp.android.js#L13-L18 For the native side of this, specifically look at https://github.com/ryantrem/react-native/blob/28152ce3f4ae0fa906557415d106399b3f072118/RNTester/android/app/src/main/cpp/JSITest.cpp#L22-L38 Reviewed By: shergin Differential Revision: D21717995 Pulled By: tmikov fbshipit-source-id: 5788479bb33c24d01aa80fa7f509e0ff9dcefea6 * Fix font variant crash on Android < 4.4 (#29176) Summary: In RN 0.62 support for `fontVariant` was added on Android. Using that prop crashes the app on Android below KitKat (4.3 and below) To reproduce just add any Text with the `fontVariant` styling prop in the app: ```js <Text style={{fontVariant: ['tabular-nums']}}>This will crash</Text> ``` It will crash any device running Android below KitKat with the error: ![image](https://user-images.githubusercontent.com/4534323/85073452-18206b80-b1bb-11ea-8d7e-96f27fa1a320.png) This is caused by `java.utils.Objects` only being available on Android 4.4+ ## Changelog [Android] [Fixed] - Fix font variant crash on Android < 4.4 Pull Request resolved: https://github.com/facebook/react-native/pull/29176 Test Plan: [TextUtils.equals](https://developer.android.com/reference/android/text/TextUtils#equals) was added as soon as API level 1, so no compatibility issue here. Tested on Emulator running Android 4.1, no crash anymore. I've searched for other occurences of `java.utils.Objects` in the project, and this was the only one, so no need to remove other occurences ✅ Reviewed By: JoshuaGross Differential Revision: D22337316 Pulled By: mdvacca fbshipit-source-id: 5507b21b237a725d596d47b5c01e269895b16d4a * Fix LogBox.ignoreAllLogs used with no argument (#29310) Summary: When you call `LogBox.ignoreAllLogs()` it should ignore logs. This fixes a bug that made this equivalent to `LogBox.ignoreAllLogs(false)` ## Changelog [General] [Fixed] - LogBox.ignoreAllLogs() should ignore logs Pull Request resolved: https://github.com/facebook/react-native/pull/29310 Test Plan: Added tests Reviewed By: TheSavior Differential Revision: D22448436 Pulled By: rickhanlonii fbshipit-source-id: 6ba12b9d9c1f29cf3ac503946ac5ca0097425a7a * Pressable: Minimum Press Duration Summary: When a `Pressable` has a configured (or the default) `delayPressIn` and no (or the default) `delayPressOut`, tapping very quickly can lead to intantaneous invocation of `onPressIn` and `onPressOut`. The end result is that users may never experience any intended visual press feedback. This changes `Pressable` to accept (and be preconfigured with a default) **minimum press duration**. The minimum press duration ensures that even if the press is released before `delayPressIn` has elapsed, `onPressOut` will still wait the remaining time up to `minPressDuration` before firing. Note that setting a non-zero `delayPressOut` is insufficient because if a user holds down on a `Pressable` for longer than `delayPressIn`, we still want `onPressOut` to fire immediately when the press is released. Changelog: [General][Changed] - Added `minPressDuration` to `Pressable`. Reviewed By: TheSavior Differential Revision: D21614708 fbshipit-source-id: 502f3d8ad6a40e7762435b6df16809c8798dd92c * chore: bring back script to org shape * [0.63.1] Bump version numbers * Exclude okhttp from flipper dependency (#29260) Summary: This fixes https://github.com/facebook/react-native/issues/28481. As explained in [this comment](https://github.com/facebook/react-native/issues/28481#issuecomment-645546195), the flipper network plugin pulls a more recent version of okhttp (3.14), but only versions of okhttp up to 3.12 works on Android API 21 and less. This prevented being able to run the app in debug mode, it was still working fine in release mode. ## 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 --> [Android] [Fixed] - Fix unable to run in debug mode on Android API < 21 Pull Request resolved: https://github.com/facebook/react-native/pull/29260 Test Plan: Using `yarn react-native run-android` the app would instantly crash with this error in `adb logcat`: ``` E/AndroidRuntime( 5079): java.lang.RuntimeException: Unable to create application com.awesometsproject.MainApplication: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created E/AndroidRuntime( 5079): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4154) E/AndroidRuntime( 5079): at android.app.ActivityThread.access$1300(ActivityThread.java:130) E/AndroidRuntime( 5079): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1255) E/AndroidRuntime( 5079): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 5079): at android.os.Looper.loop(Looper.java:137) E/AndroidRuntime( 5079): at android.app.ActivityThread.main(ActivityThread.java:4745) E/AndroidRuntime( 5079): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 5079): at java.lang.reflect.Method.invoke(Method.java:511) E/AndroidRuntime( 5079): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) E/AndroidRuntime( 5079): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) E/AndroidRuntime( 5079): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 5079): Caused by: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:90) E/AndroidRuntime( 5079): at com.facebook.react.ReactInstanceManager.<init>(ReactInstanceManager.java:238) E/AndroidRuntime( 5079): at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:281) E/AndroidRuntime( 5079): at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:87) E/AndroidRuntime( 5079): at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:39) E/AndroidRuntime( 5079): at com.awesometsproject.MainApplication.onCreate(MainApplication.java:47) E/AndroidRuntime( 5079): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:999) E/AndroidRuntime( 5079): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4151) E/AndroidRuntime( 5079): ... 10 more E/AndroidRuntime( 5079): Caused by: java.lang.reflect.InvocationTargetException E/AndroidRuntime( 5079): at java.lang.reflect.Constructor.constructNative(Native Method) E/AndroidRuntime( 5079): at java.lang.reflect.Constructor.newInstance(Constructor.java:417) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:80) E/AndroidRuntime( 5079): ... 17 more E/AndroidRuntime( 5079): Caused by: java.lang.NoClassDefFoundError: java.util.Objects E/AndroidRuntime( 5079): at okhttp3.CertificatePinner.withCertificateChainCleaner(CertificatePinner.java:231) E/AndroidRuntime( 5079): at okhttp3.OkHttpClient.<init>(OkHttpClient.java:238) E/AndroidRuntime( 5079): at okhttp3.OkHttpClient$Builder.build(OkHttpClient.java:1015) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevServerHelper.<init>(DevServerHelper.java:132) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerImpl.<init>(DevSupportManagerImpl.java:183) E/AndroidRuntime( 5079): ... 20 more W/ActivityManager( 1456): Force finishing activity com.awesometsproject/.MainActivity ``` With this fix, the app launch successfully in debug mode, without having to remove flipper altogether from our config. Reviewed By: passy Differential Revision: D22521109 Pulled By: mdvacca fbshipit-source-id: 3c0263642438bd7c0d09b045e15a933bd8a26734 * Send key when onKeyPress event is fired from TextInput Summary: Changelog: [Internal] In `onKeyPress` event, we were not returning `key` property. This diff adds `key` property to `onKeyPress` event and removes other, redundant properties from `onKeyPress` event. The implementation has been translated from Paper. Reviewed By: shergin Differential Revision: D21250411 fbshipit-source-id: f1e31381667acb9dec02d0b33883df8f8f5b2a4b * Calling Paper TextInput setTextAndSelection view command now dirties layout Summary: Changelog: [Internal] Previously `setTextAndSelection` was not dirtying layout. This would cause an issue where `setTextAndSelection` causes layout change. For example calling setTextAndSelection with empty string on a multiline auto expanding text input. I changed one example in TextInputSharedExamples.js, "Live Re-Write (no spaces allowed) and clear" example is now multiline. This allows to test whether `setTextAndSelection` dirties layout. Enter multiline string to to the example text input and press clear. Observe that the text input shrinks to single line height. Reviewed By: shergin Differential Revision: D21182990 fbshipit-source-id: de8501ea0b97012cf4cdf8d5f658649139f92da6 * Remove setMostRecentEventCount from TextInput view commands Summary: Changelog: [Internal] We don't use view command `setMostRecentEventCount`, let's get rid of it. Reviewed By: JoshuaGross Differential Revision: D21016600 fbshipit-source-id: 6491c063e9d6a89252300cb47c010b248e473f4b * Restore Previous Behavior for StyleSheet Validation of Null/Undefined Styles (#29171) Summary: https://github.com/facebook/react-native/issues/27264 changed stylesheet validation to avoid enumerating properties on the prototype of a style. It introduces a secondary behavior change, where null/undefined styles used to be tolerated but now lead to an exception. This is because `for in undefined` will noop where `for of Object.keys(undefined)` will throw. This scenario of undefined/null styles seems to actually show up in practice and was previously well tolerated. E.g. `Button.js` has code that looks like this: ```jsx const styles = StyleSheet.create({ button: Platform.select({ ios: {}, android: { elevation: 4, // Material design blue from https://material.google.com/style/color.html#color-color-palette backgroundColor: '#2196F3', borderRadius: 2, }, }), ``` For non ios/Android platforms, that creates a style object which looks like: ```js { button: undefined, ... } ``` This previously meant that the component would be unstyled if created, but now means out-of-tree platforms throw if the builtin Button component is required. This change restores the previous `for in` loop but adds a `hasOwnProperty` check to avoid properties on prototypes. ## Changelog [General] [Fixed] - Restore Previous Behavior for StyleSheet Validation of Null/Undefined Styles Pull Request resolved: https://github.com/facebook/react-native/pull/29171 Test Plan: Validated that importing Buttons will no longer cause an exception, and that invalid properties are still caught. Reviewed By: JoshuaGross Differential Revision: D22118379 Pulled By: TheSavior fbshipit-source-id: 650c64b934ccd12a3dc1b75e95debc359925ad73 * Set windowTranslucentNavigation to false (#29399) Summary: This fixes https://github.com/facebook/react-native/issues/29397. Without this, apps that specify `android:windowTranslucentNavigation` draw the `LogBox` buttons underneath the soft navigation bar, making the buttons unpressable. Before | After :-------------------------:|:-------------------------: <img src="http://ashoat.com/AndroidTranslucentNavigationLogBox.png" width="300" /> | <img src="http://ashoat.com/AndroidTranslucentNavigationLogBoxFixed.png" width="300" /> ## Changelog [Android] [Fixed] - Set LogBox windowTranslucentNavigation to false Pull Request resolved: https://github.com/facebook/react-native/pull/29399 Test Plan: I tested this change on the [repo](https://github.com/Ashoat/LogBoxTest) I set up to reproduce the issue. I set it up to [build `ReactAndroid` from source](https://github.com/Ashoat/LogBoxTest/commit/3a2cdab8777ac381cd3be5a84a5bf3250751ac11) and then edited `node_modules/react-native/ReactAndroid/src/main/res/devsupport/values/styles.xml` directly. Reviewed By: rickhanlonii Differential Revision: D22602970 Pulled By: mdvacca fbshipit-source-id: 8c2adc149aa0157825075022f00bb695956d3121 * Fix image cannot show in iOS 14 (#29420) Summary: This PR is to fix https://github.com/facebook/react-native/issues/29279, which image cannot show in iOS 14 As https://github.com/facebook/react-native/issues/29279#issuecomment-658244428 mention, this issue can be fixed by calling ` [super displayLayer:layer];` it it is still image, to let `UIImageView` handle still image rendering ## Changelog [iOS] [Fixed] - Fix image cannot show in iOS 14 Pull Request resolved: https://github.com/facebook/react-native/pull/29420 Test Plan: Image can be shown in iOS 14 build with Xcode 12 beta, using ```js <Image source={require('./images/some_local_image.jpg')}/> ``` It may also need to test gif image is render correctly ```js <Image source={{uri: 'https://some_remote_gif_image.gif'}}/> ``` Reviewed By: p-sun Differential Revision: D22619448 Pulled By: shergin fbshipit-source-id: f4d0ad83af945a6b8099d4eaea5a5f1933c7bfd2 * [0.63.2] Bump version numbers * botched merge changes 1 * more hermes changes needed from upstream, botched merge? * [RCTPicker] Guard UIKit only API on macOS * [RCTSegmentedControl] Make UIKit agnostic * [RCTDisplayWeakRefreshable] Make platform agnostic * [RCTImageLoader] Make platform agnostic * [RCTDevLoadingView] Make platform agnostic * botched merge changes 2 * [RCTPushNotificationManager] Guard for macOS * v0.63 TODO * [RCTBaseTextInputViewManager] Make platform agnostic * [RCTBaseTextInputView] Make platform agnostic * [RNTester-macOS] Fix * [RCT-Folly] Fix build * [PlatformColorValueTypes] Add macOS shim * [package] Update CLI to no longer require config This makes a previous change more explicit: https://github.com/microsoft/react-native-macos/pull/602 * Fix iOS build failures. * Get RNTester to launch * [CODEOWNERS] Add myself * [flow] Remove deprecated rule in newer Flow https://github.com/facebook/flow/commit/759970c1b6dc0a25171d9969e34eaf5dae70f130 * [flow] Get iOS checks green * [PlatformColor] Duplicate iOS code for macOS This is a naive version of this change, there should likely be some code sharing happening between iOS and macOS. * [test] Make green with macOS fork changes * [test] Get macOS test bundle to build * [Color] Rename alternating colors to match to assumptions * [PlatformExample] Fix examples on macOS * [transform] Use iOS implementation for macOS * [circle] Fix config * [ci] Update metro config as per upstream * [ci] Ignore metro config in e2e tests * Revert "[ci] Ignore metro config in e2e tests" This reverts commit 25f7006bc9ba76b1e002b721954a823b3d710c5c. * Revert "[ci] Update metro config as per upstream" This reverts commit b47ca570be00394bbd92b349eab02083787301e7. * [ci] Only disable custom metro config in e2e test * [ci] Ignore metro config in e2e tests * [ci] Switch to experimental CocoaPods CDN * Revert "[ci] Switch to experimental CocoaPods CDN" This reverts commit 44a92f7f08397406429672b14930d44b6aa06b5e. * [ci] Skip Android tests in Apple PR on master * [rnm-init] Fix pod reference * [rnm-init] Update minimum iOS deployment target Co-authored-by: Christoph Nakazawa <cpojer@fb.com> Co-authored-by: Sergio Estevao <sergioestevao@gmail.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: Sam Mathias Weggersen <sawegger@microsoft.com> Co-authored-by: Tommy Nguyen <tonguye@microsoft.com> Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Héctor Ramos <hector@hectorramos.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Sebastian Markbage <sema@fb.com> Co-authored-by: generatedunixname89002005287564 <generatedunixname89002005287564@fb.com> Co-authored-by: Eddie Dugan <ejd@fb.com> Co-authored-by: Valentin Shergin <shergin@fb.com> Co-authored-by: Max Ovtsin <maxovtsin@fb.com> Co-authored-by: Alexander Kawrykow <akawry@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Spencer Ahrens <sahrens@fb.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Jack Wang <shoubowang@fb.com> Co-authored-by: Oleg Bogdanov <boguscoder@fb.com> Co-authored-by: Michael Bolin <mbolin@fb.com> Co-authored-by: Dan Abramov <gaearon@fb.com> Co-authored-by: Peter Argany <petetheheat@fb.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: George Zahariev <gkz@fb.com> Co-authored-by: Jason Safaiyeh <safaiyeh@protonmail.com> Co-authored-by: Pedro Barbiero <pedrobarbiero@gmail.com> Co-authored-by: Brian Vaughn <bvaughn@fb.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Martin Sherburn <mns@fb.com> Co-authored-by: Tom Underhill <tomun@microsoft.com> Co-authored-by: Ventsislav Dimitrov <4097884+vdmtrv@users.noreply.github.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: Lucas Bento <lucas.bsilva@outlook.com> Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com> Co-authored-by: Vojtech Novak <vonovak@gmail.com> Co-authored-by: Emilis Baliukonis <emilisb@wix.com> Co-authored-by: Jacob Bower <jbower@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: Marc Horowitz <mhorowitz@fb.com> Co-authored-by: Sidharth Guglani <sidharthguglani@fb.com> Co-authored-by: Andrew Coates (REDMOND) <acoates@microsoft.com> Co-authored-by: maciej simka <mcj.simka@gmail.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Pavlos Vinieratos <pvinis@gmail.com> Co-authored-by: Cristiano Santos <cristianomnsantos@gmail.com> Co-authored-by: Daniel Cohen Gindi <Danielgindi@gmail.com> Co-authored-by: Eli White <eliwhite@fb.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: jiggag <jiggag90@gmail.com> Co-authored-by: Emily Janzer <janzer@fb.com> Co-authored-by: Kacper Wiszczuk <kacperwiszczuk@gmail.com> Co-authored-by: Xiaoyu Yin <xyin@fb.com> Co-authored-by: Javier Cuevas <javi@diacode.com> Co-authored-by: Bruno Barbieri <brunobar79@gmail.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Will Holen <willholen@fb.com> Co-authored-by: Pritesh Nandgaonkar <prit91@fb.com> Co-authored-by: sunnylqm <sunnylqm@qq.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Tim Yung <yungsters@fb.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: Devon Deonarine <hello@devondeonarine.ca> Co-authored-by: Radek Czemerys <radko93@gmail.com> Co-authored-by: Hein Rutjes <IjzerenHein@users.noreply.github.com> Co-authored-by: zhongwuzw <zhongwuzw@qq.com> Co-authored-by: Jonny Burger <jonathanburger11@gmail.com> Co-authored-by: Ryan Tremblay <ryan.tremblay@microsoft.com> Co-authored-by: almouro <contact@almouro.com> Co-authored-by: Rick Hanlon <rickhanlonii@gmail.com> Co-authored-by: Matthieu Harlé <bonjour@matthieuharle.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Ashoat Tevosyan <ashoat@gmail.com> Co-authored-by: Tom Cheung <cheungch@gmail.com>
2020-09-30 19:38:06 +03:00
Object.defineProperty(module.exports, 'ToolbarAndroid', {
configurable: true,
get() {
invariant(
false,
'ToolbarAndroid has been removed from React Native. ' +
"It can now be installed and imported from '@react-native-community/toolbar-android' instead of 'react-native'. " +
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
'See https://github.com/react-native-toolbar-android/toolbar-android',
v0.63 sync from upstream (#613) * Upgrade to Metro 0.59 Summary: Upgrades RN to Metro 0.59. Changelog: [Internal] Metro Upgrade Reviewed By: motiz88 Differential Revision: D20533864 fbshipit-source-id: 3c5fb8e37d2363edf0b9a1a8cfbdefba00763415 * Fix mock for TextInput (#28332) Summary: This PR adds the `isFocused` method to the mock of the TextInput component. My understanding some of the latest changes on the TextInput to make it use a forwardRef change the way this method is mock giving an error when trying to use in on a mock. The change suggested here fixes the issue. ## Changelog [JavaScript] [Fixed] - Fix the mock for TextInput to support the `isFocused` method Pull Request resolved: https://github.com/facebook/react-native/pull/28332 Reviewed By: cpojer Differential Revision: D20538044 Pulled By: TheSavior fbshipit-source-id: be734af105ab62ffdf9ed4017bd70845e207f8cd * Properly handle LogBox errors during tests Summary: This diff fixes an issue where errors in LogBox during tests would cause the tests to crash. The crash is due to the NativeExceptionsManager module not being mocked (as all native module need to be in tests). The fix is to properly mock the NativeExceptionManger. This fix exposed an infinite loop issue where failures in LogBox will be logged to the ExceptionManager, which logs to the console, which logs to LogBox, creating a loop. This diff also fixes that look by moving the LogBox internal error check to the top of the monkey patched console methods. Changelog: [Internal] Differential Revision: D20428590 fbshipit-source-id: 7289a480c99ba8dee67772178b7629afb40b330a * Back out "Track animations and flush them" Summary: Original commit changeset: b594d0e6e9b6 D20319824 introduced a problem in LayoutAnimations, which makes surfaced as the problem in T63911344. This diff reverts D20319824. Changelog: [Internal] Reviewed By: lunaleaps Differential Revision: D20541918 fbshipit-source-id: ff72b839f57d39051122920a38b2632cbb5ec362 * Consolidate "dispatchMountItems" reentrancy prevention code, and retry code, in one function Summary: Simplifying the dispatchMountItems reentrance and retry logic. Motivation: cleanup so I can work on dispatching ViewCommands before anything else. Importantly, this gives us the properties that: 1) Only one function is responsible for calling dispatchMountItems 2) Only one function is responsible for deciding if we shouldn't call dispatchMountItems due to reentrance 3) Only one function is responsible for all cleanup 4) Only one function maintains all of the relevant flags (except dispatchPreMountItems... two total now, instead of 4 before) Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20437035 fbshipit-source-id: 5370366790eb25f653bee6c1950e747458374a61 * Only retry ViewCommand mount items if exception is marked as "Retryable" Summary: Instead of just blindly retrying all ViewCommands if they fail - which could be dangerous, since it's arbitrary imperative commands we'd be executing twice, potentially with bad app state - we only retry if the ViewCommand throws a "RetryableMountingLayerException". Changelog: [Internal] Optimization to ViewCommands Reviewed By: mdvacca Differential Revision: D20529985 fbshipit-source-id: 0217b43f4bf92442bcc7ca48c8ae2b9a9e543dc9 * Introduce early dispatch of ViewCommands in FabricUIManager Summary: Earlier this week I introduced a change in the old, non-Fabric renderer (D20378633 D20427803) that (gated behind a feature-flag) executes ViewCommands before all other types of commands, as a perf optimization and (I think) a potential fix for a category of race conditions. I've added more details in comments here. The Fabric renderer uses the same feature-flag that I introduced for the non-Fabric renderer. Changelog: [Internal] Fabric Reviewed By: mdvacca Differential Revision: D20449186 fbshipit-source-id: bb3649f565f32c417a6247369902333989a043aa * Change nightly build from hourly to nightly (daily at 00:00) (#28346) Summary: We initially added the nightly build test to run every hour, in order to more quickly validate it. Now that it has been validated we can run it every night as it is intended to do. cc hramos ## Changelog [General] [Changed] - Change nightly build from hourly to nightly Pull Request resolved: https://github.com/facebook/react-native/pull/28346 Reviewed By: cpojer Differential Revision: D20550143 Pulled By: hramos fbshipit-source-id: 9487c6785684ad6ea7e877290d50a33118090a7f * Add diffing to app bundle size reports (#28284) Summary: Add diffing to app bundle size reports. ## Changelog [Internal] [Changed] - Add diffing to app bundle size reports Pull Request resolved: https://github.com/facebook/react-native/pull/28284 Test Plan: - App bundle size reports should now display a diff where available - Right now, the database contains only one entry for the last known good iOS build - Triggering a new build should not create additional comments Reviewed By: cpojer Differential Revision: D20450158 Pulled By: hramos fbshipit-source-id: 720772275f24d3ff0a49705f4dada2efe2e99bd3 * feat: improve monorepo support by removing redundant PROJECT_ROOT (#28354) Summary: Historically, React Native didn't support a lot of custom project structures apart from the standard flat directory with `ios` and `android` folders. The CLI had to be explicitly started from the project root, otherwise Metro didn't work right. In order to resolve the project root in the most accurate way, React Native assumed that project root is always `../../` from its location in `node_modules` - this is not true when the installation gets hoisted (e.g. in a monorepo). To address that, janicduplessis brought support for custom [`PROJECT_ROOT`](https://github.com/facebook/react-native/commit/9ccde378b6e6379df61f9d968be6346ca6be7ead) that allowed overriding the `../../` in case it wasn't true. Today, CLI is able to automatically resolve the project root, no matter where it's started. It will traverse the tree of the directories upwards and stop as soon as it meets `package.json`. As a result, it doesn't really matter from where we start the CLI anymore as a part of `react-native-xcode.sh`. By replacing the default value of `$REACT_NATIVE_DIR/../../` with `$PWD, that is default for all Xcode scripts, we can make the setup for monorepo easier - nobody will need to set `$PROJECT_ROOT` in order to override the incorrect defaults. By default, all scripts defined in Xcode run from `$PWD` directory, which is the location of the iOS project. In the future, we will be able to remove `cd` entirely. To better understand this PR, let's look a few hypothetical structures as an example: #### Monorepo: > tl;dr works out of the box, no need to mess around with paths ``` - package.json - packages/ - my-app/ - index.js - package.json - ios/ - MyApp.xcodeproj ``` **Before this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $REACT_NATIVE_DIR/../../ node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - Because we change the directory to the root of monorepo, CLI throws an error. All in all, there's no `react-native` dependency at the workspace root. - Some users turn `no hoist` in an act of troubleshooting the errors, which resolves the problem - `react-native` is moved under `my-app/node_modules` which makes this mechanism resolve properly. - Some users find out about `PROJECT_ROOT` and set it to overwrite the default value. For example, setting `export PROJECT_ROOT = "$PWD/../` will set the directory to `my-app`, which has a dependency on `react-native` in a `package.json` and makes the CLI happy. **After this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $PWD node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - The `$PWD` is `packages/my-app/ios/` because that's where the Xcode project is located. CLI will automatically set the root to `../` because that's where it finds `package.json` with `react-native` dependency. It will pass that root to Metro, unless users have set a different one themselves. Thanks to that, all paths to JavaScript files remain working and unaffected. - No need to set `PROJECT_ROOT` anymore. - We don't rely on the location of `node_modules`, which is cleaner and future proof. #### Standard: > tl;dr no changes ``` - ios/ - MyApp.xcodeproj - index.js - package.json ``` **Before this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $REACT_NATIVE_DIR/../../ node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - Everything works fine. Path from `react-native` inside `node_modules` is correct - the project root is set right to `/` **After this PR**, the `react-native-xcode.sh` will start the CLI like this: ```bash cd $PWD node <absolute_path_to_cli.js> bundle --entry-point index.js ``` - The root will be set to where Xcode project is located, which is `/ios`. This is the PWD for all Xcode scripts. CLI will look for the `package.json` going upwards from `ios` folder. Will stop at `/`, find out it has `react-native` dependency, load it and its commands and proceed further. ## Changelog [iOS] [Feature] - Better monorepo support when building release apk Pull Request resolved: https://github.com/facebook/react-native/pull/28354 Test Plan: - All projects (standard/monorepo) run without issues. - PROJECT_ROOT is not needed. CC: Titozzz (who wrote monorepo guide), alloy, bartolkaruza Reviewed By: cpojer Differential Revision: D20558005 Pulled By: hramos fbshipit-source-id: 2551120beadcfd4c2f1393ce8a2c2fa6b93c9290 * Fix `test_android`: Remove references to fbsource cell (#28363) Summary: Fixes https://github.com/facebook/react-native/issues/28361. ## Changelog [Internal] [CI] - Fix test_android Pull Request resolved: https://github.com/facebook/react-native/pull/28363 Test Plan: Prior to fix: ``` react-native $ ./scripts/circleci/buck_fetch.sh Guessing 168a69309928ba16065cdb33b1775a4af9f924a6 as the last one used version. Using additional configuration options from /Users/hramos/.buckconfig.d/experiments, /etc/buckconfig.d/fb_chef.ini, /etc/buckconfig.d/fb_chef_override.ini Invalidating internal cached state: Watchman failed to start. This may cause slower builds. Parsing buck files: finished in 1.5 sec Buck wasn't able to parse /Users/hramos/git/react-native/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK: IOError: [Errno 2] No such file or directory: '/Users/hramos/git/react-native/tools/build_defs/platform_defs.bzl' Call stack: File "/Users/hramos/git/react-native/.buckd/resources/168a69309928ba16065cdb33b1775a4af9f924a6/buck_server/buck_parser/profiler.py", line 507, in wrapped return func(*args, **kwargs) File "/Users/hramos/git/react-native/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK", line 1 load("//tools/build_defs:platform_defs.bzl", "ANDROID") File "/Users/hramos/git/react-native/.buckd/resources/168a69309928ba16065cdb33b1775a4af9f924a6/buck_server/buck_parser/profiler.py", line 507, in wrapped return func(*args, **kwargs) This error happened while trying to get dependency '//ReactAndroid/src/main/java/com/facebook/fbreact/specs:FBReactNativeSpec' of target '//ReactAndroid/src/main/java/com/facebook/react/devsupport:devsupport' ``` After fix: ``` react-native $ ./scripts/circleci/buck_fetch.sh + buck fetch ReactAndroid/src/test/java/com/facebook/react/modules Guessing 168a69309928ba16065cdb33b1775a4af9f924a6 as the last one used version. Using additional configuration options from /Users/hramos/.buckconfig.d/experiments, /etc/buckconfig.d/fb_chef.ini, /etc/buckconfig.d/fb_chef_override.ini Invalidating internal cached state: Watchman failed to start. This may cause slower builds. Parsing buck files: finished in 1.1 sec Configuration 'ANDROID_SDK' points to an invalid directory '/opt/android_sdk'. When creating rule //ReactAndroid/src/main/java/com/facebook/hermes/instrumentation:instrumentation. ``` > Note: I don't have the Android SDK configured in this machine. Verified on Circle CI. `test_android` is now green: https://circleci.com/gh/facebook/react-native/140682?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link Reviewed By: cpojer Differential Revision: D20564934 Pulled By: hramos fbshipit-source-id: 5d843b8f113c4db5391ee39addc3ff259d962290 * Fix TextInput left/right padding Summary: This fixes two things: 1) Currently it only respects Start and End padding, and if there's a Theme default, it will override Left/Right padding. Whoops. 2) Currently it doesn't respect when a TextInput starts with padding, but then is removed. This resolves both. It still does not account for RTL support. Changelog: [Internal] Fix AndroidTextInput padding Reviewed By: mdvacca Differential Revision: D20573151 fbshipit-source-id: e89791641b6699e728cde9dbd661a8c21485fbc8 * Validate selection range passed to setTextAndSelection Summary: Changelog: [Internal] # Fabric 1. If `start` and `end` parameters in `setTextAndSelection` are -1, we don't move the cursor. Previously the cursor would be moved to beginning of text input. 2. In view commands, do not validate `eventCount`. It is passed in as undefined from JS because Fabric's text input doesn't use `eventCount`. # Paper 1. If `start` and `end` parameters in `setTextAndSelection` are -1, we don't move the cursor. Previously the cursor would be moved to beginning of text input. Reviewed By: shergin Differential Revision: D20538290 fbshipit-source-id: c7aeddc25f58697254474058ce901df958321f7c * Remove ReactTypes from fbsource and React sync Summary: See https://github.com/facebook/react/pull/18366 This contains a fork of the upstream Flow types. We shouldn't be syncing this since these leads to conflicting types. As a result, these uses have already been codemodded away. Only the imports remained. Changelog: [React Core] - Remove ReactTypes from sync. Reviewed By: gaearon Differential Revision: D20583740 fbshipit-source-id: fc86a934cbdca8ff90fe90282b86ecc945a85e5f * Fix controlled TextInput with child nodes Summary: Changelog: [Internal] # There are three changes in this diff ## _stateRevision is replaced with a BOOL `_stateRevision` was protecting against setting attributed string that is already visible to the user. Previously this was ok because the change was only coming from native, any changes from JS were ignored. Imagine following scenario: 1. User taps key. 2. Update state is called on component initiated by native. 3. New state is created with incremented revision by one. 4. `_stateRevision` gets set to new state's revision + 1. 5. Now JS wants to change something because it just learnt that user tapped the key. 6. New state is created again with incremented revision by one. 7. Update state is called on the component, but the change isn't applied to the text view because `_state->getRevision()` will equal `_stateRevision`. By having a BOOL instead of number, we very explicitly mark the region in which we don't want state changes to be applied to text view. ## Calling [_backedTextInputView setAttributedText] move cursor to the end of text input This is prevented by storing what the current selection is and applying it after `[_backedTextInputView setAttributedText]` is called. This was previously invisible because JS wasn't changing contents of `_backedTextInputView`. ## Storing of previously applied JS attributed string in state This is the mechanism used to detect when value of text input changes come from JavaScript. JavaScript sends text input value changes through props and as children of TextInput. We compare what previously was set from JavaScript to what is currently being send from JavaScript and if they differ, this change is communicated to the component. Previously only first attributed string send from JavaScript was send to the component. # Problem If children are used to set text input's value, then there is a case in which we can't tell what source of truth should be. Let's take following example We have a text field that allows only 4 characters, again this is only a problem if those 4 characters come as children, not as value. This is a controller text input. 1. User types 1234. 2. User types 5th character. 3. JavaScript updates TextInput, saying that the content should stay 1234. 4. In `TextInputShadowNode` `hasJSUpdatedAttributedString` will be set to false, because previous JS value is the same as current JS value. Reviewed By: shergin Differential Revision: D20587681 fbshipit-source-id: 1b8a2efabbfa0fc87cba210570142d162efe61e6 * Daily `arc lint --take BUCKFORMAT` Reviewed By: zertosh Differential Revision: D20593906 fbshipit-source-id: b056947c698508119dc9d4d1bba202295b8f0fda * RN picker - implement background color Summary: add support to the android implementation of the Picker component for setting the background color. Changelog: [Android] [Added] - Support item background color in Dialog Picker Differential Revision: D20566131 fbshipit-source-id: d693b40803fa1051ec955c5728994c820fecd9e9 * Fabric: Modernizing Yoga Dirty flag test. Summary: Now we using TEST_F thing that allows consilidating initialization. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D20578788 fbshipit-source-id: 103bcb8fdeb3dbf297385cfe56415bd646e16791 * Fabric: Changing signature of `ComponentDescriptor::createState` Summary: This is pure syntactic change. Often we don't have a shared pointer to ShadowNodeFamily and only have just a reference. At the same time, `ComponentDescriptor::createState` does not have to accept a shared pointer. So, it's better to accept just a reference. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20578787 fbshipit-source-id: 905277001e096d41e75007575b59ea2ea15fbf4b * Fabric: View Test: Changing state should not dirty Yoga tree (in some most cases) Summary: Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D20578789 fbshipit-source-id: 4336165217bd39fc8065cfaeb96ef7753433d48a * Get ReactiveNative compiled with Clang 10 (#28362) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/28362 Fixed a few compilation errors emitted by Clang 10. Changelog: [iOS] [Fixed] - Get ready for Clang 10 Differential Revision: D20549970 fbshipit-source-id: dc36a85d90d3e43a05f045feb57c6ab6ded67da7 * Guard against null values in object parameters for bridged methods Summary: Handles the case when a value in an object parameter of a turbo module spec is null (even if the type is nullable). For example, given: ``` export interface Spec extends TurboModule { +myFunc: ({| foo: ?string, |}) => void; } ``` and calling `NativeModule.myFunc({foo: null})`, we see an error like: ``` JSON value '<null>' of type NSNull cannot be converted to NSString ``` Guarding against this by converting NSNull's to nils ## Changelog: [iOS] [Fixed] - Fix crash when passing null value in object parameter of bridged method Reviewed By: fkgozali Differential Revision: D20591590 fbshipit-source-id: fdb90f34131427a235f2e3c99147bf1e6a9c6732 * Modify pending deletion tags to be cross manageChildren Summary: Changelog: [Internal] Removing historic layout animations index adjustment (D20323928) broke the Dating Secret Crush screen. Since flushing animations (D20319824) had to be reverted due to issues with Saved + Privacy Shortcuts (https://fburl.com/tasks/eijtmifu) we need to track pending deletions across `manageChildren` operations. Reviewed By: JoshuaGross Differential Revision: D20601079 fbshipit-source-id: c6f116683750e97abe7f988cf361d2a6449e90e6 * Enable label-actions on the react-native repository (#28374) Summary: Enhance our issue management workflow by having the bot respond automatically whenever a label is applied to the issue. ## Changelog [Internal] - CI Pull Request resolved: https://github.com/facebook/react-native/pull/28374 Test Plan: Not tested. If needed, could be applied to a different, test repository. Reviewed By: cpojer Differential Revision: D20606887 Pulled By: hramos fbshipit-source-id: 874d1464527ea76bf51394a7d3e98e4fd8f69345 * Fix Animated Value initialized with undefined in ScrollView (#28349) Summary: When passing an object to contentOffset that doesn't have `y` prop set it causes the following error: ``` Error: AnimatedValue: Attempting to set value to undefined This error is located at: in ScrollView (at src/index.js:638) ... ``` This happens since a runtime check was added to the `AnimatedValue` constructor. (a3aaa471eca58b31597b9a0669f7ade385ccb175) According to flow types the object passed to contentOffset should always contain both x and y props but since it worked before when y is undefined I think its fine to patch the runtime behaviour defensively, especially since the code change is simple. ## Changelog [General] [Fixed] - Fix Animated Value initialized with undefined in ScrollView Pull Request resolved: https://github.com/facebook/react-native/pull/28349 Test Plan: Tested that the crash no longer reproduces when passing an empty object to contentOffset. Reviewed By: cpojer Differential Revision: D20601664 Pulled By: hramos fbshipit-source-id: b098a2dd1e702f995a9a92fa6e4e9a204187dac4 * xplat/js/react-native-github/ReactCommon/fabric/components/textinput/ Summary: Changelog: [Internal] Reviewed By: scottrice Differential Revision: D20619227 fbshipit-source-id: 674337e6ce585a4e96d020f9624b874ba86e2d80 * Seed ssh known hosts with github's public key (#28370) Summary: The [previous attempt](https://github.com/facebook/react-native/pull/28304) to fix the publish step failed, so now reverting to manually configuring things. This PR adds an entry to SSH’s `known_hosts` file using github.com’s public key that I have verified as per [these instructions](https://serverfault.com/a/807363): ``` ~/C/R/react-native [master] » nmap github.com --script ssh-hostkey Nmap scan report for github.com (140.82.118.4) rDNS record for 140.82.118.4: lb-140-82-118-4-ams.github.com PORT STATE SERVICE 22/tcp open ssh | ssh-hostkey: | 1024 ad:1c:08:a4:40:e3:6f:9c:f5:66:26:5d:4b:33:5d:8c (DSA) |_ 2048 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48 (RSA) ``` These fingerprints line up with [the ones posted by GitHub](https://help.github.com/en/github/authenticating-to-github/githubs-ssh-key-fingerprints), so my setup should be good and can be trusted to grab the public key from the right host: ``` ~/C/R/react-native [master] » ssh-keyscan -t rsa -H github.com # github.com:22 SSH-2.0-babeld-d48c3acd |1|If6MU203eXTaaWL678YEfWkVMrw=|kqLeIAyTy8pzpj8x8Ae4Fr8Mtlc= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== ``` ## Changelog [Internal] [Fixed] - Make automated publishing of packages from CI work again Pull Request resolved: https://github.com/facebook/react-native/pull/28370 Test Plan: I used the command being added in this PR in [a failed CI job](https://app.circleci.com/pipelines/github/facebook/react-native/4104/workflows/916127cb-177f-4583-9f90-cae5318041d8/jobs/140810). When I invoked the publish script manually I was not greeted by the blocking prompt and the package was successfully published: https://www.npmjs.com/package/react-native/v/0.0.0-56cf99a96 Reviewed By: cpojer Differential Revision: D20601527 Pulled By: hramos fbshipit-source-id: b1a4405228408cfc4a1b3b44ab88c79522af3a66 * Fix app bundle size diff not always being compared against latest commit (#28368) Summary: - Timestamp of entries in our Firebase instance sometimes get stored as number. This means that we may not always be diffing against the latest master commit. - Size report of Android and iOS gets overwritten depending on which build finishes first. ## Changelog [Internal] [Fixed] - App bundle size diff not always being compared against latest commit [Internal] [Fixed] - Android and iOS app bundle size diff overwrite each other Pull Request resolved: https://github.com/facebook/react-native/pull/28368 Test Plan: - We are now using Firebase's own [firebase.firestore.Timestamp.now](https://firebase.google.com/docs/reference/js/firebase.firestore.Timestamp#now) to ensure that we always get a timestamp in the preferred format. This has been tested locally but can only be verified when merged to master and we start getting new data. In the meantime, I'll manually fix up all the entries in the store. - There should be one app bundle size comment for Android and one for iOS in this PR. Reviewed By: cpojer Differential Revision: D20601620 Pulled By: hramos fbshipit-source-id: 0c3e4b78a74cbd659f1957a6aa74322b016e0646 * Hopefully fix so loading crashes Summary: Changelog: [Android][Internal] Fix potential initializer interruption threading crashes. Reviewed By: mdvacca Differential Revision: D20615755 fbshipit-source-id: 58b706deeb6df1998caff5bf2ae9ec60114313fe * Fix label-actions configuration Summary: Adds back a missing label key, fixes open source issue: https://github.com/facebook/react-native/issues/28378 Changelog: [Internal] [CI] - Fix label-actions config Reviewed By: cpojer Differential Revision: D20625887 fbshipit-source-id: 63c90db249aa9c15369a4b5bcab71cbe75c6d4b8 * Changing Order Of mOverrideColorScheme In Constructor Summary: Changelog: [Android] [Updated] mOverrideColorScheme should be assigned before the first colorSchemeForCurrentConfiguration call, so the initial setting of mColorScheme will reflect the override Reviewed By: zackargyle Differential Revision: D20630173 fbshipit-source-id: a2a2d174d3fc40c14f27dce6a7fa8e67203480c9 * hermes | inspector | Don't include posix headers on non-posix systems Summary: Changelog: [Internal] Hermes inspector includes pthreads, arpa and sys headers on all OSes that would break vanilla Windows builds. This diff adds a check for posix-compliance before inclusion (Note: this ignores all push blocking failures!) Reviewed By: dulinriley Differential Revision: D20564449 fbshipit-source-id: 8e264bc3104065dc4315bb291e8560609fe65184 * Upgrade Prettier from 1.17 to 2.0.2. Summary: This gets us on the latest Prettier 2.x: https://prettier.io/blog/2020/03/21/2.0.0.html Notably, this adds support for TypeScript 3.8, which introduces new syntax, such as `import type`. Reviewed By: zertosh Differential Revision: D20636268 fbshipit-source-id: fca5833d003804333a05ba16325bbbe0e06d6c8a * Back out "Upgrade Prettier from 1.17 to 2.0.2." Differential Revision: D20639755 fbshipit-source-id: 5028563f9cf0527a30b4259daac50cdc03934bfd * Fabric: Additional temporary checks in prop parsing infra Summary: While ViewConfig infra isn't perfect we need to check some value for correctness during prop-parsing. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D20639055 fbshipit-source-id: 193dcd0769bc7777bc8d60c964ede72ebdaa83e4 * Update React package Summary: This just updates the `react` package to the latest stable version. We updated it to experimental internally earlier so this brings the open source version to the latest before the branch cut. This doesn't include any breaking changes. Changelog: [General][Changed] - Update to React 16.13.1 Reviewed By: cpojer Differential Revision: D20642909 fbshipit-source-id: 68a4c74bfe72f1abdb33b0b9071a4f4e8e568318 * Fix sketchy null checks induced by new formatting in Prettier 2.0 Summary: Update code to prepare for Prettier 2.0, which will reformat `a || (b || c)` to `a || b || c`. Changelog: [Internal] prepare for Prettier 2.0 Reviewed By: kassens Differential Revision: D20639483 fbshipit-source-id: c2932b1495884684172ba9291d56c546f51711b8 * RN picker - fix types in AndroidDialogPickerManagerInterface Summary: according to [this crash report](https://our.intern.facebook.com/intern/logview/details/facebook_android_crashes/7ba7056481015482c6166d65cb97e49d/?trace_key=1506fe36a70dd5e50cdc8968f6317f27), `value` was throwing an NPE despite being null-checked. this is because it was an `int` rather than an `Integer`, so the null check wasn't working Changelog: Fix types in AndroidDialogPickerManagerInterface Reviewed By: mdvacca Differential Revision: D20646343 fbshipit-source-id: a27587e0a48f5782bcf5ffddb604018218e65206 * Remove RCTExportModule log spam Summary: The bridge complains if modules aren't exported, which isn't really helpful with lazily loaded modules and turbo modules. I considered only turning this off when TurboModules is enabled, but figured we'd be killing this soon anyways... If anyone feels strongly I can go that approach. Changelog: [iOS][Internal] Remove RCTExportModule log spam Reviewed By: shergin Differential Revision: D20629575 fbshipit-source-id: d32d9fe244c4d06acfee982fca7c7f63da294dc5 * De-jank DevLoadingView Summary: ## Problems Repro steps: 1. Disable Fabric (because CMD + R doesn't work with Fabric right now). 2. Open up Marketplace and hit `CMD + OPT + R` 3. **Observe:** The progress bar doesn't show up right away. It also doesn't actually show progress. https://pxl.cl/140g1 RN Support post: https://fb.workplace.com/groups/rn.support/permalink/3437652016283389/ ## Fixes The first problem is that progress bar doesn't actually show progress. **Fix:** Bundle load progress is updated in `RCTCxxBridge`, where we first require `RCTDevLoadingView`, and then call its `updateProgress` method. Previously, we wouldn't lazily load `RCTDevLoadingView`, it already didn't exist. Lazily loading `RCTDevLoadingView` causes the progress view to show up. Here: https://pxl.cl/140gt If you look at the above video, you'll notice there are two stages to the progress bar: stage 1 displays the actual progress. Stage 2 prompts that we're downloading the JS bundle. As you can see, stage 1 and stage 2 have different background colors, even though both of them are green. **Fix:** I adjusted the JS to match the Native color. Here: https://pxl.cl/140gT We're almost there, but the progress bar is dismissed twice? **Fix:** I dug into the code, and the reason why was because when we hit `CMD + R`, we invalidate the bridge, and immediately re-initialize it. This means that we asynchronously invalidate the old TurboModuleManager, and immediately create a brand new one. Therefore, two `RCTDevLoadingView` modules can (and do) exist at once. So, I moved `RCTDevLoadingView` to be an instance member of `FBReactModule`, to ensure that it doesn't get cleaned up and re-created when TurboModuleManager is deleted and re-created. This finally fixed the progress bar jank: https://pxl.cl/140hn Changelog: [iOS][Fixed] - Remove RCTDevLoadingView jank Reviewed By: rickhanlonii Differential Revision: D20607815 fbshipit-source-id: 05825c67adaf3cfda70be0fa2dc92d413dc8921b * Fix retaining self in block in LogBox impl Summary: Logbox has a retain cycle (see linked task for my deeper investigation). This diff doesn't fix the retain cycle, but it's just good practice to not retain self strongly in blocks. Changelog: [iOS][Internal] Fix retaining self in block in LogBox implementation Reviewed By: shergin Differential Revision: D20630693 fbshipit-source-id: cf399495e9bcd1917932fcc0e9c9d2d2a32bf6f0 * Flow type infoLog Summary: Changelog: [General][Internal] flow type infoLog Reviewed By: zackargyle Differential Revision: D20577939 fbshipit-source-id: eed4401b2ae0a6bf845fdcb54c6abe1fe98fe7c1 * Replace fbsource// with // in xplat/js/ files [1] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: scottrice Differential Revision: D20495655 fbshipit-source-id: a57b72f694c533e2e16dffe74eccb8fdec1f55f5 * Deploy Flow 0.121 to Xplat (#901) Summary: Deploy Flow 0.121 to Xplat bypass-lint allow-large-files Closes https://github.com/facebook/flipper/pull/901 Changelog: [Internal] Reviewed By: panagosg7 Differential Revision: D20570316 fbshipit-source-id: a76983d6f46c8b995ce2dd5cd1e014534790698a * Replace fbsource// with // in xplat/js/ files [3] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D20656211 fbshipit-source-id: deb91b917d349bc500acbb03d734ff621f6e1fc7 * Replace fbsource// with // in xplat/js/ files [4] Summary: `fbsource//xplat` and `//xplat` are equivalent for FB BUCK targets. Removing extra prefix for consistency. Changelog: [Internal] Reviewed By: JoshuaGross, shergin Differential Revision: D20656696 fbshipit-source-id: 10f02decb1dc969fd3491ac90d97f09e2bda59e7 * Add Needs: Repro bot action (#28397) Summary: Add automated response for Needs: Repro ## Changelog [Internal] [Added] - Add automated response for Needs: Repro Pull Request resolved: https://github.com/facebook/react-native/pull/28397 Test Plan: Bot should add a comment with the Needs: Repro label. Reviewed By: cpojer Differential Revision: D20665378 Pulled By: hramos fbshipit-source-id: 1c7d878faacf935a640849f74c81f119e5c7e92d * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D20666684 fbshipit-source-id: 32255ac7509e0257693969a7b4b044569af30df7 * ✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392) Summary: Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`. Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job. What was done in this PR: * The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use. * The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument. * The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument * The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument ## Changelog [Internal] [CI] - ✅ Green CI, disabled test infrastructure work Pull Request resolved: https://github.com/facebook/react-native/pull/28392 Test Plan: Verified on Circle CI Reviewed By: cpojer Differential Revision: D20665512 Pulled By: hramos fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726 * Upgrade internal packages to support ESLint >= 6 (#28393) Summary: Fixes https://github.com/facebook/react-native/issues/28293 I've tested it with https://github.com/react-native-community/react-native-template-typescript and it seems to be working as expected - no warnings, supports typescript 3.8. (note: I didn't upgrade the package version as I don't know how the releases work for this package) ## Changelog [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/28393 Reviewed By: hramos Differential Revision: D20647112 Pulled By: cpojer fbshipit-source-id: ca6b67971f625dc8125a58f9220dfcd86250ba94 * Fabric: Fixing a deadlock in RCTSurfacePresenter Summary: This is another attempt to fix an issue very similar to T59424871. The previous attempt was in D19249490. I don't know why we don't see production crashes (stalls) but it happened to me (and not to me) in the debugger. The previous attempt didn't work because we still could have a deadlock because we tried to acquired shared mutex already owned exclusively by the `suspend` method. Here is another approach: Instead of using one shared mutex, now we use two. One is similar to what we had and another that protects `suspend` and `resume`. Besides that, now we pass a Scheduler to functions that use that explicitly. This way we can be more explicit about acquiring mutexes and the overall flow of execution. The idea is: Now an arbitrary code that can be reentrant does not cover with mutexes, so the deadlock is not possible. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20639228 fbshipit-source-id: 98515742f00f2ae94b50b585c9f1f0611e169ebe * Update React Hooks Plugin Summary: Updates `eslint-plugin-react-hooks` to 3.0.0. This introduces a new lint error when you use a Hook inside a class. Changelog: [General][Changed] - Updated the React Hooks ESLint Plugin Reviewed By: cpojer Differential Revision: D20675528 fbshipit-source-id: d0cbe9748fd15df7a4c6de00bd1462610e0a43d6 * Upgrade React DevTools 4.0.6 -> 4.6.0 Summary: Upgrading the embedded version of React DevTools, primarily to pull in [this PR](https://github.com/facebook/react/pull/18397) which will reduce the impact of this package on `node_modules` size. # Update process Following a similar process as D15973709, I began by searching for [all of the references](https://our.intern.facebook.com/intern/biggrep/?corpus=xplat&filename=.json&case=false&view=default&extre=&s=%22react-devtools&engine=apr_strmatch&context=false&filter[uninteresting]=false&filter[intern]=false&filter[test]=false&grep_regex=) to the `react-devtools-core` package and updated all v4 usage to to point to the new 4.6.0 release: 1: Manually update "react-devtools-core" versions: ``` js/package.json js/react-native-github/package.json nuclide/package.json sonar/desktop/app/package.json sonar/desktop/plugins/reactdevtools/package.json vscode/modules/vscode-webview/package.json ``` 2: Setup Yarn proxy: ``` yarn config set proxy http://fwdproxy:8080/ yarn config set https-proxy http://fwdproxy:8080 ``` 3: Run "yarn" in each of the above directories. 4: Run the lockfile shell script: ``` ~/xplat/js/scripts/update-oss-yarn-lockfile.sh ``` 5: Update the generated `MOBILE_JS_NODE_MODULE_DEPS.bzl` by running ``` js1 build buckfiles ``` ## Changelog: [General] [Changed] - Upgrade embedded React DevTools backend from v4.0.6 to v4.6.0. Reviewed By: cpojer, gaearon Differential Revision: D20676091 fbshipit-source-id: 99865bdba9bce45e2a7d582d5fb550cfdbeeca3a * Make ScrollView use ForwardRef Summary: Have ScrollView use forwardRef so that the host component methods like `measure` and `measureLayout` are available without having to call `getNativeScrollRef`. Instead, you can use `<ScrollView ref={myRef} />` and directly call all methods of ScrollView and host components on `myRef`. Previous usage: ``` const myRef = React.createRef<React.ElementRef<typeof ScrollView>>(); <ScrollView ref={myRef} /> const innerViewRef = myRef.current.getNativeScrollRef(); innerViewRef.measure(); ``` New usage: ``` const myRef = React.createRef<React.ElementRef<typeof View>>(); <ScrollView ref={myRef} /> // now, myRef.current can be used directly as the ref myRef.current.measure(); myRef.current.measureLayout(); // Additionally, myRef still has access to ScrollView methods myRef.current.scrollTo(...); ``` Changes: * Added deprecation warnings to ScrollView methods `getNativeScrollRef`, `getScrollableNode`, and `getScrollResponder` * Added the forwardRef call to create `ForwardedScrollView` - this takes in `ref` and passes it into the class ScrollView as `scrollViewRef`. * Forwarded the ref to the native scroll view using `setAndForwardRef`. * Added statics onto `ForwardedScrollView` so that `ScrollView.Context` can still be accessed. * Added type `ScrollViewImperativeMethods`, which lists the public methods of ScrollView. * Converted all public methods of ScrollView to arrow functions. This is because they need to be bound to the forwarded ref. * Bound all public methods of ScrollView to the forwarded ref in the `setAndForwardRef` call. * Flow typed the final output (ForwardedScrollView) as an abstract component that takes in the props of the `ScrollView` class, and has all methods of both the inner host component (`measure`, `measureLayout`, etc) and the public methods (`scrollTo`, etc). Changes to mockScrollView: * Changed mockScrollView to be able to mock the function component instead of a class component * Updated necessary tests Changelog: [General] [Changed] - Make ScrollView use forwardRef Reviewed By: TheSavior Differential Revision: D19304480 fbshipit-source-id: 6c359897526d9d5ac6bc6ab6d5f9d82bfc0d8af4 * Fix issue with onEndReached Summary: onEndReached can be triggered twice when more items are added to the end of the list. This change makes it so that a second call to onEndReached won't happen until the user scrolls down to the new end of the list. Changelog: [General] [Fixed] - Fix double call to onEndReached in VirtualizedList Reviewed By: sahrens Differential Revision: D20066740 fbshipit-source-id: 129d7ae6bfd241eeea18fe0bb12b82be67735874 * Remove console warnings from ScrollView methods Summary: The newly added console warnings in D19304480 are adding a lot of warning noise due to missed infra callsites. Those callsites need to be updated before these warnings can be added. Changelog: [Removed] Remove console warnings from ScrollView methods Reviewed By: rickhanlonii Differential Revision: D20700917 fbshipit-source-id: cb618ee3a291d26e1942e4f91bbc02dee41fb78b * Upgrade react-docgen, jscodeshift and flow-parser Summary: In preparation for upgrading babel, I'm updating some of our source transform tools to the latest versions. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D20675201 fbshipit-source-id: fa4fee2652529c6677087e42cdd1325a8080e46f * Ship State Reconciliation 100% on all platforms Summary: State Reconciliation has been running 50/50 for a while and all metrics look stable. This is necessary for providing a good experience so we should ship to everyone unconditionally. Changelog: [Internal] Fabric diffing reconciliation process improvement Reviewed By: mdvacca Differential Revision: D20715694 fbshipit-source-id: 25b2635ecc29b67e2911679c9db66bc84d37dec1 * Core telemetry tests: update so they pass on my machine Summary: `std::this_thread::sleep_for` is not really precise and will attempt to sleep for "at least" that much time, but may sleep much longer depending on what CPUs are doing and scheduling policies. To get this to pass on my machine, I had to substantially increase the thresholds. Changelog: [Internal] Reviewed By: shergin Differential Revision: D20689571 fbshipit-source-id: f159420d24a95da2b5d95d49ed7882e783291e98 * Optimize diff algorithm to produce fewer remove+insert ("move") paired instructions Summary: An evolution of D20633188 but more performant. There are three optimized paths before the slow path. The first optimized path tries to pair identical nodes from old/new tree, and generate Update mutations, until we hit nodes that are different (indicating either a remove or an insert). This already existed. The next two optimizations, introduced by Tim in his JS pseudocode, were inspired by ReactJS's diffing algorithm. They work in cases where the rest of the nodes are (1) all removals/deletes or (2) all creates+inserts. Finally, if those final two optimized paths can't run, it's because there is a mix of delete+remove, create+insert, and "move" operations, mixed at the beginning, middle, and/or end of the list. This has slightly better average/best-case complexity as the previous implementation. In particularly pathological cases where all nodes are arbitrarily reordered, or reversed, for instance (ABCDE->EDCBA) the algorithm has the same complexity as the previous algorithm (quadratic). For now iOS is pinned to the older differ Changelog: [Internal] Experiment to optimize diffing algorithm in Fabric Reviewed By: shergin Differential Revision: D20684094 fbshipit-source-id: d29fba95a0328156c023e1c87804f23770ee1d91 * Unit test for V2 "minimal instruction" diffing algorithm Summary: This unit test is to verify that the new diffing algorithm generates a "minimal" instruction set, with regards to removes and inserts ("moves"). These unit tests are here to verify the expected behavior in this new algorithm, but these tests may be modified or deleted in the future if we decide we want to change this behavior. Changelog: [Internal] fabric unit test Reviewed By: mdvacca Differential Revision: D20706592 fbshipit-source-id: 5f9991498e0d788ecbf88d938bfe6d3f0f27af40 * Add ES Lint rules for `DynamicColorIOS()`and `ColorAndroid()` (#28398) Summary: The [PlatformColor PR](https://github.com/facebook/react-native/pull/27908) added support for iOS and Android to express platform specific color values. The primary method for an app to specify such colors is via the `PlatformColor()` method that takes string arguments. The `PlatformColor` method returns an opaque Flow type enforcing that apps use the PlatformColor method instead of creating Objects from scratch -- doing so would make it harder to write static analysis tools around Color values in the future. But in addition to `PlatformColor()`, iOS has a `DynamicColorIOS()` method that takes an Object. The Flow type for this Object cannot be opaque, but we still want to enforce that app code doesn't pass variables instead of Object literals or that values in the Objects are variables. To ensure `DynamicColorIOS()` can be statically analyzed this change adds an ESLint rule to enforce that `DynamicColorIOS()` takes an Object literal of a specific shape. A `ColorAndroid()` was also introduced not for practical use but just to test having platform specific methods for more than one platform in the same app. A second ESLint rule is created for `ColorAndroid` as well. ## Changelog [General] [Changed] - Add ES Lint rules for `DynamicColorIOS()`and `ColorAndroid()` Pull Request resolved: https://github.com/facebook/react-native/pull/28398 Test Plan: `yarn lint` passes. Reviewed By: cpojer Differential Revision: D20685383 Pulled By: TheSavior fbshipit-source-id: 9bb37ccc059e74282b119577df0ced63cb9b1f53 * fix: Android gradle config when bundling for release (#28415) Summary: This fix aims to address the issue when bundling an Android app for release and getting the error exhibited in https://github.com/facebook/react-native/issues/28002 which I also encountered myself. The config was changed sometime in November 2019 (as part of https://github.com/facebook/react-native/issues/26940, commit https://github.com/facebook/react-native/commit/a3b08048674e324dbe1f0ca816f35607e9e06a2f) to be very opinionated when it comes to the use of `npx` which Gradle itself cannot find anyway (I have `npx` installed globally and it didn't pick it up). Another issue that the use of `npx` creates is that Gradle should only ever use the currently installed react-native cli rather than a (possibly) higher version which may not always have backward compatibility. The proposed change simply throws a more descriptive error rather than defaulting to a tool which may or may not exist on the machine, be it CI or a development environment. I've also modified the RNTester app to reflect the correct config implementation relative to the RNTester app itself. In real projects, the config inside `android/app/build.gradle` should look similar to the following snippet: ``` project.ext.react = [ cliPath: "$rootDir/../node_modules/react-native/cli.js", entryFile: "index.js" ]; ``` ## Changelog [Android] [Fixed] - Gradle release config Pull Request resolved: https://github.com/facebook/react-native/pull/28415 Test Plan: - [x] Successfully bundled an Android release build with correct config - [x] Works with RNTester app Reviewed By: mdvacca Differential Revision: D20714372 Pulled By: hramos fbshipit-source-id: 4d66139249c6f840582a71a48c64e6a6595f7af0 * Reimplement D19965405: Small improvements in Differentiator/TinyMap Summary: Two things: 1) I reimplement Valentin's idea in D19965405, so that TinyMaps can be iterated over, with a couple of bugfixes (calling front() or back() on an empty vector will crash). 2) I now use TinyMap instead of better::map in the "optimized" diffing algorithm. 3) `erase` now actually removes elements from the vector, but only when more than half of elements have been erased. 4) If you repeatedly erase elements at the beginning of the vector, they will no longer be iterated over. This is a specific optimization for our heaviest TinyMap use-cases. These amount to some small but hopefully somewhat meaningful perf improvements. Changelog: [Internal] Fabric perf Reviewed By: shergin Differential Revision: D20718719 fbshipit-source-id: 91f4b2e2e0f6387ae484e43d5b0095103087baa6 * Remove LayoutInspectingPolicy.includeScrollViewContentOffset Summary: `LayoutInspectingPolicy` has two flags, `includeTransform` and `includeScrollViewContentOffset`. `includeScrollViewContentOffset` seems to be redundant for two reasons. # 1st From looking at callers, they have always the same value. I looked at all call sites, and they are either always both set to true or both set to false. # 2nd The way we include scroll view content offset, is through transformation, so setting `includeTransform` to true and `includeScrollViewContentOffset` to false will include content offset anyway. In order to make both flags work, we would need to introduce further changes to `getRelativeLayoutMetrics`. But since the flag isn't used anyway, I think it is better to get rid of it for now. If we need it in the future, we could re-introduce it. Reviewed By: shergin Differential Revision: D20622256 fbshipit-source-id: fb6156c66b752319ea928239fa723ff90688b0a0 * Add support for translation and rotation to operator * between Rect and Transform Summary: Changelog: [Internal] Until now `Rect operator*(Rect const &rect, Transform const &transform)` supported only scaling. Now it supports translation and rotation as well. Reviewed By: shergin Differential Revision: D20622876 fbshipit-source-id: 1b65393bd3fd6fd9a8941903e0f2681a10097e4a * Include transform property when calling getRelativeLayoutMetrics Summary: Changelog: [Internal] Current implementation of `measure` doesn't take transform into account.. So if you had a view which has width and height 100 and had `Scale(0.5, 0.5, 1)` (this will shrink view by half). Calling `getRelativeLayoutMetrics` would report its size being `{100, 100}`. This applies if view's parent has transformation as well, because transformation is applied to all subviews of the view as well. Reviewed By: mdvacca Differential Revision: D20621590 fbshipit-source-id: 2cf902a0494291c821ecada56f810c5e6620db5a * feat: migrate appveyor to circleci (#28245) Summary: This issue closes https://github.com/facebook/react-native/issues/28241 Migrated Windows test from AppVeyor to CircleCI ## Changelog [Internal] [Changed] - Migrated Windows test from AppVeyor to CircleCI Pull Request resolved: https://github.com/facebook/react-native/pull/28245 Test Plan: For CircleCI to Pass Reviewed By: cpojer Differential Revision: D20689163 Pulled By: hramos fbshipit-source-id: 285c762457ef00f7884ee9157b3f336044c0452f * Remove "Debug with Nuclide" option Summary: This is no longer needed. Reviewed By: cpojer Differential Revision: D20722274 fbshipit-source-id: 5bc3104e90811d724f42aadbf137ab8eff718ca0 * experiment to preload RN bridge after fb4a bookmarks render Summary: Changelog: [Android][Internal] add internal supermodule label Reviewed By: mdvacca Differential Revision: D20434200 fbshipit-source-id: fae50309cdd0df4a4523c2f88d1c8e01a7163575 * Fix CursorDrawable Color Tint for Android 10+ Summary: Accessing this field via reflection is explicitly blacklisted by Google in Android 10 and higher. They have provided a new API to change the color, which I have implemented here. [The old setColorFilter is deprecated](https://developer.android.com/reference/android/graphics/drawable/Drawable#setColorFilter(int,%20android.graphics.PorterDuff.Mode)) so I also updated that method call as well. Changelog: [General] [Fixed] Use new setTextCursorDrawable API for Android 10 Reviewed By: JoshuaGross Differential Revision: D20656068 fbshipit-source-id: 58a92b57c0a892c7c87fc5d735e4ceaa4e987ec7 * Early return on tinting CursorDrawable if no color supplied Summary: There's (potentially) a lot of expensive reflection calls here that, as best I can tell, end up being ignored if the supplied color is null. Better to early return. Changelog: [General] [Internal] Preclude reflection when setting cursor color if color is null Reviewed By: JoshuaGross Differential Revision: D20670594 fbshipit-source-id: 480a988355bbd79008002c4326d4b35035ec2a95 * Partial React Sync for Inspector Summary: Partial sync for React that includes: - https://github.com/facebook/react/pull/18388 - https://github.com/facebook/react/commit/dd7e5e4f5ac2ffac3171ef61daee2cb1edc69635 Created from this branch: https://github.com/facebook/react/compare/master...rickhanlonii:rh-partial-3-24?expand=1 Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20651395 fbshipit-source-id: 67baf7c407f75d9fd01c17f2203a77a38567100e * Enable inspector for Fabric Summary: ## Overview This diff refactors the Inspector, moving logic to look up view data for a touched view inside the renderer as `getInspectorDataForViewAtPoint`. We then implement that same function for Fabric in order to support the inspector in that renderer. Requires https://github.com/facebook/react/pull/18388 ## Motivation Reason one for this refactor is that, previously, the inspector held all of the logic to look up view data for a given x,y touch coordinate. To do this, it would take the React tag and coordinates, look up the native view tag, measure it, and then ask React internals for the Fiber information of that tag. All of this is deeply coupled to React internals, yet the logic is outside of React core in the Inspector. Reason two is that, for Fabric, the logic for getting the view data is different than Paper. In Fabric, we pass the x,y coordinates to native directly, which returns an instance handle. That handle can be used to measure the ShadowNode, or retrieve the Fiber information. By moving the logic into the renderer in React core, we decouple the implementation details of looking up view data for a tapped point and allow ourselves the ability to add and change renderer-specific code for the actual lookup without impacting outsiders like the Inspector. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D20291710 fbshipit-source-id: a125223f2e44a6483120c41dc6146ad75a0e3e68 * chore: update url of warning message from deprecated imports (#28452) Summary: Some of the repository name of Lean Core(https://github.com/facebook/react-native/issues/23313) libraries has been renamed. This PR updates the warning message to display the updated url. ## Changelog [General] [Changed] - Update warning message of deprecated imports Pull Request resolved: https://github.com/facebook/react-native/pull/28452 Test Plan: updated URL can be accessed. Reviewed By: cpojer Differential Revision: D20745184 Pulled By: TheSavior fbshipit-source-id: 2c3ed6a000b45022ca6c4862305aa567c4d18b2e * Add `upgrade-support` link on issue creation (#28411) Summary: This PR adds a https://github.com/react-native-community/upgrade-support link for the user when creating an issue. Changelog: [Internal] Pull Request resolved: https://github.com/facebook/react-native/pull/28411 Reviewed By: cpojer Differential Revision: D20714274 Pulled By: hramos fbshipit-source-id: 4ca42224a50e386b95f21f0fb236a917e1b6b982 * Update PixelRatio 'getFontScale' method description (#28407) Summary: Refs facebook/react-native-website#1776. Despite in-code description `PixelRatio.getFontScale()` is working properly on the iOS (it also reflects the user settings). This PR updates the in-code description to match current behaviour. I have decided to skip in the code information about additional setting in `Accessibility` menu and in `Control Centre`, but if you think it is important just let me know, I can update this PR. ## Changelog [Internal] [Fixed] - Fix PixelRatio getFontScale method description Pull Request resolved: https://github.com/facebook/react-native/pull/28407 Test Plan: N/A Differential Revision: D20750260 Pulled By: shergin fbshipit-source-id: c40ec2fd49cd60e2975351c3a1c453aab0045da4 * Remove allowDisablingImmediateExecutionOfScheduleMountItems feature flag Summary: No longer needed. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20747684 fbshipit-source-id: a8077519b7670d72e23267b1c1423556ec97be3f * RuntimeExecutor helpers that modify the way of the callback is being executed. Summary: Here we implement a bunch of helper methods that allow customizing the behavior of a RuntimeExecutor "on-demand" on the caller side. We will use it in the next diff(s). Changelog: [Internal] Fabric-specific internal change. Reviewed By: PeteTheHeat Differential Revision: D20551411 fbshipit-source-id: 51d3cd02b69753110c0e1155347c6e52eb882c7d * Fabric: Using `executeSynchronouslyOnSameThread_CAN_DEADLOCK` in MainRunLoopEventBeat Summary: We are replacing inline-ed implementation with practically the same one implemented as the helper method. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20551409 fbshipit-source-id: fcc6f497cd240af65fba534051c217fe5746ce82 * Set RootNodeKind trait in ModalHostViewShadowNode Summary: Changelog: [internal] `ModalHostViewShadowNode` didn't have `RootNodeKit` trait, therefore `getRelativeLayoutMetrics` was including nodes in ancestors that it shouldn't have. Reviewed By: shergin Differential Revision: D20735801 fbshipit-source-id: 6b81e3b174c2f82e530abc2bca2da8bebc2270b0 * mention RNTester app in contributor guide (#28042) Summary: motivation is following - the RNTester app is imho the best place to try out any changes that a contributor would make, yet it is not directly mentioned in the contributor guide. This fixes it. ## Changelog [Internal] - Docs Pull Request resolved: https://github.com/facebook/react-native/pull/28042 Test Plan: not necessary Reviewed By: TheSavior Differential Revision: D20401260 Pulled By: hramos fbshipit-source-id: 01c1b7dff56b59909c94b2feb609650f0baba1a9 * Buck: Use Android SDK 29 during build (#28455) Summary: Fixes `test_android` and `test_docker` build failures. Thanks to dulmandakh for identifying the fix. Changelog: [Internal] [Android] [Changed] - Use Android SDK 29 to build during CI tests Pull Request resolved: https://github.com/facebook/react-native/pull/28455 Test Plan: Circle CI shows `test_android` and `test_docker` passing: https://app.circleci.com/jobs/github/facebook/react-native/142273 Reviewed By: sturmen Differential Revision: D20766589 Pulled By: hramos fbshipit-source-id: 8ef8a8ce3a6e7353ae47425accb3bd26cf1608c4 * Assign orderIndex_ in ConcreteViewShadowNode constructor instead of ViewShadowNode's constructor Summary: Changelog: [Internal] `orderIndex_` was only being assigned for `ViewShadowNode`, not for other `ShadowNodes` that are later represented on the screen. Reviewed By: shergin Differential Revision: D20746477 fbshipit-source-id: c04c2cfea14b9141d22bc3d9e9bb4c0c59925754 * Implement nativePerformanceNow to improve Profiler API results (#27885) Summary: When experimenting with React Profiler API (https://reactjs.org/docs/profiler.html), I noticed that durations are integers without a debugger, but they are doubles with higher precision when debugger is attached. After digging into React Profiler code, I found out that it's using `performance.now()` to accumulate execution times of individual units of work. Since this method does not exist in React Native, it falls back to Javascript `Date`, leading to imprecise results. This PR introduces `global.nativePerformanceNow` function which returns precise native time, and a very basic `performance` polyfill with `now` function. This will greatly improve React Profiler API results, which is essential for profiling and benchmark tools. Solves https://github.com/facebook/react-native/issues/27274 ## Changelog [General] [Added] - Implement `nativePerformanceNow` and `performance.now()` Pull Request resolved: https://github.com/facebook/react-native/pull/27885 Test Plan: ``` const initialTime = global.performance.now(); setTimeout(() => { const newTime = global.performance.now(); console.warn('duration', newTime - initialTime); }, 1000); ``` ### Android + Hermes ![Screenshot_1580198068](https://user-images.githubusercontent.com/13116854/73245757-af0d6c80-41b5-11ea-8130-dde14ebd41a3.png) ### Android + JSC ![Screenshot_1580199089](https://user-images.githubusercontent.com/13116854/73246157-92256900-41b6-11ea-87a6-ac222383200c.png) ### iOS ![Simulator Screen Shot - iPhone 8 - 2020-01-28 at 10 06 49](https://user-images.githubusercontent.com/13116854/73245871-f136ae00-41b5-11ea-9e31-b1eff5717e62.png) Reviewed By: ejanzer Differential Revision: D19888289 Pulled By: rickhanlonii fbshipit-source-id: ab8152382da9aee9b4b3c76f096e45d40f55da6c * Save/restore IP when leaving the interpreter Summary: This diff implements the instruction pointer save/restore trick Tzvetan came up with; allowing us to observe and modify the IP from outside the interpreter loop with negligible overhead. From Tzvetan's internal post on the subject: > [Today] the interpreter IP is just a local variable in the interpreter function, so there is no way to get to its value from outside the function. It lives in a register and we don't want to make it a Runtime field since the overhead [of accessing it via memory in the interpeter loop] would kill us. > However, if you really think about it, it only lives in a register while the interpreter function is running. For the rest of the time, it is spilled by the C++ compiler onto the stack. So, precisely when we need it, it is actually stored in memory. The only problem is, we don't know where! Admittedly, that is an annoying problem, but it feels like it should be solvable. > What if, instead of relying on the compiler to spill the IP register, we manually spill it ourselves, to a known location? It works. Example: https://godbolt.org/z/ftSDnp This diff implements this approach across the whole interpreter loop: whenever we call out of the loop we capture/publish the IP and restore it again immediately after the external call returns. This means we can now see the IP outside the interpret loop and even change it. This is effectively "for free" as the compiler now skips spilling/restoring the IP behind the scenes. The immediate benefit of this is knowing the current IP allows us to have more accurate stack-traces during execution. In future this may enabled tricks like changing the IP before returning to the interpreter loop, allowing things outside the interpreter to affect program flow without adding logic to the interpreter loop. Reviewed By: tmikov Differential Revision: D20151091 fbshipit-source-id: 3814382639800208d8985a32ede31ba8f7ff7c80 * Plumb through memory allocation profiler feature to Chrome Inspector Summary: Changelog: Make allocation profiler feature of Chome Inspector work Reviewed By: dulinriley Differential Revision: D20383003 fbshipit-source-id: 8a10c310d5a639a6644763adb53f2f0017057587 * chore: update lint config in template (#28443) Summary: Updating the eslint config and metro-preset used in project template. ## Changelog [General] [Changed] - Upgrade eslint-config and metro-preset in project template Pull Request resolved: https://github.com/facebook/react-native/pull/28443 Test Plan: - Start new project with `npx react-native init TestLint` - upgrade lint and metro-config - run lint and start up emulator on iOS and android Reviewed By: cpojer Differential Revision: D20771048 Pulled By: hramos fbshipit-source-id: a6d387b8687cee348681bcb10d22c7e3de291ed7 * Apply buckformat in preparation for updating buildifier Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D20773287 fbshipit-source-id: 144bb13191312eef246646b99e1dc06304c6d210 * Circle CI Housekeeping: Windows, e2e (#28471) Summary: Circle CI Housekeeping: * Integrate Windows job into `tests` workflow * Add parametrized e2e tests command * Move js e2e tests out of the disabled test quarantine area * Parametrize and split `test_ios` job to reduce total execution time by ~13 minutes **Before:** Longest running iOS job at 39 minutes. | Setup Job Runtime | Job | Job Runtime | Total Runtime | | - | - | - | - | | 01:24 | test_ios | 38:04 | **39:28** | | 01:24 | test_ios_frameworks | 38:02 | 39:26 | ![Screen Shot 2020-03-31 at 12 40 29 PM](https://user-images.githubusercontent.com/165856/78068308-044c3280-734d-11ea-96bf-2e50691a0ef7.png) **After:** Longest running iOS job down to 26 minutes. | Setup Job Runtime | Job | Job Runtime | Total Runtime | | - | - | - | - | | 01:26 | test_ios_unit | 20:48 | 22:14 | | 01:26 | test_ios_unit_frameworks | 22:52 | 24:18 | | 01:26 | test_ios_detox | 24:35 | 39:28 | | 01:26 | test_ios_detox_frameworks | 24:54 | **26:20** | ![Screen Shot 2020-03-31 at 12 39 22 PM](https://user-images.githubusercontent.com/165856/78068294-fe565180-734c-11ea-96da-8836231d7747.png) ## Changelog [Internal] [CI] - CI Housekeeping Pull Request resolved: https://github.com/facebook/react-native/pull/28471 Test Plan: Circle CI Reviewed By: cpojer Differential Revision: D20774521 Pulled By: hramos fbshipit-source-id: 4a2f5a4083cd76dcb51d5ccaf726cd204fca222e * Fix bug in optimized differ Summary: The differ was still producing correct, but not minimal, instruction sets in some cases due to an optimization that was buggy. This affected cases where 2+ nodes were inserted at the beginning of a list. It would trigger the old behavior where all nodes after the first would be removed, deleted, then reinserted. See the test case (which was failing and now passed) and P128190998 (the 3->4 transition) for samples. Changelog: [Internal] Fabric differ Reviewed By: mdvacca Differential Revision: D20785729 fbshipit-source-id: 2fea6a816753066abb358ed7bb51003140cd5fc4 * Use `buildCodeFrameError` in babel-plugin-inline-view-configs Summary: The next version of Babel changes how it prints file names in errors. This diff fixes the test by using `/` as the `cwd` and switches the plagin to use `path.buildCodeFrameError` so errors will be more helpful for users. I renamed the `nodePath` variable to `path` because that's what babel plugins usually do. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D20781805 fbshipit-source-id: cc149dce6389aa9402ce70ea30035c74a6150ea3 * Swap left and right yoga position with start and end in RTL context Summary: Changelog: [Internal] Paper swaps right and left in RTL setting, this logic is in [RCTShadowView.m](https://our.intern.facebook.com/intern/diffusion/FBS/browse/master/xplat/js/react-native-github/React/Views/RCTShadowView.m?commit=cdd504cfbee66ae0659495604c4ff7b5764a1d9e&lines=529-549). For Fabric instead of doing it during yoga props assignment, I swap the left/right with start/end just before we pass yoga nodes to layout calculation. Reviewed By: shergin Differential Revision: D20420040 fbshipit-source-id: b777f2658f56c173743b2034b8b5059e3e0c9840 * Fix inline-view-configs test on Windows. Summary: *facepalm* The file path is platform specific. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D20793023 fbshipit-source-id: 4fbcbf982911ee449a4fa5067cc0c5d81088ce04 * Pass isRTL flag from FabricUIManager Fabric core Summary: Changelog: [Internal] Send `isRTL` flag and `doLeftAndRightSwapInRTL` flags from Java to Fabric Core. Reviewed By: JoshuaGross, mdvacca Differential Revision: D20776005 fbshipit-source-id: 946c239d9a11ebea958b0a6d04f2316b7cd77311 * Promote shadowColor to formsStackingContext property Summary: Changelog: [Internal] View with `ShadowColor` was getting flattened and therefore views didn't have shadow property set. This is fixed by promoting ShadowColor so in case it is set, it forms stacking context. Reviewed By: shergin Differential Revision: D20792201 fbshipit-source-id: 1033ac00e32047ffbb14e61b7c26348c578d132d * Get CallInvokers from the bridge Summary: ## Context For now, assume TurboModules doesn't exist. **What happens when we call an async NativeModule method?** Everytime JS calls an async NativeModule method, we don't immediately execute it. The legacy infra pushes the call into some queue managed by `MessageQueue.js`. This queue is "flushed" or "emptied" by the following events: - **Flushed:** A C++ -> JS call. NativeModule async methods can called with an `onSuccess` and/or `onFail` callback(s). Calling `NativeToJsBridge::invokeCallback` to invoke one of these callbacks is one way for ObjC++/C++/Java to call into JS. Another way is via JSModule method calls, which are initiated by `NativeToJsBridge::callFunction`. - **Flushed:** When `JSIExecutor::flush` is called. Since TurboModules don't exist, this only happens when we call `JSIExecutor::loadApplicationScript`. - **Emptied:** When more than 5 ms have passed, and the queue hasn't been flushed/emptied, on the next async NativeModule method call, we add to the queue. Afterwards, we empty it, and invoke all the NativeModule method calls. **So, what's the difference between flushed and emptied?** > Note: These are two terms I just made up, but the distinction is important. If the queue was "flushed", and it contained at least one NativeModule method call, `JsToNativeBridge` dispatches the `onBatchComplete` event. On Android, the UIManager module is the only module that listens to this event. This `onBatchComplete` event doesn't fire if the queue was "emptied". **Why does any of this matter?** 1. TurboModules exist. 2. We need the TurboModules infra to have `JsToNativeBridge` dispatch `onBatchComplete`, which depends on: - **Problem 1:** The queue being flushed on calls into JS from Java/C++/ObjC++. - **Problem 2:** There being queued up NativeModule async method calls when the queue is flushed. In D14656466, fkgozali fixed Problem 1 by making every C++/Java/Obj -> JS call from TurboModules also execute `JSIExecutor::flush()`. This means that, with TurboModules, we flush the NativeModule async method call queue as often as we do without TurboModules. So far, so good. However, we still have one big problem: As we convert more NativeModules to TurboModules, the average size of the queue of NativeModule method calls will become smaller and smaller, because more NativeModule method calls will be TurboModule method calls. This queue will more often be empty than not. Therefore, we'll end up dispatching the `onBatchComplete` event less often with TurboModules enabled. So, somehow, when we're about to flush the NativeModule method call queue, we need `JsToNativeBridge` to understand that we've executed TurboModule method calls in the batch. These calls would have normally been queued, which would have led the queue size to be non-zero. So if, during a batch, some TurboModule async method calls were executed, `JsToNativeBridge` should dispatch `onBatchComplete`. **So, what does this diff do?** 1. Make `Instance` responsible for creating the JS `CallInvoker`. 2. Make `NativeToJsBridge` responsible for creating the native `CallInvoker`. `Instance` calls into `NativeToJsBridge` to get the native `CallInvoker`. 3. Hook up `CatalystInstanceImpl`, the Android bridge, with the new JS `CallInvoker`, and the new native `CallInvoker`. This fixes `onBatchComplete` on Android. iOS work is pending. Changelog: [Android][Fixed] - Ensure `onBatchComplete` is dispatched correctly with TurboModules Reviewed By: mdvacca Differential Revision: D20717931 fbshipit-source-id: bc3ccbd6c135b7f084edbc6ddb4d1e3c0c7e0875 * Make HermesRuntime::description() always include "HermesRuntime" Summary: If name is passed in as part of RuntimeConfig, that is included in the description, too. Changelog: [Internal] Reviewed By: dulinriley Differential Revision: D20716320 fbshipit-source-id: f2fba6df32f496090dee787d8b7f55a6a4dd8ed8 * Fix Yoga flexshrink with min-width sizing issue Summary: While resolving the flexible items we calculate totalFlexShrinkScaledFactors which uses the flexBasis or initial width of node (Not min-width). At a later stage during distribution of space we are subtracting value from this which also takes care of min-width. For example If node has flexShrink 1 and width 100 and min-width 301 then totalFlexShrinkScaledFactors will become -1*100 = -100 but later we are subtracting -1 * 301 (min-width) = -301 which is ambiguous and causing layout inconsistencies with how web behaves. Fixed this by only using the flexBasis or width for these calculations. Changelog: [Internal][Yoga] Fix layout issue when flexShrink and min-width are used together Reviewed By: pasqualeanatriello Differential Revision: D20219419 fbshipit-source-id: 948fbc06ca541d4ad307c88c8a2df65d157778b1 * More consistent snapshots on windows (#28482) Summary: Get jest tests to be runnable on windows, and match current snapshots ## Changelog [Internal] [Fixed] - More consistent snapshots on windows Pull Request resolved: https://github.com/facebook/react-native/pull/28482 Test Plan: run `yarn test` on a windows machine, and hit the test_windows circleci tests Reviewed By: hramos Differential Revision: D20799002 Pulled By: cpojer fbshipit-source-id: da3db0171c34a43199c7d3dc17b622b37bc91701 * Improve component stack parsing Summary: Update the error log message parsing to fix missing component stacks in console.errors. Changelog: [Internal] Reviewed By: cpojer Differential Revision: D20801985 fbshipit-source-id: ae544200315a8c3c0310e8370bc38b0546734f38 * Implement RCTWarn equivalent on Android Summary: ## Overview This diff is an RFC to port a logging feature from iOS to Android. Changelog: [Internal] ## Motivation On iOS we have the following log functions and behaviors available for logging native warnings and errors: - **Warnings** (`RCTLogWarn`) - Log level 'warn' to console - Display warning in LogBox - **Errors** (`RCTLogError`) - Log level 'error' to console - Display a native RedBox (needs converted to show a LogBox if available) - **Logs** - We also have `RCTLog`, `RCTTrace`, `RCTAdvice`, `RCTInfo`, which just log to the console. In Java, we have: - **Warnings** - **None**, added in this diff - **Errors** (`DevSupportManager.showNewJavaError`) - Log level 'error' to console with `FLog.e` - Display a native RedBox (needs converted to show a LogBox if available - **Logs** - `ReactSoftException` (crashes the app??) - `ReactNoCrashSoftException` (only logs??) - Others? ## Details This diff adds a method to pair with `RCTLogWarn`, `DevSupportManager.showNewJavaWarning`, which will log to the console and show a LogBox warning if LogBox is available. ## Concerns I have a few concerns/questions about the state of logging on Android: - Should/can we move all of the logging to it's own class, like how RCTLog works? - Why does some logging happen on DevSupportManager and some in other classes? - If we moved it all to it's own class, how could we access the reactContext to call the RCTLog JS module Reviewed By: JoshuaGross Differential Revision: D20056394 fbshipit-source-id: 32d57e300685e46da8039fc77cb22b4084acf81a * Remove unused feature flag: useMapNativeAccessor Summary: useMapNativeAccessor isn't being used anywhere. Changelog: [Internal] Removing unused internal feature flags: mUseMapNativeAccessor and mUseArrayNativeAccessor Reviewed By: mdvacca Differential Revision: D20788147 fbshipit-source-id: bf670508326813602cb544f86d3d2164651d3394 * Remove unused Feature Flag: lazilyLoadViewManagers Summary: Remove unused feature flag. This is not used within Facebook and I'm not aware of usage outside of FB. Changelog: [Removed] Removing Android feature flag: lazilyLoadViewManagers Reviewed By: mdvacca Differential Revision: D20788210 fbshipit-source-id: 435316e3de7830d7cb7f14537351883e4fc6eeaa * Remove unused feature flag: enableExtraWebViewLogs Summary: Hard-coded to false everywhere, and write-only. We never read from this. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20788252 fbshipit-source-id: ae117ebc51db7045947b9713602527ff4220833e * Remove unused feature flag: logDroppedViews Summary: Remove unused internal feature flag, logDroppedViews. Changelog: [Internal] Reviewed By: lunaleaps Differential Revision: D20797353 fbshipit-source-id: 1bfea7fcce9e80cdb92cda59a89c7dd817d4a581 * Split loadApplicationScript into initializeRuntime and loadBundle (#27844) Summary: This is the first of three PRs related to enabling multi-bundle support in React Native. More details, motivation and reasoning behind it can be found in RFC [here](https://github.com/react-native-community/discussions-and-proposals/issues/152). Logic responsible for installing globals was pulled out from `loadApplicationScript` to `initializeRuntime` since it should be ran only once, what was left was renamed to `loadBundle`. It's based on dratwas work from [here](https://github.com/callstack/react-native/tree/feat/multibundle/split-load-application), but applied to current `master` to avoid rebasing 3-months old branch and issues that come with that. ## Changelog [Internal] [Changed] - split `loadApplicationScript` into `initializeRuntime` and `loadBundle` to enable multi-bundle support in the future Pull Request resolved: https://github.com/facebook/react-native/pull/27844 Test Plan: Initialized new RN app with CLI, set RN to build from source and verified the still app builds and runs OK using code from this branch. Reviewed By: rickhanlonii Differential Revision: D19888605 Pulled By: ejanzer fbshipit-source-id: 24ace48ffe8978796591fe7c6cf53a61b127cce6 * Back out "Fix controlled TextInput with child nodes" Summary: Changelog: [Internal] Original commit changeset: 1b8a2efabbfa Original diff D20587681 breaks non-controlled text input. Reviewed By: motiz88 Differential Revision: D20815935 fbshipit-source-id: 70577ed1e5701850ff0e30a6592945a31c2a8bec * Fixed crash in JSIExecutor::NativeModuleProxy Summary: JSIExecutor::NativeModuleProxy is an object created by JSIExecutor and essentially representing that in JavaScript world. Before this change, JSIExecutor::NativeModuleProxy had a raw reference to JSIExecutor which (I believe) caused a crash because JSIExecutor can be deallocated before JSIExecutor::NativeModuleProxy. Now, instead of storing a pointer to JSIExecutor, we store a weak pointer to JSINativeModules which we can safely validate before calling on it. Changelog: [Internal] Fixed crash in JSIExecutor Now the configuration looks like this: ``` + - - - - - - - - - - - - - - - - - - - - - Something else | | shared_ptr<jsi::Runtime> runtime --+ | | + - - - - - - - - - - - - - - - - - - - - - | | | +------------------------------------------+ | | | | | JSExecutorFactory | | +--------------------------------+-------------------------------+ | | +-----------------------+ | | | +------------------------------------------+ | | v | | | +------------------------------------------+ | +--------------------------+ | | | | | | | | ModuleRegistry | | v | | | | | +------------------------------------------+ | | +------------------------------------------+ | | HermesRuntimeImpl | | | | | | (jsi::Runtime) |--+ | | +->+------------------------------------------+ | | | | | | | |std::unordered_map<std::string, size_t> | | +------------------------------------------+ | | | | |modulesByName_ | | | | | | | | | | | | | +------------------------------------------+ | | | | +->+------------------------------------------+ | +-----------------------+ | | |std::vector<std::unique_ptr<NativeModule>>| | | | | |modules_ | | | | | | | | v | | +------------------------------------------+ | +------------------------------------------+ | | | | | | | | | JSIExecutor::NativeModuleProxy | | | | | | | | | +------------------------------------------+ | | | +------------------------------------------+ | | | | | | +->+------------------------------------------+ | | | | NativeToJsBridge | |shared_ptr<JSINativeModules> | | | | | | |nativeModules_ | | | | +------------------------------------------+ +------------------------------------------+--+-----+------------------------------------+ | | | | | | +->+------------------------------------------+ | | | | | |unique_ptr<JSExecutor> | | | | | | |m_executor | | | | | | |(`::destroy()` resets it.) | | | | | | +------------------------------------------+--------------------------------+ | | | | +->+------------------------------------------+ | | | | | | |shared_ptr<JsToNativeBridge> | | | | | | | |m_delegate | | | | | | | +------------------------------------------+--+ v | | | | +->+------------------------------------------+ | +------------------------------------------+ | | | | |shared_ptr<MessageQueueThread> | | | | | | | | |m_executorMessageQueueThread | | | HermesExecutor: JSIExecutor: JSExecutor | | | | | +------------------------------------------+ | | | | | | | | +------------------------------------------+ | | | | | | | | | | | +->+------------------------------------------+ | | | | | | |shared_ptr<jsi::Runtime> | | | | | | | |runtime_ | | | | | | | +------------------------------------------+--+ | | | | +->+------------------------------------------+ | | | | | |shared_ptr<JSINativeModules> | | | | | | |nativeModules_ | | | | | | +------------------------------------------+--------+------------------------------------+ | +--------------------------+ +->+------------------------------------------+ | | | | |std::shared_ptr<ExecutorDelegate> | | v | | |delegate_ | | +------------------------------------------+ | | +------------------------------------------+--+ | | | | | | | | JSINativeModules | | | | | | | | | | | +------------------------------------------+ | | | | | | | | | +-->+------------------------------------------+ | +-----------------------------------------------------------------------------------+ | |m_moduleRegistry | | | | |(shared_ptr) | | | | +------------------------------------------+--+ | | | | v | +------------------------------------------+ | | | | | JsToNativeBridge: ExecutorDelegate | | | | | +------------------------------------------+ | | | +->+------------------------------------------+ | |shared_ptr<ModuleRegistry> | | |m_registry | | +------------------------------------------+-----------------------------------------------------------------+ ``` Reviewed By: RSNara Differential Revision: D20817257 fbshipit-source-id: 9ae378dbe880aaabfef7ae783dae2f94ee4b0af5 * Fix crash caused by <Modal> trying to present view controller twice Summary: Changelog: [Internal] `_viewController` was being presented twice causing following exception ``` 'Application tried to present modally an active controller <FBReactRootViewController: 0x7fe741818b80; ``` Reviewed By: shergin Differential Revision: D20820395 fbshipit-source-id: 5c9489011e5f99d8bd37befbd544d2d55a650589 * Loosen up restrictions for internal changelogs (#28486) Summary: Do not nag on PRs that contain internal changelogs (meaning, the change doesn't need to be called out in release notes). ## Changelog [Internal] - This should be acceptable. Pull Request resolved: https://github.com/facebook/react-native/pull/28486 Test Plan: See PR. Reviewed By: cpojer Differential Revision: D20817454 Pulled By: hramos fbshipit-source-id: a7082c4db05ec53ad27349db7e5bce2cfffd6930 * Fix TextInlineViews when UIImplementation processes two roots at the same time Summary: This diff cleans the variable NativeViewHierarchyOptimizer.mTagsWithLayoutVisited right after all the view updates for a rootShadowNode have been processed by the UIImplementation class. This intends to fix the bug reported in the task: T61185028, which root cause seems related to the fact that the variable NativeViewHierarchyOptimizer.mTagsWithLayoutVisited is not cleaned up when updating multiple rootShadowNodes as part of the same batch changelog: [Android][internal] internal bug fix Reviewed By: JoshuaGross Differential Revision: D20812921 fbshipit-source-id: 28067ee29a931d7a9e9c33c90aceb4e3512dac1a * Add a React Feature Flag to control TextInlineView fix Summary: This diff adds a temporary Feature Flag to control a fix in TextInlineView (see previous diffs of the stack) changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D20812920 fbshipit-source-id: 90fece9b29ba173546d96e4d9baf1ccabb3031b2 * Pass native CallInvoker to ObjCTurboModule constructor Summary: This is necessary to integrate TurboModule async method dispatch with the bridge's `onBatchComplete` event. See D20717931 for more details. This diff is similar to D20480971. **Note:** This stack doesn't really make any functional changes, since the native CallInvoker is `nullptr` right now. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809199 fbshipit-source-id: bf465a3a51bdddb8b56d1e696ca510fdf071f9ec * Manual changes required to make ObjCTurboModule accept native CallInvoker Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809200 fbshipit-source-id: d540eec9a3360a031f75d76a6ab9fb15303f8af5 * Codemod all getTurboModuleWithJsInvoker methods to accept a native CallInvoker Summary: To make iOS TurboModules integrate with the bridge's onBatchComplete event, they need to use a native CallInvoker. This call invoker is created by the `NativeToJsBridge`, and ObjCTurboModule will use this native CallInvoker to dispatch TurboModule method calls. This diff makes sure that ObjCTurboModules are created with that native CallInvoker. ## Script ``` var withSpaces = (...args) => args.join('\s*') var regexString = withSpaces( '-', '\(', 'std::shared_ptr', '<', '(?<turboModuleClass>(facebook::react::|react::|::|)TurboModule)', '>', '\)', 'getTurboModuleWithJsInvoker', ':', '\(', 'std::shared_ptr', '<', '(?<callInvokerClass>(facebook::react::|react::|::|)CallInvoker)', '>', '\)', '(?<jsInvokerInstance>[A-Za-z0-9]+)', 'perfLogger', ':', '\(', 'id', '<', 'RCTTurboModulePerformanceLogger', '>', '\)', '(?<perfLoggerInstance>[A-Za-z0-9]+)', '{', 'return', 'std::make_shared', '<', '(?<specName>(facebook::react::|react::|::|)Native[%A-Za-z0-9]+SpecJSI)', '>', '\(', 'self', ',', '\k<jsInvokerInstance>', ',', '\k<perfLoggerInstance>', '\)', ';', '}', ) var replaceString = `- (std::shared_ptr<$<turboModuleClass>>) getTurboModuleWithJsInvoker:(std::shared_ptr<$<callInvokerClass>>)$<jsInvokerInstance> nativeInvoker:(std::shared_ptr<$<callInvokerClass>>)nativeInvoker perfLogger:(id<RCTTurboModulePerformanceLogger>)$<perfLoggerInstance> { return std::make_shared<$<specName>>(self, $<jsInvokerInstance>, nativeInvoker, $<perfLoggerInstance>); }` const exec = require('../lib/exec'); const abspath = require('../lib/abspath'); const relpath = require('../lib/relpath'); const readFile = (filename) => require('fs').readFileSync(filename, 'utf8'); const writeFile = (filename, content) => require('fs').writeFileSync(filename, content); function main() { const tmFiles = exec('cd ~/fbsource && xbgs -n 10000 -l getTurboModuleWithJsInvoker:').split('\n').filter(Boolean); tmFiles .filter((filename) => !filename.includes('microsoft-fork-of-react-native')) .map(abspath) .forEach((filename) => { const source = readFile(filename); const newSource = source.replace(new RegExp(regexString, 'g'), replaceString); if (source == newSource) { console.log(relpath(filename)); } writeFile(filename, newSource); }); } if (!module.parent) { main(); } ``` Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809202 fbshipit-source-id: 5d39b3cacdaa5681b70ce1803351d0432dd74550 * Make RCTTurboModuleManagerDelegate getTurboModule accept native CallInvoker and PerfLogger Summary: Might be worthwhile to just kill this method instead, since we're having all NativeModules provide their TurboModule jsi::HostObjects. But I'll leave that decision to a later time. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20809201 fbshipit-source-id: ee73d4b5454a76460832a54f9b864841e5b2b9c0 * eslint-config: add version badge and add homepage for eslint-config (#28506) Summary: Add version badge to README of eslint-config, and add specific url for the homepage so people looking at the npm package can find out where the package is from. ## Changelog [Internal] [Changed] - Add version badge to README of eslint-config Pull Request resolved: https://github.com/facebook/react-native/pull/28506 Test Plan: Not required as the only changes are made in README and homepage prop of package.json Differential Revision: D20837085 Pulled By: cpojer fbshipit-source-id: 820d3b44b069780ec8764c6152d2e7fd5220933c * Rename Instance::getNativeCallinvoker to Instance::getDecoratedNativeCallInvoker Summary: Now, instead of accepting a `std::function` that schedules work, and returning a `CallInvoker`, `Instance::getDecoratedNativeCallInvoker` will accept a `CallInvoker` that schedules work, and return a decorated `CallInvoker`. I think this change will help with readability. It also clarifies that the bridge is adding additional behaviour to the native `CallInvoker`. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20826885 fbshipit-source-id: a2c5681d10a4544ee3d2a0d1f1cbd386ef06d0e6 * Add CallInvoker::invokeSync Summary: We'll be using a native CallInvoker to dispatch sync and async method calls to ObjC NativeModules. This native CallInvoker will hold a reference to the ObjC NativeModule's method queue. **Why is the native CallInvoker required for ObjC NativeModules?** In the case where the ObjC NativeModule neither provides nor requests a method queue, we must create a method queue for it. When we go to invoke a method from JS, for these NativeModules specifically, there is no way to access this method queue. A native CallInvoker is a convenient abstraction that holds on to that method queue. For async calls, we'll just call `CallInvoker::invokeAsync`, and for sync calls, we'll just call `CallInvoker::invokeSync`. **Why do we need sync call support for native `CallInvoker`?** In ObjC, sync NativeModule method calls block the JS thread, then execute synchronously on the NativeModule's method queue, and then unblock the JS thread. This is what'll be implemented by `CallInvoker::invokeSync`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20829955 fbshipit-source-id: efb9d5408a1ade81069a943c865f232d4d10acfe * Export Instance::getDecoratedNativeCallInvoker from RCTCxxBridge Summary: `RCTTurboModuleManager` will create a native `CallInvoker` for each ObjC NativeModule. This `CallInvoker` will be used to dispatch calls from JS to native. Before passing the native `CallInvoker` to the `ObjCTurboModule`, it'll first use `RCTCxxBridge decorateNativeCallInvoker` to get a bridge-aware decorated native `CallInvoker`. That way, the bridge remains informed about async TurboModule method calls that took place since the last time it was flushed. This ensures that we don't end up dispatching `onBatchComplete` any less with TurboModules on than we do with TurboModules off. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D20831546 fbshipit-source-id: b2eb4e0097e0dabf8c4bd8fdc4c850a0858af699 * Add Author Feedback label automatically (#28484) Summary: Improve issue triage by automatically adding the "Needs: Author Feedback" label. NOTE: The old label-actions app should be disabled when this PR is merged: https://github.com/apps/label-actions/installations/7445225 ## Changelog [Internal] - Issue Triage Pull Request resolved: https://github.com/facebook/react-native/pull/28484 Test Plan: Verified the same `label-actions.yml` and workflow config on a private repo. Reviewed By: cpojer Differential Revision: D20817443 Pulled By: hramos fbshipit-source-id: 39732dd67509c9fb9cf6ff7306913f5ec088266d * docs: add README and specify file in package.json (#28507) Summary: Adding a README for `react-native-codegen` since the package was published. Also added a `files` prop in package.json so unused file won't be included in the package. ## Changelog [Internal] [Changed] - Add README for react-native-codegen. Pull Request resolved: https://github.com/facebook/react-native/pull/28507 Test Plan: verify js files to function correctly without including files other than `src` Reviewed By: rickhanlonii Differential Revision: D20836113 Pulled By: cpojer fbshipit-source-id: e860f14760e9c1dbe121f5fb95ccf72d4ddb2af1 * Make the link easier to copy. (#28516) Summary: Making a PR from GitHub, I need to copy-paste the link, and it would be easier to just triple-click a line with the URL rather than carefully selecting the URL from the text. <img width="723" alt="Screen Shot 2020-04-03 at 17 33 47" src="https://user-images.githubusercontent.com/100233/78378550-6c12af80-75d1-11ea-93a4-2eae568ce602.png"> ## Changelog [General] [Changed] - Make PR template easier to use with changelog URL. Pull Request resolved: https://github.com/facebook/react-native/pull/28516 Reviewed By: fkgozali Differential Revision: D20842238 Pulled By: hramos fbshipit-source-id: 3fef7a994f36a996bbbc52556600d468a56210a9 * Upgrade tests to Xcode 11.3.1 (#28498) Summary: Upgrade Sandcastle and Circle CI tests to use Xcode 11.3.1 across the board. Pull Request resolved: https://github.com/facebook/react-native/pull/28498 Pull Request resolved: https://github.com/facebook/react-native/pull/28501 Changelog: [Internal] - Use Xcode 11.3.1 in iOS tests Reviewed By: fkgozali Differential Revision: D20821844 fbshipit-source-id: b250ca82bdf2c9fb7faa765d3e2433eb46efd692 * Fixes iOS reload through metro "r" command key (#28477) Summary: This allows the iOS device to be reloaded through the metro command line, besides the fact that whenever packagerServerHost is called, it will only get the IP address once when debugging. ## Changelog [iOS] [Fixed] - Fixed connection of metro reload command to iOS device Pull Request resolved: https://github.com/facebook/react-native/pull/28477 Test Plan: - Build any react-native project in debug mode to an iOS device connected through USB - Press the “r” key on the terminal that is running metro - The device should now reload the project Reviewed By: cpojer Differential Revision: D20818462 Pulled By: TheSavior fbshipit-source-id: 6d9792447d205223dad8fbd955518885427cbba8 * Create method queues for NativeModules that neither provide nor request one Summary: ## Problem: Let `A` be the set of all ObjC NativeModules that neither provide nor reqeust a method queue. The TurboModule system dispatches all method calls to NativeModules in `A` synchronously to the JS thread. Here is the relevant logic: **RCTTurboModule.mm:** Link: https://fburl.com/diffusion/nz9gqje8 ``` jsi::Value performMethodInvocation( // ... ) { // ... dispatch_queue_t methodQueue = NULL; if ([instance_ conformsToProtocol:protocol(RCTBridgeModule)] && [instance_ respondsToSelector:selector(methodQueue)]) { methodQueue = [instance_ performSelector:selector(methodQueue)]; } if (methodQueue == NULL || methodQueue == RCTJSThread) { // This is the default mode of execution: on JS thread. block(); } else if (methodQueue == dispatch_get_main_queue()) { ``` **Why does this end up happening?** 1. NativeModules that request a method queue have `synthesize methodQueue = _methodQueue` in their `implementation` section. This generates a `methodQueue` getter for the NativeModule, and also creates an ivar to back that getter. The TurboModule system generates a `dispatch_queue_t` and uses ObjC's KVC API to write to the ivar. So in the above logic, for NativeModules that provide a method queue, methodQueue will neither be `NULL` nor `RCTJSThread`, so we don't dispatch synchronously to the JS thread. 2. NativeModules that provide a method queue will return something that is not `NULL` or something that is `RCTJSThread`. If they return `NULL`, the infra will throw an error early. If they return `RCTJSThread`, we'll dispatch synchronously to the JS thread, as we should (...wait. For async NativeModule methods that dispatch to `RCTJSThread`, should we dispatch asynchronously to the JS thread, via jsInvoker? **Edit:** Nope: https://fburl.com/diffusion/ivt9b40s.). In all other cases, we dispatch to appropriately to the respective method queue. 3. For NativeModules that neither provide nor request a method queue (i.e: NativeModules in `A`), they don't implement the `methodQueue` selector. Therefore, we dispatch synchronously to the JS thread. ## The fix (Part 1): The first step towards fixing this problem is to generate `dispatch_queue_t`s for NativeModules in `A`. That's what this diff accomplishes. Changelog: [iOS][Fixed] - Create method queue for NativeModules that don't provide nor request one. Reviewed By: fkgozali Differential Revision: D20821054 fbshipit-source-id: 17a73550ad96766c5c7e719e28e1cc879e36465c * Rename duplicate name `<ScrollView>` example on RNTester (#28515) Summary: Tiny change. When searching for `scro` in the RNTester, two `<ScrollView>`s come up, from different example files. One is the "simple" one and the other is the "regular" one. Before: <img width="370" alt="Screen Shot 2020-04-03 at 17 14 01" src="https://user-images.githubusercontent.com/100233/78377338-c6ab0c00-75cf-11ea-9c45-2dcdd6460f6d.png"> After: <img width="369" alt="Screen Shot 2020-04-03 at 17 13 38" src="https://user-images.githubusercontent.com/100233/78377371-cf034700-75cf-11ea-89ea-aa3ff2f3988c.png"> ## Changelog [Internal] [Changed] - Rename the "simple" ScrollView example in RNTester to "ScrollSimpleView". Pull Request resolved: https://github.com/facebook/react-native/pull/28515 Test Plan: - Try to search for `scro` in RNTester. Reviewed By: fkgozali Differential Revision: D20842264 Pulled By: hramos fbshipit-source-id: 3db54a826ae774108e62690e7f154e85b541520f * Fix Fabric SSTs, so they actually run in Fabric instead of Paper, convert ServerSnapshotTestsAppImpl to functional component Summary: Update instrumentation test infra for Fabric tests. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D19961919 fbshipit-source-id: 17264b6308712dddece730effd57832817e148cf * Fixed scrollview inset when RN view is embedded in another view (#27607) Summary: I'm using RNN, which embeds RN view inside native view controllers. On iOS 13, a modal view controller is "floating" and is offset from the top of the screen. This causes the calculation of inset in `KeyboardAvoidingView` incorrect as it mixes local view controller coordinate space, with keyboard's screen coordinate space. ## Changelog [iOS] [Fixed] - Fixed `KeyboardAvoidingView` inset in embedded views (i.e modal view controllers on iOS 13) Pull Request resolved: https://github.com/facebook/react-native/pull/27607 Test Plan: 1. Tested before and after in a simple view controller (should stay the same) 2. Tested before and after in a modal view controller (should be offset before, and fixed after) 3. Repeated no. 2 with each device rotation (upsideDown, landscapeLeft, landscapeRight) Reviewed By: cpojer Differential Revision: D20812231 Pulled By: TheSavior fbshipit-source-id: fbd72739fb7152655028730e284ad26ff4a5da73 * Bump react-native-codegen to 0.0.2 Summary: Changelog: [Internal] Reviewed By: cpojer Differential Revision: D20843514 fbshipit-source-id: c611bf91d311c6ce8a7e469d267a0417b2ee58e5 * Rename ScrollViewSimpleExample Summary: Changelog: [Internal] - Rename ScrollViewSimpleExample in RNTester Reviewed By: fkgozali Differential Revision: D20846977 fbshipit-source-id: 397589cb0a17beaf37a25b91ad8efa4a2bc62358 * Remove console warnings for innerViewNode/Ref Summary: Remove these warnings until the methods in ScrollResponder have been moved into ScrollView, so that unactionable warnings aren't firing. Changelog: [General][Removed] Remove console warnings for innerViewNode/Ref in ScrollView Reviewed By: TheSavior Differential Revision: D20850624 fbshipit-source-id: ce90988e204c3cc3b93536842ec3caa12cf6994e * Make TurboModules dispatch method calls via native CallInvoker Summary: This diff: 1. Has ObjC NativeModules use the native `CallInvoker` to invoke JS -> native sync/async calls. 2. Integrates the native `CallInvoker` for each ObjC NativeModule with the bridge. This way, the bridge is informed of all JS -> native TurboModule method calls, and dispatches `onBatchComplete` appropriately. Changelog: [iOS][Fixed] Integrate ObjC TurboModules async method calls with the bridge Reviewed By: fkgozali Differential Revision: D20831545 fbshipit-source-id: da1cbb4ecef4cae85841ca7ef625ab8e380760cd * add ripple config object to Pressable (#28156) Summary: Motivation is to support ripple radius just like in TouchableNativeFeedback, plus borderless attribute. See https://github.com/facebook/react-native/pull/28009#issuecomment-589489520 In the current form this means user needs to pass an `android_ripple` prop which is an object of this shape: ``` export type RippleConfig = {| color?: ?ColorValue, borderless?: ?boolean, radius?: ?number, |}; ``` Do we want to add methods that would create such config objects - https://facebook.github.io/react-native/docs/touchablenativefeedback#methods ? ## Changelog [Android] [Added] - support borderless and custom ripple radius on Pressable Pull Request resolved: https://github.com/facebook/react-native/pull/28156 Test Plan: Tested locally in RNTester. I noticed that when some content is rendered after the touchables, the ripple effect is "cut off" by the boundaries of the next view. This is not specific to Pressable, it happens to TouchableNativeFeedback too but I just didn't notice it before in https://github.com/facebook/react-native/pull/28009. As it is an issue of its own, I didn't investigate that. ![pressable](https://user-images.githubusercontent.com/1566403/75098762-785f2200-55ba-11ea-8842-e648317610e3.gif) I changed the Touchable example slightly too (I just moved the "custom ripple radius" up to show the "cutting off" issue), so just for completeness: ![touchable](https://user-images.githubusercontent.com/1566403/75098763-81e88a00-55ba-11ea-9528-e0343d1e054b.gif) Reviewed By: yungsters Differential Revision: D20071021 Pulled By: TheSavior fbshipit-source-id: cb553030934205a52dd50a2a8c8a20da6100e23f * Make TurboModule creation thread-safe Summary: NativeModules can be created from any number of threads. In the legacy system, `ModuleHolder`, the class responsible for creating NativeModules, has built-in concurrency control to ensure that NativeModule creation is thread-safe. This diff introduces that thread-safety to the TurboModule infra. Basically, after this diff, if `n` threads race to create a TurboModule x, only the first thread will create x. All other threads will wait until x is created. Changelog: [Android][Fixed] - Make TurboModule creation thread-safe Reviewed By: mdvacca Differential Revision: D20659799 fbshipit-source-id: 2b720fe1ea49e40ae0d6dae50d422f23a6f45520 * Remove unused fields from error dialog Summary: Removed in https://github.com/facebook/react/pull/18487 Changelog: [React Core] Logging changes Reviewed By: gaearon Differential Revision: D20853086 fbshipit-source-id: 4b0002f21269f415769a2ac8305ba5750245f7d1 * Fix crash when enabling Performance Monitor on iOS 13.4 (#28512) Summary: This PR fixes a crash when opening the Performance Monitor on iOS 13.4. Detailed info: https://github.com/facebook/react-native/issues/28414 ## Changelog `[iOS] [Fixed] - Fix crash when enabling Performance Monitor on iOS 13.4` ## How This PR prevents the JavaScriptCore option from being set altogether. This ensures that the performance monitor keeps working, but on iOS 13.4 and higher, it will no longer crash trying to show the GC usage. Pull Request resolved: https://github.com/facebook/react-native/pull/28512 Test Plan: Tested on iOS 13.4 (simulator): ![image](https://user-images.githubusercontent.com/6184593/77903803-c6370c00-7283-11ea-8b71-b6b6546c82f6.png) Tested on iOS 13.1 (simulator) ![image](https://user-images.githubusercontent.com/6184593/77903499-41e48900-7283-11ea-9d14-83f67a3b7b77.png) - Verified that the `setOption` was called, but the Performance Monitor didn't show any GC usage regardless. - Identical PR https://github.com/expo/react-native/pull/21 has been shipped and tested in Expo Client 37 Fixes https://github.com/facebook/react-native/issues/28414 Reviewed By: PeteTheHeat Differential Revision: D20851131 Pulled By: TheSavior fbshipit-source-id: ff96301036e8487db59f95947bbe6841fe230e1e * Modify warning message (#28514) Summary: Modify deprecation warning message for `AccessibilityInfo.fetch` - https://reactnative.dev/docs/accessibilityinfo#isscreenreaderenabled - https://github.com/facebook/react-native/commit/523ab8333800afbfb169c6fd70ab6611fe07cc2a ## Changelog [Internal] [Changed] - Modify deprecation warning message for `AccessibilityInfo.fetch` Pull Request resolved: https://github.com/facebook/react-native/pull/28514 Test Plan: Try using `AccessibilityInfo.fetch` and check log Reviewed By: cpojer Differential Revision: D20850223 Pulled By: TheSavior fbshipit-source-id: e21bb20b7a02d9f2ed6e27e2bfecbac0aebf9e09 * Set _borderLayer.frame when border changes Summary: Changelog: [Internal] Setting `_borderLayer.frame` inside `-[RCTViewComponentView layoutSubviews]` causes unwanted animation because it is not wrapped in `CATransaction`. Moving it to `-[RCTViewComponentView updateLayoutMetrics]` which is called inside `CATransaction`. Reviewed By: shergin Differential Revision: D20836890 fbshipit-source-id: 2048a25fd2edb8109f6275c1186c0adae4b9f504 * Add API for getting sourceURL directly from ReactContext Summary: In bridgeless mode, the CatalystInstance doesn't exist, but we still need to be able to access the sourceURL in SourceCodeModule (which is needed to render the images in LogBox warnings and errors). This diff adds a new API for getting the sourceURL directly from ReactContext, instead of having to call context.getCatalystInstance().getSourceURL(), and updates SourceCodeModule to use it. Changelog: [Internal] Reviewed By: RSNara Differential Revision: D20848700 fbshipit-source-id: 3ecda81a17121178b76bbb3e9b0f27f103c1961a * imp: Remove unused `npx` reference (#28544) Summary: Recently we removed `npx` usage from `react-native-cli` flow. After checking usages in this repo I found unused reference. ## 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] [Removed] - Remove unused `npx` reference Pull Request resolved: https://github.com/facebook/react-native/pull/28544 Test Plan: Tests pass Reviewed By: cpojer Differential Revision: D20873090 Pulled By: hramos fbshipit-source-id: 12e05e9635a83f19439024766817e4599320af98 * Add debug logs to track down T62192299 exception source Summary: Add debug logs to track down T62192299 exception source Changelog: [Internal] Reviewed By: RSNara Differential Revision: D20878063 fbshipit-source-id: 94acd56c45d4b529a695d1b4d2bfd10d8f725e63 * Back out "Fixed scrollview inset when RN view is embedded in another view" Summary: Original commit changeset: fbd72739fb71 Changelog: Back out "[react-native][PR] Fixed scrollview inset when RN view is embedded in another view" Reviewed By: TheSavior Differential Revision: D20878607 fbshipit-source-id: 0d77b9fb08c637f7894c399a219a242e472b0700 * Fail silently in AppStateModule.sendEvent if CatalystInstance is not available Summary: According to our logs, 80% of these warnings are coming from AppStateModule. It's not particularly interesting or surprising that the CatalystInstance would be torn down when there's some app event, so let's stop taking up DB space with a useless message. Reviewed By: ejanzer, mdvacca Differential Revision: D20879426 fbshipit-source-id: b1182461aed4a66d82cb34bbd4b12782af6ed7b3 * Move DebugEnvironment helper to open source Summary: This is an internal only module that we use to detect whether we are in async debugging mode. Changelog: [Internal] Reviewed By: yungsters Differential Revision: D20879780 fbshipit-source-id: 5915f4e1c54a3fda0cf607c77f463120264fdbc4 * Fix Appearance module when using Chrome Debugger Summary: The appearance module uses sync native module methods which doesn't work with the chrome debugger. This broke in 0.62: https://github.com/facebook/react-native/issues/26705 This fix makes the appearance module return 'light' when using the chrome debugger. Changelog: [Fixed] Appearance `getColorScheme` no longer breaks the debugger Reviewed By: yungsters Differential Revision: D20879779 fbshipit-source-id: ad49c66226096433bc9f270e004ad4a6f54fa8c2 * Extend Android ImageViewManager to support analyticsTag prop Summary: This diff extends the Android Image View manager to support the new analyticsTag prop. this prop is going to be used to track performance for images in android changelog: [Android][Added] Add analyticsTag prop into ImageView component Reviewed By: JoshuaGross Differential Revision: D20880602 fbshipit-source-id: e302e8fa83706e6517b228d44a3094a1686830f7 * Extend Image.android to support analyticsTag prop Summary: Quick diff to extend Image.android component to support analytics tag prop changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D20880601 fbshipit-source-id: 99bc11f36ce46953c00480f7c8d628cf6c0a9263 * Create ImageContext object to allow udpating the analyticsTag prop for RN sections Summary: As part of this diff I create the new ImageContext object that will be used to allow the update of the analyticsTag prop for components that contain multiple images in their view hierarchy changelog: [JS][Added] Add ImageContext object, this object can be used to update the Imageview's analyticsTag prop on RN components that contain multiple images in their view hierarchy Reviewed By: JoshuaGross Differential Revision: D20880603 fbshipit-source-id: f2094bfd3ab1c867cf7c107e678a098aab7e94a8 * Ez cleanup in ImageProps Summary: Ez cleanup in ImageProps, this import is not being used anymore changelog: [internal] internal change Reviewed By: JoshuaGross Differential Revision: D20880600 fbshipit-source-id: 7d903b5a6e16c37e61dec661b6bd1f9a6b442cc3 * Exclude all FlipperKit transitive dependencies from iOS Release builds (#28504) Summary: The `:configuration` option from `pod` only affects the specified pod and not its dependencies [1]. Therefore in order to avoid all transitive dependencies being linked in the resulting Release IPA we need to list them in the `Podfile`. Note that this will still build Flipper's pods when doing a Release, but it won't link it in the resulting IPA. [1] https://guides.cocoapods.org/syntax/podfile.html#pod Fixes https://github.com/react-native-community/upgrade-support/issues/28 Related https://github.com/CocoaPods/CocoaPods/issues/9658 ## Changelog * [iOS] [Fixed] - Exclude Flipper from iOS Release builds Pull Request resolved: https://github.com/facebook/react-native/pull/28504 Test Plan: Create a new React Native 0.62 project, run `pod install`, then diff: ``` ProjectName/ios/Pods/Target Support Files/Pods-ProjectName/Pods-ProjectName.debug.xcconfig` ``` and ``` ProjectName/ios/Pods/Target Support Files/Pods-ProjectName/Pods-ProjectName.relaese.xcconfig ``` ![image](https://user-images.githubusercontent.com/855995/78337679-a3fa0280-7591-11ea-8142-6f82cbc6be58.png) Reviewed By: passy Differential Revision: D20894406 Pulled By: priteshrnandgaonkar fbshipit-source-id: 680780f0f5a85fd8423b85a271a499bd12f06d00 * Fix crash in FabricUIManager.onMeasure Summary: Changelog: [Internal] The cause of crash was `NullPointerException`, which happened because of `mReactContextForRootTag.get(rootTag)` returning `null`. This is solved by checking whether it returns `null` before passing it to `I18nUtil`. Reviewed By: mdvacca Differential Revision: D20890623 fbshipit-source-id: c884c6838b83b944a5438375a4c060c1f5b1dc6e * Fix flow types of ImageContext Summary: ez diff to Fix flow types of ImageContext changelog: [internal] internal change to update flow types of ImageContext Reviewed By: TheSavior Differential Revision: D20883647 fbshipit-source-id: 6dba83ab431e56a71f96c39005ebcccf39a7da9a * Avoid passing analyticsTag prop to native if this is set to null Summary: This diff avoids passing the analyticsTag prop to native if this is set to null changelog: [internal] internal optimization Reviewed By: TheSavior Differential Revision: D20904498 fbshipit-source-id: f1ea1e5aa3199ef073668df86ca7cf6e20f70c5b * Rename analyticsTag -> internal_analyticsTag in ImageView component Summary: This diff renames the analyticsTag prop for the intenral_analyticsTag in ImageView component changelog: [internal] Creation of internal_analyticTag prop in ImageView, for now this prop is meant to be used internally. Reviewed By: TheSavior Differential Revision: D20904497 fbshipit-source-id: 2a28f746772ee0f9d657ec71549020c1f3e9d674 * Make Vibration.vibrate compatible with TurboModules (#27951) Summary: This PR fixes a compatibility issue with the Vibration module and TurboModules. The TurboModules spec doesn't allow nullable arguments of type Number, causing the following problem: ![IMG_3758](https://user-images.githubusercontent.com/1247834/73803879-10be6f80-4790-11ea-92d4-a008f0007681.PNG) ## Changelog [iOS] [Fixed] - Make Vibration library compatible with TurboModules. Pull Request resolved: https://github.com/facebook/react-native/pull/27951 Test Plan: Just submitted a PR to my own app to fix the issue [here](https://github.com/rainbow-me/rainbow/pull/340) The problem should be reproducible on RNTester due to this line: https://github.com/facebook/react-native/blob/91f139b94118fe8db29728ea8ad855fc4a13f743/RNTester/js/examples/Vibration/VibrationExample.js#L66 and should be working on this branch. Reviewed By: TheSavior Differential Revision: D19761064 Pulled By: hramos fbshipit-source-id: 84f6b62a2734cc09d450e906b5866d4e9ce61124 * Fix Cocoapods builds Summary: ## Problem For some reason, D20831545 broke the `use_frameworks!` build of RNTester. ## Building RNTester ``` pushd ~/fbsource/xplat/js/react-native-github/RNTester && USE_FRAMEWORKS=1 pod install && open RNTesterPods.xcworkspace && popd; ``` ## Error I built RNTester locally, and the error was this: ``` Undefined symbols for architecture x86_64: "facebook::jsi::HostObject::set(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&, facebook::jsi::Value const&)", referenced from: vtable for facebook::react::ObjCTurboModule in RCTImageEditingManager.o vtable for facebook::react::ObjCTurboModule in RCTImageLoader.o vtable for facebook::react::ObjCTurboModule in RCTImageStoreManager.o "facebook::jsi::HostObject::getPropertyNames(facebook::jsi::Runtime&)", referenced from: vtable for facebook::react::ObjCTurboModule in RCTImageEditingManager.o vtable for facebook::react::ObjCTurboModule in RCTImageLoader.o vtable for facebook::react::ObjCTurboModule in RCTImageStoreManager.o ld: symbol(s) not found for architecture x86_64 ``` ## Fix It looked like libraries that depend on "ReactCommon/turbomodule/core" weren't linking to JSI correctly. So, I modified all such Podspecs to also depend on "React-jsi": ``` arc rfr ' s.dependency "ReactCommon/turbomodule/core", version' ' s.dependency "ReactCommon/turbomodule/core", version\n s.dependency "React-jsi", version' ``` This seemed to do the trick. In buck, we'd fix this problem using exported_dependencies. I skimmed through cocoapods, and couldn't find such a configuration option there. So, I guess this will have to do? Changelog: [iOS][Fixed] - Fix Cocoapods builds of RNTester Reviewed By: fkgozali, hramos Differential Revision: D20905465 fbshipit-source-id: 60218c8274ec165752a428f2a7a9a546607c8fec * Add minimumSize to RCTRootView & RCTRootShadowView Summary: This adds a `minimumSize` property to RCTRootView, and forwards any changes to it's shadow view. This **does not** change any default behaviour, as the default minimum size is `CGSizeZero` before & after this diff. Changelog: [iOS][Internal] Add minimumSize to RCTRootView & RCTRootShadowView Reviewed By: RSNara Differential Revision: D20905456 fbshipit-source-id: a03f880e782891f60ef86b9c898965e05a5e796e * Make RCTNativeAnimatedModule into a TurboModule Summary: D20831545 integrated TurboModules with the bridge's `onBatchComplete` event. This fixed the RCTNativeAnimatedModule jank, so I'm re-converting RCTNativeAnimatedModule into a TurboModule. Changelog: [iOS][Fixed] - Make RCTNativeAnimatedModule TM-compatible Reviewed By: PeteTheHeat Differential Revision: D20850744 fbshipit-source-id: bb85a1bb27963e7d39bf149d0a3d7b71c88175da * upgrade to flow 0.122.0 Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D20919782 fbshipit-source-id: 3d5dc54ea4daafb8a1d96cad6c35a2dab4c24097 * Switch order of onSelectionChange and onChange events send from native Summary: Changelog: [Internal] UIKit uses either `UITextField` or `UITextView` as its UIKit element for `<TextInput>`. `UITextField` is for single line entry, `UITextView` is for multiline entry. There is a problem with order of events when user types a character. In `UITextField` (single line text entry), typing a character first triggers `onChange` event and then `onSelectionChange`. JavaScript depends on this order of events because it uses `mostRecentEventCount` from this even to communicate to native that it is in sync with changes in native. In `UITextView` (multi line text entry), typing a character first triggers `onSelectionChange` and then `onChange`. As JS depends on the correct order of events, this can cause issues. An example would be a TextInput which changes contents based as a result of `onSelectionChange`. Those changes would be ignored as native will throw them away because JavaScript doesn't have the newest version. Reviewed By: JoshuaGross Differential Revision: D20836195 fbshipit-source-id: fbae3b6c0d388fc059ca2541ae980073b8e5f6c7 * Maintain selection and cursor location when setting string on TextInput Summary: Changelog: [Internal] Calling `_backedTextInputView.attributedText = attributedString` causes cursor to be moved to the end of text input. This applies to both, `UITextField` and `UITextView`. This is not desired as when JS sets a new text, we don't want the cursor to be moved to the end of text input. JS has the option to use view commands if it wishes to move cursor somewhere. Reviewed By: JoshuaGross Differential Revision: D20836201 fbshipit-source-id: 9234e54cfbc5fc206f723626988e505275788aae * Implement event count for TextInput Summary: Changelog: [Internal] Implementation of event count for Fabric's Text input. Reviewed By: JoshuaGross Differential Revision: D20800185 fbshipit-source-id: 988692cb2fc786649821cccb06e629b40b9b0479 * Migrate setNativeProps to commands in iOS text input Summary: Changelog: Move from setNativeProps to ViewCommands. Reviewed By: JoshuaGross Differential Revision: D20843018 fbshipit-source-id: 9be9d2bbee01f2e15279e3c3ae785c1a5b163765 * Update default Podfile to not depend on a path (#28572) Summary: Recently, a default Podfile has been modified to not contain all the React Native pods, but use a helper method `use_react_native!`. While this is great, it assumes a hardcoded path of `../node_modules/react-native` to be always the correct location of the React Native. https://github.com/facebook/react-native/blob/d4d8887b5018782eeb3f26efa85125e6bbff73e4/scripts/autolink-ios.rb#L7-L9 Unfortunately, due to the way Ruby works, this completely hides the path away from the users. Before, they could have seen the wrong path explicitly in a Podfile and knew to update it to resolve path-related issues. With the current version in `master`, I can see a lot of issues where developers wonder how to resolve the path issues and how to pass the path itself. https://github.com/facebook/react-native/blob/4118d798265341061105f3a53550db83c66a71cb/template/ios/Podfile#L5-L10 This PR uses React Native CLI configuration (that is already used to link 3rd party dependencies) to explicitly define the correct path to the React Native. As a result, we don't have to change the paths here whether we're running monorepo or not. ## Changelog [IOS] [INTERNAL] - Always provide an explicit path to React Native Pull Request resolved: https://github.com/facebook/react-native/pull/28572 Differential Revision: D20945194 Pulled By: TheSavior fbshipit-source-id: 010f9754f2ed78ef62fd52f4d201f296f5af6d27 * chore: update CLI * fix: do not throw on missing `cliPath`, use the default value (#28625) Summary: The `cliPath` has always been optional value and in fact, even had its default value hardcoded in the React gradle file. In this PR, I am just taking use of it and remove throwing an error, which is going to be a really annoying breaking change. ## Changelog [ANDROID] [INTERNAL] - Don't require `cliPath` Pull Request resolved: https://github.com/facebook/react-native/pull/28625 Test Plan: Run Android project, everything works. Provide custom `cliPath`, it gets respected Reviewed By: cpojer Differential Revision: D21044222 Pulled By: TheSavior fbshipit-source-id: 8029f988d92abb9f64f30e05932c0d407d0c997e * chore: remove Kotlin version from the default template * (eslint-config) update community eslint plugin in eslint config (#28642) Summary: Updating the community eslint-plugin used in the eslint-config to the latest version. expecting new eslint-config version to be released with this change so that it can be included in new project template for 0.63 https://github.com/react-native-community/releases/issues/186 ## 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] - Update community eslint plugin in the eslint config Pull Request resolved: https://github.com/facebook/react-native/pull/28642 Test Plan: yarn lint passes Differential Revision: D21048976 Pulled By: cpojer fbshipit-source-id: 2c3ec0ef450cf357d8c88db7873f4ca1154b2034 * [0.63.0-rc.0] Bump version numbers * Upgrade Hermes dependency to 0.5.0 Summary: Use the latest published release of hermes-engine. Update RN to invoke `hermesc` instead of `hermes`. Changelog: [Android] [Changed] - Upgraded to Hermes 0.5.0 allow-large-files Reviewed By: mhorowitz Differential Revision: D20998564 fbshipit-source-id: 4824e273bcb044029a5a7e9379f168d3da47da50 * Remove the post install step (#28651) Summary: Removes the post install step for Flipper, as the latest version of YogaKit is compatible with swift 5. cc alloy ## 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 --> [Flipper] [Template] - Remove the post install step for Flipper Pull Request resolved: https://github.com/facebook/react-native/pull/28651 Test Plan: Tested a newly created RN app without post install step and it built successfully. Reviewed By: passy Differential Revision: D21064653 Pulled By: priteshrnandgaonkar fbshipit-source-id: da56d0754d918e30a0ebe480c77590f0139d48ac * Allow iOS PlatformColor strings to be ObjC or Swift UIColor selectors (#28703) Summary: Per discussion in https://github.com/react-native-community/releases/issues/186 the iOS `PlatformColor()` function is documented to use the semantic color names provided by the system. The referenced HIG documentation itself links to the `UIColor` documentation for semantic colors names. However, these names differ depending on if you are viewing the new Swift API docs or the Objective C docs. The current Objective C implementation in react-native assumes Objective C UIColor selector names that are suffixed 'Color'. But in Swift, Apple provides a Swift Extension on UIColor that makes aliases without the the 'Color' suffix and then makes the original selectors invalid presumably via `NS_UNAVAILABLE_SWIFT`. Since both selector names are valid depending on if you are using Objective C or Swift, let's make both forms be legal for `PlatformColor()`. In `RCTConvert.m` there is a dictionary of legal selector names. The code already supports the ability to have names be aliases of other selectors via a RCTSelector metadata key. The change adds code to the initialization of the map: it iterates over the keys in the map, which are all ObjC style UIColor selectors, and creates aliases by duplicating the entries, creating key names by stripping off the ObjC "Color" suffix, adds the RCTSelector key referring to the original and then appends these new Swift aliases to the map. ## Changelog [iOS] [Changed] - Allow iOS PlatformColor strings to be ObjC or Swift UIColor selectors Pull Request resolved: https://github.com/facebook/react-native/pull/28703 Test Plan: The PlatformColorExample.js is updated to use the new, shorter Swift selector names. There are still other examples in the same file and in unit tests that exercise the ObjC selector names. <img width="492" alt="PlatformColor" src="https://user-images.githubusercontent.com/30053638/79809089-89ab7d00-8324-11ea-8a9d-120b92edeedf.png"> Reviewed By: shergin Differential Revision: D21147404 Pulled By: TheSavior fbshipit-source-id: 0273ec855e426b3a7ba97a87645859e05bcd4126 * Fix folly::dynamic crash when attaching a debugger to Hermes Summary: folly_futures was compiled with and exported -DFOLLY_MOBILE=1, while folly_json did not. This flag disables fancy F14 data structures for folly::dynamic in favor of a simple std::unordered_map. This caused inlined/templated code from modules depending on folly_futures to disagree with the implementations in folly_json, leading to a crash. The only such libraries were libhermes-inspector and (transitively) libhermes-executor-debug, and these only use folly::dynamic for CDP serialization, which is why the problem was not more apparent. Changelog: [Internal] Fix crash when attaching a Hermes debugger Reviewed By: mhorowitz Differential Revision: D21193307 fbshipit-source-id: 2b795bb6f4f7f991e2adaacec62d62616117322b * Update react.gradle (#28776) Summary: Running `./gradlew assembleRelease` fails as the path to the CLI contains a new line at the end. We don't run this command in `debug` mode, hence it passed the testing. My bad. Fixed, checked in both `debug` with `bundleInDebug: true` and `release`. Fixes https://github.com/facebook/react-native/issues/28700 ## Changelog [INTERNAL] [ANDROID] - Fix `React.gradle` to build Android apps in production Pull Request resolved: https://github.com/facebook/react-native/pull/28776 Test Plan: Running `./gradlew assembleRelease` works Reviewed By: hramos Differential Revision: D21287789 Pulled By: TheSavior fbshipit-source-id: dc3ec8eef7a919b072b562d2bd455e2f704bc083 * Revert D21064653: Remove the post install step Differential Revision: D21064653 Original commit changeset: da56d0754d91 fbshipit-source-id: 1086cfdeca9aa3830370ea115ba7b5f05d3fb124 * Bump @react-native-community/eslint-config in new app template Summary: Changelog: [Changed][General] Update react-native-community/eslint-config to 1.1.0, adding the new color rule Reviewed By: rickhanlonii Differential Revision: D21342153 fbshipit-source-id: ac1367353d4d3e69b6df29dc16f9fcb60cde3519 * [0.63.0-rc.1] Bump version numbers * Upgrade Flipper to 0.37.0 (#28545) Summary: Bump flipper to 0.37 for both iOS and Android [Android] [Changed] - Upgrade Flipper to 0.37.0 [iOS] [Changed] - Upgrade Flipper to 0.37.0 Pull Request resolved: https://github.com/facebook/react-native/pull/28545 Test Plan: RNTester build pass Reviewed By: rickhanlonii Differential Revision: D20930069 Pulled By: hramos fbshipit-source-id: a7cb719da3e51e6a42d27d5e64bc664398d0d3c5 * Enable with CocoaPods `:configuration` (#28796) Summary: ~~⚠️ Depends on https://github.com/facebook/flipper/pull/1086 and a new Flipper release.~~ Fixes https://github.com/facebook/react-native/commit/17f025bc26da13da795845a3f7daee65563420c0#commitcomment-38831234 Currently user’s are being told to add a definition of the `FB_SONARKIT_ENABLED` macro and examples, including those in stock React Native templates, set this for the user by making use of a `post_install` hook in the user’s `Podfile`. This leads to confusion, fragile code [when a user’s project dir structure deviates from vanilla], and is ultimately not necessary as CocoaPods already has dedicated mechanisms to: * specify build settings (through the `xcconfig` property); * and selectively include certain pods only in certain build configurations (e.g. debug). ## 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] [Changed] - Entirely control Flipper being enabled through inclusion in Podfile and optionally limiting to certain build configurations using the `:configuration` directive. Pull Request resolved: https://github.com/facebook/react-native/pull/28796 Test Plan: Tested using the changes of https://github.com/facebook/flipper/pull/1086 in a new app that uses RN `master`. Reviewed By: priteshrnandgaonkar Differential Revision: D21449754 Pulled By: passy fbshipit-source-id: 9ff7c7f4ffc32b364b1edd82b94e0b80c3997625 * Pressable: Rename pressRectOffset to pressRetentionOffset to be consistent with other touchables Summary: Text and the other Touchables have this prop called pressRetentionOffset. Pressable should be consistent with that. Changelog: [Breaking][General]: Pressable: Rename pressRectOffset to pressRetentionOffset to be consistent with other touchables Reviewed By: yungsters Differential Revision: D21552255 fbshipit-source-id: 31e64bad9e48ac98e4934dd2f4c0a7f526de5cb6 * iOS: Fix Animated image crash when CADisplayLink target in RCTWeakProxy is nil Summary: When self is nil, this may crash in RCTUIImageViewAnimated.m. ``` _displayLink = [CADisplayLink displayLinkWithTarget:[RCTWeakProxy weakProxyWithTarget:self] selector:selector(displayDidRefresh:)]; ``` Replace `RCTWeakProxy` with a concrete class `RCTDisplayWeakRefreshable` that has the displayDidRefresh method, that calls the displayDidRefresh method in its weak target. https://github.com/facebook/react-native/pull/28070#issuecomment-619295254 Changelog: [iOS] [Fixed] - Fix Animated image crash when CADisplayLink target in RCTWeakProxy is nil Reviewed By: shergin Differential Revision: D21419385 fbshipit-source-id: da7c3c38f81ea54f633da7f59359e07680ea2faf * Pressable: Add Support for Inspector Overlay Summary: Adds support for the debug overlay (enabled via the Inspector) that the legacy touchable components supported. Changelog: [General][Added] - Added Inspector overlay support for Pressable Reviewed By: TheSavior Differential Revision: D21614412 fbshipit-source-id: b884e04f8dba1bfd35e61de25d33d6d47bc34b03 * Changed iOS LaunchScreen from xib to storyboard (#28239) Summary: > Starting April 30, 2020, all apps submitted to the App Store must use an Xcode storyboard to provide the app’s launch screen and all iPhone apps must support all iPhone screens. Updated iOS Launch screen as per [App Store policy change](https://developer.apple.com/news/?id=03042020b). Community discussion: https://github.com/react-native-community/discussions-and-proposals/issues/209 ## Changelog Changed iOS Launch Screen from a `xib` to `storyboard`. The `LaunchScreen.xib` file has been replaced with `LaunchScreen.storyboard`. Xcode automatically picks up the new Launch Screen no additional change is required. [iOS] [Deleted] - Deleted LaunchScreen.xib [iOS] [Added] - Added LaunchScreen.storyboard Pull Request resolved: https://github.com/facebook/react-native/pull/28239 Test Plan: Build the Xcode project under `template/iOS` and verify that the new launch screen is identical to the previous one. Reviewed By: cpojer Differential Revision: D20408892 Pulled By: hramos fbshipit-source-id: 9c38df58d1304088a23f3d73e0fbd87675804f1a * Fix debugging on android for 0.63 (#29204) Summary: Currently on react native 0.63-rc.0 and 0.63-rc.1 enabling debugging throws an exception. It looks like something may have been missed in unregistering JSDevSupport in this commit c20963e ![crash](https://user-images.githubusercontent.com/14797029/85500252-2acae400-b5b1-11ea-938a-674b55e649b2.gif) This should fix https://github.com/facebook/react-native/issues/28746 and https://github.com/facebook/react-native/issues/29136 ## Changelog [Android] [Fixed] - Fix crash when enabling debug Pull Request resolved: https://github.com/facebook/react-native/pull/29204 Test Plan: To recreate the bug: npx react-native init RN063 --version 0.63.0-rc.1 react-native start react-native run-android Enable debug mode from react native dev menu After this commit, the crash no longer occurs ![non crash](https://user-images.githubusercontent.com/14797029/85500241-269ec680-b5b1-11ea-8cfe-85bfda4dd222.gif) Reviewed By: TheSavior Differential Revision: D22395406 Pulled By: RSNara fbshipit-source-id: 046df77ae1c1de96870fb46f409d59e7d6a68c0d * [0.63.0] Bump version numbers * Add ProGuard rule for hermes (#28571) Summary: This adds a ProGuard for `hermes` rule so it does not have to be added by users manually. https://github.com/facebook/react-native/issues/28270 ## 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 --> [Android] [Added] - ProGuard rule for hermes Pull Request resolved: https://github.com/facebook/react-native/pull/28571 Test Plan: 1. Create a project with/without hermes. 2. Enable proguard. Reviewed By: cpojer Differential Revision: D20947095 Pulled By: hramos fbshipit-source-id: 79b166ad2dd060f20041d9f5cfe2f794c754843d * Fix rounded border drawing when border-radius is smaller than border-width (#28358) Summary: This PR fixes the drawing of the border rounded edges when the border-radius is small than the border-width. The current implementation capped the possible border-radius making it impossible to set smaller border-radii when using thicker borders. After inspection it was found that the rounded-rect calculation is incorrect. ## Changelog `[Android] [Fixed] - Fix rounded border-drawing when border-radius is smaller than border-width` Pull Request resolved: https://github.com/facebook/react-native/pull/28358 Test Plan: **Faulty situation:** As you can see, when the border-radius becomes very low, the border is stuck at a minimum value. Only after setting the border-radius fully to 0 is it again rendered correctly. ![ezgif com-video-to-gif (2)](https://user-images.githubusercontent.com/6184593/77183540-c3435b00-6ace-11ea-950d-29a0ea1757bd.gif) **After the fix:** ![ezgif com-video-to-gif (3)](https://user-images.githubusercontent.com/6184593/77183619-e837ce00-6ace-11ea-93a5-910127d352b7.gif) Differential Revision: D21124739 Pulled By: shergin fbshipit-source-id: cefd1776b77b5b9fb335e95fd7fdd7f345579dc4 * Fix border-stroke drawing after resetting border-radius (#28356) Summary: This PR fixes incorrect drawing of the View borders on Android, after changing the border-radius back to 0 *(and when no background-color is defined)*. This happens because the `drawRoundedBackgroundWithBorders` function in ReactViewBackgroundDrawable changes the style on the Paint object to `STROKE`. This style is however never reverted back to `FILL`. This change ensures that the Paint style is set to `FILL` for the full execution of the `drawRectangularBackgroundWithBorders` function. ## Changelog `[Android] [Fixed] - Fix border-drawing when changing border-radius back to 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28356 Test Plan: **Faulty situation:** ![ezgif com-video-to-gif](https://user-images.githubusercontent.com/6184593/77153163-9759b280-6a99-11ea-82bb-33a1e0a4934c.gif) **After the fix:** ![ezgif com-video-to-gif (1)](https://user-images.githubusercontent.com/6184593/77153825-c91f4900-6a9a-11ea-8e0c-a4280b9e72b8.gif) Differential Revision: D21124741 Pulled By: shergin fbshipit-source-id: 2044f8e8ad59a58df42b64d7ee8c4ad1d3b562f1 * Fixes TextInput shaking when typing Chinese (#28805) Summary: Fixes https://github.com/facebook/react-native/issues/28488. ## Changelog [iOS] [Fixed] - Fixes TextInput shaking when typing Chinese Pull Request resolved: https://github.com/facebook/react-native/pull/28805 Test Plan: Demo see https://github.com/facebook/react-native/issues/28488. Differential Revision: D21376803 Pulled By: shergin fbshipit-source-id: b1fe6cc5f67d42ef98a6c12b8ab9990feac0e2a7 * Set black as default text color for <TextInput/> on iOS (#28708) Summary: This is a follow-up pull request to https://github.com/facebook/react-native/issues/28280 (reviewed by shergin). This pull request tried to solve the problem of the default color in a TextInput in dark mode on iOS being white instead of black. I got suggested to solve the problem not on the level of RCTTextAttributes, but on the level of RCTUITextField. Setting `self.textColor = [UIColor black];` in the constructor did not work, because it gets overwritten by nil in `RCTBaseTextInputView.m`. There I implemented the logic that if NSForegroundColorAttributeName color is nil then the color is being set to black. I think the `defaultTextAttributes` property confuses here, because it ends up being the effective text attributes, e.g. if I unconditionally set the default text color to black, it cannot be changed in React Native anymore. So I put the nil check in. ## Changelog [iOS] [Fixed] - TextInput color has the same default (#000) on iOS whether in light or dark mode Pull Request resolved: https://github.com/facebook/react-native/pull/28708 Test Plan: I have manually tested the following: - The default text color in light mode is black - The default text color in dark mode is black - The color can be changed using the `style.color` attribute - Setting the opacity to 0.5 results in the desired behavior, the whole TextInput becoming half the opacity. – Setting the `style.color` to rgba(0, 0, 0, 0.5) works as intended, creating a half-opaque text color. Differential Revision: D21186579 Pulled By: shergin fbshipit-source-id: ea6405ac6a0243c96677335169b214a2bb9ccc29 * Enable array buffers in JSCRuntime.cpp (#28961) Summary: The JavaScriptCore implementation of JSI [does not currently support array buffers](https://github.com/facebook/react-native/blob/master/ReactCommon/jsi/JSCRuntime.cpp#L925-L943). The comments in the code suggest the JSC version used by React Native does not work with array buffers, but this seems to be out of date since the current version of JSC used by React Native does indeed support array buffers. This change just enables array buffers in JSCRuntime.cpp. NOTE: See https://github.com/react-native-community/discussions-and-proposals/issues/91#issuecomment-632371219 for more background on this change. ## Changelog [General] [Added] - Support for array buffers in the JavaScriptCore implementation of JSI Pull Request resolved: https://github.com/facebook/react-native/pull/28961 Test Plan: To test these changes, I just made some temporary changes to RNTester to use JSI to inject a test function into the JS runtime that reads from and writes to an array buffer, and call that function from the JS of the RNTester app (see https://github.com/ryantrem/react-native/commit/28152ce3f4ae0fa906557415d106399b3f072118). For the JS side of this, specifically look at https://github.com/ryantrem/react-native/blob/28152ce3f4ae0fa906557415d106399b3f072118/RNTester/js/RNTesterApp.android.js#L13-L18 For the native side of this, specifically look at https://github.com/ryantrem/react-native/blob/28152ce3f4ae0fa906557415d106399b3f072118/RNTester/android/app/src/main/cpp/JSITest.cpp#L22-L38 Reviewed By: shergin Differential Revision: D21717995 Pulled By: tmikov fbshipit-source-id: 5788479bb33c24d01aa80fa7f509e0ff9dcefea6 * Fix font variant crash on Android < 4.4 (#29176) Summary: In RN 0.62 support for `fontVariant` was added on Android. Using that prop crashes the app on Android below KitKat (4.3 and below) To reproduce just add any Text with the `fontVariant` styling prop in the app: ```js <Text style={{fontVariant: ['tabular-nums']}}>This will crash</Text> ``` It will crash any device running Android below KitKat with the error: ![image](https://user-images.githubusercontent.com/4534323/85073452-18206b80-b1bb-11ea-8d7e-96f27fa1a320.png) This is caused by `java.utils.Objects` only being available on Android 4.4+ ## Changelog [Android] [Fixed] - Fix font variant crash on Android < 4.4 Pull Request resolved: https://github.com/facebook/react-native/pull/29176 Test Plan: [TextUtils.equals](https://developer.android.com/reference/android/text/TextUtils#equals) was added as soon as API level 1, so no compatibility issue here. Tested on Emulator running Android 4.1, no crash anymore. I've searched for other occurences of `java.utils.Objects` in the project, and this was the only one, so no need to remove other occurences ✅ Reviewed By: JoshuaGross Differential Revision: D22337316 Pulled By: mdvacca fbshipit-source-id: 5507b21b237a725d596d47b5c01e269895b16d4a * Fix LogBox.ignoreAllLogs used with no argument (#29310) Summary: When you call `LogBox.ignoreAllLogs()` it should ignore logs. This fixes a bug that made this equivalent to `LogBox.ignoreAllLogs(false)` ## Changelog [General] [Fixed] - LogBox.ignoreAllLogs() should ignore logs Pull Request resolved: https://github.com/facebook/react-native/pull/29310 Test Plan: Added tests Reviewed By: TheSavior Differential Revision: D22448436 Pulled By: rickhanlonii fbshipit-source-id: 6ba12b9d9c1f29cf3ac503946ac5ca0097425a7a * Pressable: Minimum Press Duration Summary: When a `Pressable` has a configured (or the default) `delayPressIn` and no (or the default) `delayPressOut`, tapping very quickly can lead to intantaneous invocation of `onPressIn` and `onPressOut`. The end result is that users may never experience any intended visual press feedback. This changes `Pressable` to accept (and be preconfigured with a default) **minimum press duration**. The minimum press duration ensures that even if the press is released before `delayPressIn` has elapsed, `onPressOut` will still wait the remaining time up to `minPressDuration` before firing. Note that setting a non-zero `delayPressOut` is insufficient because if a user holds down on a `Pressable` for longer than `delayPressIn`, we still want `onPressOut` to fire immediately when the press is released. Changelog: [General][Changed] - Added `minPressDuration` to `Pressable`. Reviewed By: TheSavior Differential Revision: D21614708 fbshipit-source-id: 502f3d8ad6a40e7762435b6df16809c8798dd92c * chore: bring back script to org shape * [0.63.1] Bump version numbers * Exclude okhttp from flipper dependency (#29260) Summary: This fixes https://github.com/facebook/react-native/issues/28481. As explained in [this comment](https://github.com/facebook/react-native/issues/28481#issuecomment-645546195), the flipper network plugin pulls a more recent version of okhttp (3.14), but only versions of okhttp up to 3.12 works on Android API 21 and less. This prevented being able to run the app in debug mode, it was still working fine in release mode. ## 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 --> [Android] [Fixed] - Fix unable to run in debug mode on Android API < 21 Pull Request resolved: https://github.com/facebook/react-native/pull/29260 Test Plan: Using `yarn react-native run-android` the app would instantly crash with this error in `adb logcat`: ``` E/AndroidRuntime( 5079): java.lang.RuntimeException: Unable to create application com.awesometsproject.MainApplication: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created E/AndroidRuntime( 5079): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4154) E/AndroidRuntime( 5079): at android.app.ActivityThread.access$1300(ActivityThread.java:130) E/AndroidRuntime( 5079): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1255) E/AndroidRuntime( 5079): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 5079): at android.os.Looper.loop(Looper.java:137) E/AndroidRuntime( 5079): at android.app.ActivityThread.main(ActivityThread.java:4745) E/AndroidRuntime( 5079): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 5079): at java.lang.reflect.Method.invoke(Method.java:511) E/AndroidRuntime( 5079): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) E/AndroidRuntime( 5079): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) E/AndroidRuntime( 5079): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 5079): Caused by: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:90) E/AndroidRuntime( 5079): at com.facebook.react.ReactInstanceManager.<init>(ReactInstanceManager.java:238) E/AndroidRuntime( 5079): at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:281) E/AndroidRuntime( 5079): at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:87) E/AndroidRuntime( 5079): at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:39) E/AndroidRuntime( 5079): at com.awesometsproject.MainApplication.onCreate(MainApplication.java:47) E/AndroidRuntime( 5079): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:999) E/AndroidRuntime( 5079): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4151) E/AndroidRuntime( 5079): ... 10 more E/AndroidRuntime( 5079): Caused by: java.lang.reflect.InvocationTargetException E/AndroidRuntime( 5079): at java.lang.reflect.Constructor.constructNative(Native Method) E/AndroidRuntime( 5079): at java.lang.reflect.Constructor.newInstance(Constructor.java:417) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:80) E/AndroidRuntime( 5079): ... 17 more E/AndroidRuntime( 5079): Caused by: java.lang.NoClassDefFoundError: java.util.Objects E/AndroidRuntime( 5079): at okhttp3.CertificatePinner.withCertificateChainCleaner(CertificatePinner.java:231) E/AndroidRuntime( 5079): at okhttp3.OkHttpClient.<init>(OkHttpClient.java:238) E/AndroidRuntime( 5079): at okhttp3.OkHttpClient$Builder.build(OkHttpClient.java:1015) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevServerHelper.<init>(DevServerHelper.java:132) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerImpl.<init>(DevSupportManagerImpl.java:183) E/AndroidRuntime( 5079): ... 20 more W/ActivityManager( 1456): Force finishing activity com.awesometsproject/.MainActivity ``` With this fix, the app launch successfully in debug mode, without having to remove flipper altogether from our config. Reviewed By: passy Differential Revision: D22521109 Pulled By: mdvacca fbshipit-source-id: 3c0263642438bd7c0d09b045e15a933bd8a26734 * Send key when onKeyPress event is fired from TextInput Summary: Changelog: [Internal] In `onKeyPress` event, we were not returning `key` property. This diff adds `key` property to `onKeyPress` event and removes other, redundant properties from `onKeyPress` event. The implementation has been translated from Paper. Reviewed By: shergin Differential Revision: D21250411 fbshipit-source-id: f1e31381667acb9dec02d0b33883df8f8f5b2a4b * Calling Paper TextInput setTextAndSelection view command now dirties layout Summary: Changelog: [Internal] Previously `setTextAndSelection` was not dirtying layout. This would cause an issue where `setTextAndSelection` causes layout change. For example calling setTextAndSelection with empty string on a multiline auto expanding text input. I changed one example in TextInputSharedExamples.js, "Live Re-Write (no spaces allowed) and clear" example is now multiline. This allows to test whether `setTextAndSelection` dirties layout. Enter multiline string to to the example text input and press clear. Observe that the text input shrinks to single line height. Reviewed By: shergin Differential Revision: D21182990 fbshipit-source-id: de8501ea0b97012cf4cdf8d5f658649139f92da6 * Remove setMostRecentEventCount from TextInput view commands Summary: Changelog: [Internal] We don't use view command `setMostRecentEventCount`, let's get rid of it. Reviewed By: JoshuaGross Differential Revision: D21016600 fbshipit-source-id: 6491c063e9d6a89252300cb47c010b248e473f4b * Restore Previous Behavior for StyleSheet Validation of Null/Undefined Styles (#29171) Summary: https://github.com/facebook/react-native/issues/27264 changed stylesheet validation to avoid enumerating properties on the prototype of a style. It introduces a secondary behavior change, where null/undefined styles used to be tolerated but now lead to an exception. This is because `for in undefined` will noop where `for of Object.keys(undefined)` will throw. This scenario of undefined/null styles seems to actually show up in practice and was previously well tolerated. E.g. `Button.js` has code that looks like this: ```jsx const styles = StyleSheet.create({ button: Platform.select({ ios: {}, android: { elevation: 4, // Material design blue from https://material.google.com/style/color.html#color-color-palette backgroundColor: '#2196F3', borderRadius: 2, }, }), ``` For non ios/Android platforms, that creates a style object which looks like: ```js { button: undefined, ... } ``` This previously meant that the component would be unstyled if created, but now means out-of-tree platforms throw if the builtin Button component is required. This change restores the previous `for in` loop but adds a `hasOwnProperty` check to avoid properties on prototypes. ## Changelog [General] [Fixed] - Restore Previous Behavior for StyleSheet Validation of Null/Undefined Styles Pull Request resolved: https://github.com/facebook/react-native/pull/29171 Test Plan: Validated that importing Buttons will no longer cause an exception, and that invalid properties are still caught. Reviewed By: JoshuaGross Differential Revision: D22118379 Pulled By: TheSavior fbshipit-source-id: 650c64b934ccd12a3dc1b75e95debc359925ad73 * Set windowTranslucentNavigation to false (#29399) Summary: This fixes https://github.com/facebook/react-native/issues/29397. Without this, apps that specify `android:windowTranslucentNavigation` draw the `LogBox` buttons underneath the soft navigation bar, making the buttons unpressable. Before | After :-------------------------:|:-------------------------: <img src="http://ashoat.com/AndroidTranslucentNavigationLogBox.png" width="300" /> | <img src="http://ashoat.com/AndroidTranslucentNavigationLogBoxFixed.png" width="300" /> ## Changelog [Android] [Fixed] - Set LogBox windowTranslucentNavigation to false Pull Request resolved: https://github.com/facebook/react-native/pull/29399 Test Plan: I tested this change on the [repo](https://github.com/Ashoat/LogBoxTest) I set up to reproduce the issue. I set it up to [build `ReactAndroid` from source](https://github.com/Ashoat/LogBoxTest/commit/3a2cdab8777ac381cd3be5a84a5bf3250751ac11) and then edited `node_modules/react-native/ReactAndroid/src/main/res/devsupport/values/styles.xml` directly. Reviewed By: rickhanlonii Differential Revision: D22602970 Pulled By: mdvacca fbshipit-source-id: 8c2adc149aa0157825075022f00bb695956d3121 * Fix image cannot show in iOS 14 (#29420) Summary: This PR is to fix https://github.com/facebook/react-native/issues/29279, which image cannot show in iOS 14 As https://github.com/facebook/react-native/issues/29279#issuecomment-658244428 mention, this issue can be fixed by calling ` [super displayLayer:layer];` it it is still image, to let `UIImageView` handle still image rendering ## Changelog [iOS] [Fixed] - Fix image cannot show in iOS 14 Pull Request resolved: https://github.com/facebook/react-native/pull/29420 Test Plan: Image can be shown in iOS 14 build with Xcode 12 beta, using ```js <Image source={require('./images/some_local_image.jpg')}/> ``` It may also need to test gif image is render correctly ```js <Image source={{uri: 'https://some_remote_gif_image.gif'}}/> ``` Reviewed By: p-sun Differential Revision: D22619448 Pulled By: shergin fbshipit-source-id: f4d0ad83af945a6b8099d4eaea5a5f1933c7bfd2 * [0.63.2] Bump version numbers * botched merge changes 1 * more hermes changes needed from upstream, botched merge? * [RCTPicker] Guard UIKit only API on macOS * [RCTSegmentedControl] Make UIKit agnostic * [RCTDisplayWeakRefreshable] Make platform agnostic * [RCTImageLoader] Make platform agnostic * [RCTDevLoadingView] Make platform agnostic * botched merge changes 2 * [RCTPushNotificationManager] Guard for macOS * v0.63 TODO * [RCTBaseTextInputViewManager] Make platform agnostic * [RCTBaseTextInputView] Make platform agnostic * [RNTester-macOS] Fix * [RCT-Folly] Fix build * [PlatformColorValueTypes] Add macOS shim * [package] Update CLI to no longer require config This makes a previous change more explicit: https://github.com/microsoft/react-native-macos/pull/602 * Fix iOS build failures. * Get RNTester to launch * [CODEOWNERS] Add myself * [flow] Remove deprecated rule in newer Flow https://github.com/facebook/flow/commit/759970c1b6dc0a25171d9969e34eaf5dae70f130 * [flow] Get iOS checks green * [PlatformColor] Duplicate iOS code for macOS This is a naive version of this change, there should likely be some code sharing happening between iOS and macOS. * [test] Make green with macOS fork changes * [test] Get macOS test bundle to build * [Color] Rename alternating colors to match to assumptions * [PlatformExample] Fix examples on macOS * [transform] Use iOS implementation for macOS * [circle] Fix config * [ci] Update metro config as per upstream * [ci] Ignore metro config in e2e tests * Revert "[ci] Ignore metro config in e2e tests" This reverts commit 25f7006bc9ba76b1e002b721954a823b3d710c5c. * Revert "[ci] Update metro config as per upstream" This reverts commit b47ca570be00394bbd92b349eab02083787301e7. * [ci] Only disable custom metro config in e2e test * [ci] Ignore metro config in e2e tests * [ci] Switch to experimental CocoaPods CDN * Revert "[ci] Switch to experimental CocoaPods CDN" This reverts commit 44a92f7f08397406429672b14930d44b6aa06b5e. * [ci] Skip Android tests in Apple PR on master * [rnm-init] Fix pod reference * [rnm-init] Update minimum iOS deployment target Co-authored-by: Christoph Nakazawa <cpojer@fb.com> Co-authored-by: Sergio Estevao <sergioestevao@gmail.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: Sam Mathias Weggersen <sawegger@microsoft.com> Co-authored-by: Tommy Nguyen <tonguye@microsoft.com> Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Héctor Ramos <hector@hectorramos.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Sebastian Markbage <sema@fb.com> Co-authored-by: generatedunixname89002005287564 <generatedunixname89002005287564@fb.com> Co-authored-by: Eddie Dugan <ejd@fb.com> Co-authored-by: Valentin Shergin <shergin@fb.com> Co-authored-by: Max Ovtsin <maxovtsin@fb.com> Co-authored-by: Alexander Kawrykow <akawry@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Spencer Ahrens <sahrens@fb.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Jack Wang <shoubowang@fb.com> Co-authored-by: Oleg Bogdanov <boguscoder@fb.com> Co-authored-by: Michael Bolin <mbolin@fb.com> Co-authored-by: Dan Abramov <gaearon@fb.com> Co-authored-by: Peter Argany <petetheheat@fb.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: George Zahariev <gkz@fb.com> Co-authored-by: Jason Safaiyeh <safaiyeh@protonmail.com> Co-authored-by: Pedro Barbiero <pedrobarbiero@gmail.com> Co-authored-by: Brian Vaughn <bvaughn@fb.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Martin Sherburn <mns@fb.com> Co-authored-by: Tom Underhill <tomun@microsoft.com> Co-authored-by: Ventsislav Dimitrov <4097884+vdmtrv@users.noreply.github.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: Lucas Bento <lucas.bsilva@outlook.com> Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com> Co-authored-by: Vojtech Novak <vonovak@gmail.com> Co-authored-by: Emilis Baliukonis <emilisb@wix.com> Co-authored-by: Jacob Bower <jbower@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: Marc Horowitz <mhorowitz@fb.com> Co-authored-by: Sidharth Guglani <sidharthguglani@fb.com> Co-authored-by: Andrew Coates (REDMOND) <acoates@microsoft.com> Co-authored-by: maciej simka <mcj.simka@gmail.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Pavlos Vinieratos <pvinis@gmail.com> Co-authored-by: Cristiano Santos <cristianomnsantos@gmail.com> Co-authored-by: Daniel Cohen Gindi <Danielgindi@gmail.com> Co-authored-by: Eli White <eliwhite@fb.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: jiggag <jiggag90@gmail.com> Co-authored-by: Emily Janzer <janzer@fb.com> Co-authored-by: Kacper Wiszczuk <kacperwiszczuk@gmail.com> Co-authored-by: Xiaoyu Yin <xyin@fb.com> Co-authored-by: Javier Cuevas <javi@diacode.com> Co-authored-by: Bruno Barbieri <brunobar79@gmail.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Will Holen <willholen@fb.com> Co-authored-by: Pritesh Nandgaonkar <prit91@fb.com> Co-authored-by: sunnylqm <sunnylqm@qq.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Tim Yung <yungsters@fb.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: Devon Deonarine <hello@devondeonarine.ca> Co-authored-by: Radek Czemerys <radko93@gmail.com> Co-authored-by: Hein Rutjes <IjzerenHein@users.noreply.github.com> Co-authored-by: zhongwuzw <zhongwuzw@qq.com> Co-authored-by: Jonny Burger <jonathanburger11@gmail.com> Co-authored-by: Ryan Tremblay <ryan.tremblay@microsoft.com> Co-authored-by: almouro <contact@almouro.com> Co-authored-by: Rick Hanlon <rickhanlonii@gmail.com> Co-authored-by: Matthieu Harlé <bonjour@matthieuharle.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Ashoat Tevosyan <ashoat@gmail.com> Co-authored-by: Tom Cheung <cheungch@gmail.com>
2020-09-30 19:38:06 +03:00
);
},
});
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
/* $FlowFixMe[prop-missing] This is intentional: Flow will error when
* attempting to access ViewPagerAndroid. */
/* $FlowFixMe[invalid-export] This is intentional: Flow will error when
* attempting to access ViewPagerAndroid. */
Object.defineProperty(module.exports, 'ViewPagerAndroid', {
configurable: true,
get() {
invariant(
false,
'ViewPagerAndroid has been removed from React Native. ' +
"It can now be installed and imported from '@react-native-community/viewpager' instead of 'react-native'. " +
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
'See https://github.com/callstack/react-native-viewpager',
);
},
});
Remove deprecated CheckBox module. (#801) * Update default Podfile to not depend on a path (#28572) Summary: Recently, a default Podfile has been modified to not contain all the React Native pods, but use a helper method `use_react_native!`. While this is great, it assumes a hardcoded path of `../node_modules/react-native` to be always the correct location of the React Native. https://github.com/facebook/react-native/blob/d4d8887b5018782eeb3f26efa85125e6bbff73e4/scripts/autolink-ios.rb#L7-L9 Unfortunately, due to the way Ruby works, this completely hides the path away from the users. Before, they could have seen the wrong path explicitly in a Podfile and knew to update it to resolve path-related issues. With the current version in `master`, I can see a lot of issues where developers wonder how to resolve the path issues and how to pass the path itself. https://github.com/facebook/react-native/blob/4118d798265341061105f3a53550db83c66a71cb/template/ios/Podfile#L5-L10 This PR uses React Native CLI configuration (that is already used to link 3rd party dependencies) to explicitly define the correct path to the React Native. As a result, we don't have to change the paths here whether we're running monorepo or not. ## Changelog [IOS] [INTERNAL] - Always provide an explicit path to React Native Pull Request resolved: https://github.com/facebook/react-native/pull/28572 Differential Revision: D20945194 Pulled By: TheSavior fbshipit-source-id: 010f9754f2ed78ef62fd52f4d201f296f5af6d27 * Upgrade Prettier in Xplat to version 1.19.1 Summary: Upgrades Prettier in Xplat to 1.19.1 Ignores upgrading packages on already on versions greater than 1.19.1 Changelog: [Internal] allow-large-files bypass-lint (Note: this ignores all push blocking failures!) Reviewed By: gkz, cpojer Differential Revision: D20879147 fbshipit-source-id: 0deee7ac941e91e1c3c3a1e7d3d3ed20de1d657d * Stop using get_fbobjc_enable_exception_lang_compiler_flags_DEPRECATED in xplat Summary: Old deprecated function. Changelog: [Internal] Reviewed By: nlutsenko Differential Revision: D20148856 fbshipit-source-id: 79d6fb97824b059e50f67ff5a0b4c38ec7a19469 * Add ProGuard rule for hermes (#28571) Summary: This adds a ProGuard for `hermes` rule so it does not have to be added by users manually. https://github.com/facebook/react-native/issues/28270 ## 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 --> [Android] [Added] - ProGuard rule for hermes Pull Request resolved: https://github.com/facebook/react-native/pull/28571 Test Plan: 1. Create a project with/without hermes. 2. Enable proguard. Reviewed By: cpojer Differential Revision: D20947095 Pulled By: hramos fbshipit-source-id: 79b166ad2dd060f20041d9f5cfe2f794c754843d * Move CheckBox JS files to FB Internal Summary: Move CheckBox JS files to FB internal ## Changelog: [General] [Removed] This diff removes the CheckBox export from React Native. Internally, we are requiring CheckBox directly now and externally people will have to use the community maintained module. Reviewed By: cpojer Differential Revision: D20910775 fbshipit-source-id: 809e135dc3f68911ac0a004e6eafa8488f0d5327 * Remove CheckBox from docsList.js Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: George Zahariev <gkz@fb.com> Co-authored-by: Scott Wolchok <swolchok@fb.com> Co-authored-by: Radek Czemerys <radko93@gmail.com> Co-authored-by: Lauren Tan <laurentan@fb.com>
2021-07-15 01:34:49 +03:00
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
/* $FlowFixMe[prop-missing] This is intentional: Flow will error when
* attempting to access CheckBox. */
/* $FlowFixMe[invalid-export] This is intentional: Flow will error when
* attempting to access CheckBox. */
Remove deprecated CheckBox module. (#801) * Update default Podfile to not depend on a path (#28572) Summary: Recently, a default Podfile has been modified to not contain all the React Native pods, but use a helper method `use_react_native!`. While this is great, it assumes a hardcoded path of `../node_modules/react-native` to be always the correct location of the React Native. https://github.com/facebook/react-native/blob/d4d8887b5018782eeb3f26efa85125e6bbff73e4/scripts/autolink-ios.rb#L7-L9 Unfortunately, due to the way Ruby works, this completely hides the path away from the users. Before, they could have seen the wrong path explicitly in a Podfile and knew to update it to resolve path-related issues. With the current version in `master`, I can see a lot of issues where developers wonder how to resolve the path issues and how to pass the path itself. https://github.com/facebook/react-native/blob/4118d798265341061105f3a53550db83c66a71cb/template/ios/Podfile#L5-L10 This PR uses React Native CLI configuration (that is already used to link 3rd party dependencies) to explicitly define the correct path to the React Native. As a result, we don't have to change the paths here whether we're running monorepo or not. ## Changelog [IOS] [INTERNAL] - Always provide an explicit path to React Native Pull Request resolved: https://github.com/facebook/react-native/pull/28572 Differential Revision: D20945194 Pulled By: TheSavior fbshipit-source-id: 010f9754f2ed78ef62fd52f4d201f296f5af6d27 * Upgrade Prettier in Xplat to version 1.19.1 Summary: Upgrades Prettier in Xplat to 1.19.1 Ignores upgrading packages on already on versions greater than 1.19.1 Changelog: [Internal] allow-large-files bypass-lint (Note: this ignores all push blocking failures!) Reviewed By: gkz, cpojer Differential Revision: D20879147 fbshipit-source-id: 0deee7ac941e91e1c3c3a1e7d3d3ed20de1d657d * Stop using get_fbobjc_enable_exception_lang_compiler_flags_DEPRECATED in xplat Summary: Old deprecated function. Changelog: [Internal] Reviewed By: nlutsenko Differential Revision: D20148856 fbshipit-source-id: 79d6fb97824b059e50f67ff5a0b4c38ec7a19469 * Add ProGuard rule for hermes (#28571) Summary: This adds a ProGuard for `hermes` rule so it does not have to be added by users manually. https://github.com/facebook/react-native/issues/28270 ## 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 --> [Android] [Added] - ProGuard rule for hermes Pull Request resolved: https://github.com/facebook/react-native/pull/28571 Test Plan: 1. Create a project with/without hermes. 2. Enable proguard. Reviewed By: cpojer Differential Revision: D20947095 Pulled By: hramos fbshipit-source-id: 79b166ad2dd060f20041d9f5cfe2f794c754843d * Move CheckBox JS files to FB Internal Summary: Move CheckBox JS files to FB internal ## Changelog: [General] [Removed] This diff removes the CheckBox export from React Native. Internally, we are requiring CheckBox directly now and externally people will have to use the community maintained module. Reviewed By: cpojer Differential Revision: D20910775 fbshipit-source-id: 809e135dc3f68911ac0a004e6eafa8488f0d5327 * Remove CheckBox from docsList.js Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: George Zahariev <gkz@fb.com> Co-authored-by: Scott Wolchok <swolchok@fb.com> Co-authored-by: Radek Czemerys <radko93@gmail.com> Co-authored-by: Lauren Tan <laurentan@fb.com>
2021-07-15 01:34:49 +03:00
Object.defineProperty(module.exports, 'CheckBox', {
configurable: true,
get() {
invariant(
false,
'CheckBox has been removed from React Native. ' +
"It can now be installed and imported from '@react-native-community/checkbox' instead of 'react-native'. " +
Merge 0.66 into master (#951) * Rename immediate to ReactNativeMicrotask in Bridge Summary: Changelog: [Internal] This diff replaced all the internal occurrences of "Immediate" with "ReactNativeMicrotask" in the legacy bridge and then polyfilled the original immediate APIs during the timer setup phases as aliases of them. Note that this diff is part of a larger refactoring. Reviewed By: RSNara Differential Revision: D29785430 fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f * Implement View.removeClippedSubviews prop Summary: Changelog: [internal] Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is Reviewed By: JoshuaGross Differential Revision: D29906458 fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea * Add "Use Native Driver" control to RNTester Animated Composing example Summary: Changelog: [Internal] Reviewed By: yungsters Differential Revision: D29832704 fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b * docs: Fix dead links in README for rn-tester (#31901) Summary: Part of https://github.com/facebook/react-native/issues/31788 ~Updated link in README that was pointing to master branch to main branch~ Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links ## 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 dead links in README Pull Request resolved: https://github.com/facebook/react-native/pull/31901 Test Plan: - [ ] Updated link directs you to appropriate page Reviewed By: PeteTheHeat Differential Revision: D29933044 Pulled By: GijsWeterings fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319 * docs: update links to forwarded page (#31903) Summary: Some of the links in `CONTRIBUTING.md` redirects you to a different page. I've fixed the links so each link would directly send users to the appropriate page. ## 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] [Changed] - update links in CONTRIBUTING.md Pull Request resolved: https://github.com/facebook/react-native/pull/31903 Test Plan: - [ ] Change links shows the appropriate content Reviewed By: lunaleaps Differential Revision: D29933105 Pulled By: GijsWeterings fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf * Remove redundant warnings for RCTMountingManager Summary: Changelog: [internal] The warnings are in-actionable for product engineers. Reviewed By: JoshuaGross Differential Revision: D29911438 fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f * Ignore when a text string or number is supplied as a child. Summary: Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant). This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953). Changelog: [internal] Reviewed By: yungsters, sammy-SC Differential Revision: D29894182 fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28 * React Native sync for revisions cae6350...419cc9c Summary: This sync includes the following changes: - **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>// - **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>// - **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>// - **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>// - **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>// - **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>// - **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>// - **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>// - **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>// - **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>// - **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>// - **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>// - **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>// - **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>// - **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>// - **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>// - **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>// - **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>// - **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>// - **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>// - **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>// - **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>// - **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>// - **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>// - **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>// - **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>// - **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>// - **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>// - **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>// - **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>// - **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>// - **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions cae6350...419cc9c jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D29913856 fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0 * Remove option to make measure calls asynchronous Summary: Changelog: [internal] Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option. Reviewed By: JoshuaGross Differential Revision: D29909385 fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947 * Fix android view dimensions Summary: This diff fixes the Android View dimensions in VR PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity? These two methods are only used in Fabric and they were introduced by D9583972 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120) As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel() changelog: [Internal] internal Reviewed By: JoshuaGross Differential Revision: D29864944 fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368 * Refactor DevServerHelper to separate checking if packager running Summary: Changelog: [Internal] Separate the functionality of the isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper Reviewed By: makovkastar, ShikaSD Differential Revision: D29933318 fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a * Introduce queueMicrotask API Summary: Changelog: [General][Added] - Add global.queueMicrotask `queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec and it's been widely adopted by all web browsers and Node.js. This diff introduced it to React Native by polyfilling it via a lazily-allocated resolved Promise, or calling directly into a fast path provided by Hermes. Reviewed By: RSNara Differential Revision: D29838852 fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7 * Shim Immediate APIs when Promise is queueing to JSVM Summary: Changelog: [Internal] Historically, Immediate API is implemented upon the React Native's internal microtask-y queue (known as "immediate queue"), which is the same queue Promise polyfill is operating on. To make React Native suitable of using the built-in Promises from JSVMs, which usually enqueues to the JSVM internal microtask queue and has no access to React Native microtask-y queue, we need to migrate the Immediate API to use the JSVM microtask queue as well to preserve the semantics of code relies on the interleaving of promises and immediates. To do that, this diff implement a shim layer for immediate APIs via the new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping the immediate callback into a "microtask callback", which validate the `immediate ID` against `clearedImmediate` Set before invoking it. Reviewed By: RSNara Differential Revision: D29845305 fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d * Attempt to fix undefined instance handle in EventTarget Summary: changelog: [internal] Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it. Reviewed By: JoshuaGross Differential Revision: D29969189 fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2 * Makes "force" property available to Apple Pencil based events. (#31780) Summary: Fixes https://github.com/facebook/react-native/issues/31779 For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779 React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native. Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice. ## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices. [iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. Pull Request resolved: https://github.com/facebook/react-native/pull/31780 Test Plan: The code compiles and runs, and trying a simple handler for a View like ```` touchMove = (e: GestureResponderEvent) => { console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`); ```` results in <img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png"> and when pencil is oriented perpendicular to the screen and pressed with full force shows <img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png"> Reviewed By: sammy-SC Differential Revision: D29964102 Pulled By: sota000 fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc * Fix typo in VirtualizedList-test.js (#31756) Summary: occured -> occurred ## 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] - Fixed typo in VirtualizedList-test.js Pull Request resolved: https://github.com/facebook/react-native/pull/31756 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29975153 Pulled By: charlesbdudley fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a * Pass context through to all prop parser (core changes) Summary: Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state. By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it! Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0. This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s). Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29838789 fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c * Pass context through to all prop parser (props structs changes) Summary: See previous diffs for context. This updates all of the relevant props structs. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855426 fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0 * Pass context through to all prop parser (conversions.h) Summary: See previous diffs for context. This updates all conversions.h files. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D29855425 fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737 * Pass PropsParserContext to prop parsing layer Summary: Changelog: [internal] Reviewed By: mdvacca Differential Revision: D29921232 fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f * Fix typo in Constants.h (#31049) Summary: controling -> controlling ## Changelog [Internal] [Fixed] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31049 Test Plan: NONE Reviewed By: lunaleaps Differential Revision: D29980007 Pulled By: charlesbdudley fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344 * Daily `arc lint --take CLANGFORMAT` Reviewed By: zertosh Differential Revision: D29983521 fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98 * Update Dimension.js typo (#29858) Summary: preferred instead of preffered ## 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 --> [CATEGORY] [TYPE] - Message Pull Request resolved: https://github.com/facebook/react-native/pull/29858 Reviewed By: charlesbdudley Differential Revision: D29998754 Pulled By: sota000 fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b * Make existential type an error in xplat Summary: This diff updates the xplat flowconfigs to make existential types an error. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D29967838 fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d * Remove unused import (#30544) Summary: Remove unused import ## 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] [performance] - Remove unused import Pull Request resolved: https://github.com/facebook/react-native/pull/30544 Test Plan: Should build on CI Reviewed By: lunaleaps Differential Revision: D30000901 Pulled By: charlesbdudley fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5 * Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Test Pass PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184) Reviewed By: mdvacca Differential Revision: D29980220 Pulled By: lunaleaps fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9 * Implement PlatformColor in Fabric Android Summary: This diff implements PlatformColor in Fabric Android changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D29841461 fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a * Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099) Summary: This issue: fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475 fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes https://github.com/facebook/react-native/issues/18285 fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695 Allows to set individual (left,top,right,bottom) dotted/dashed borders. If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness. ## 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 --> [Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid Pull Request resolved: https://github.com/facebook/react-native/pull/29099 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png" width="300" height="" /> | | **AFTER** | **AFTER** | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png" width="300" height="" /> | </p> </details> Reviewed By: mdvacca Differential Revision: D28688914 Pulled By: RSNara fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd * Correct error message in getViewState method Summary: Changelog: [internal] Here, getting `viewState` has failed, not its view property. Reviewed By: mdvacca Differential Revision: D30042652 fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207 * Clean up RAIICallbackManager experiment Summary: This experiment was shipped in D27436402 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8). Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30023039 fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c * Stop sharing LongLivedObjectCollection with the bridge Summary: ## Context Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime. ## Problem With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems. ## Fix In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes: - kGlobalScope: Everything works as it did before - kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim. - kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30019833 fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83 * Stop sharing LongLivedObjectCollection with the bridge Summary: This is the Android analogue to D30019833. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30029295 fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c * setup fragment based tab bar navigation Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate` Reviewed By: keoskate Differential Revision: D29981436 fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b * Remove 'using namespace facebook::jni' Summary: Ez diff to remove 'using namespace facebook::jni' changelog: [internal] internal Reviewed By: sshic Differential Revision: D30046080 fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235 * Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' Summary: Add TODO to fix and enable 'generated_tests-codegen_testsAndroid' changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D30046143 fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae * Move RNTester Buck library to GitHub (#31435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31435 Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942209 fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8 * Move react-native Buck library to GitHub Summary: Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27942687 fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348 * Extract feature detection as an utilitiy module Summary: Changelog: [Internal] This diff only extracted the `isNativeFunction` used in `setUpTimers` into the `FeatureDetection` utility, but later we will add more functions in it and reuse them in other places. Reviewed By: RSNara Differential Revision: D29986750 fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0 * Conditionalize the Regenerator Setup Summary: Changelog: [Internal] If generators are provided natively, that should suggest that the JS source code did not go through the regenerator-transform (e.g. in Metro Hermes profile), then there is no need to set up the regenerator runtime. This should save some work during the Core initialization. Reviewed By: motiz88 Differential Revision: D29986751 fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd * Protect against crashes when over-releasing a TouchEvent Summary: It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed. This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D30061178 fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d * Co-locate Buck targets for JS polyfills with their sources Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032230 fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1 * chore: update Dimensions API Flow types (#31898) Summary: This small PR updates the Flow types used in Dimensions. The following changes has been made: * generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update) * ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~ > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this. ## 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] [Changed] - update Dimensions API Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/31898 Test Plan: Running `yarn flow` in the workspace yields no errors. Reviewed By: yungsters Differential Revision: D29932940 Pulled By: GijsWeterings fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291 * Fix order of calls for Native Animated Module Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc * Merge BUCK file at Libraries/ into root Summary: Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D27967499 fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c * Fix Buck package boundary violation in core components schema Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D29996246 fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e * Allow resolving view from FabricUIManager Summary: Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30043188 fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f * Flush operations queue when animation starts Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: JoshuaGross, p-sun Differential Revision: D30053890 fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86 * iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage Summary: Changelog: [Internal] Differential Revision: D30081478 fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29 * fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 * Update OSS Buck definitions (#31948) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31948 Changelog: [Internal] Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9. Reviewed By: sammy-SC Differential Revision: D30072866 fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279 * Update Android Dockerfile to include root BUCK file (#31950) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31950 Changelog: [Internal] Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e Reviewed By: ShikaSD Differential Revision: D30099261 fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e * Check for negative `numberOfLines` in TextView Summary: Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier. Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30047103 fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b * Fix NPE when hierarchy return null values Summary: This diff fixes a NullPointer that was being thorwn when hierarchy values are null changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095407 fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972 * Extend getInspectorDataForInstance to return props Summary: This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter. changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095406 fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04 * Add documentation for FabricUIManager.getInspectorDataForInstance Summary: Add documentation for FabricUIManager.getInspectorDataForInstance changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30095818 fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6 * chore: remove FlowFixMe (#29468) Summary: Removed FlowFixMe that has been fixed ## 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] [Fixed] - Removed FlowFixMe that has been fixed Pull Request resolved: https://github.com/facebook/react-native/pull/29468 Test Plan: flow check passes Reviewed By: JoshuaGross Differential Revision: D29967702 Pulled By: lunaleaps fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff * Move RCT* Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030454 fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01 * Move integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032467 fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a * Move RNTester unit/integration test Buck targets to GitHub Summary: Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30032476 fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6 * Move RCTTestApple into packages/rn-tester Summary: Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30056021 fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9 * React Native sync for revisions 419cc9c...19092ac Summary: This sync includes the following changes: - **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>// - **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>// - **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>// - **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>// - **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>// - **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>// - **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>// - **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>// - **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>// - **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>// - **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 419cc9c...19092ac jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D30092460 fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89 * refactor!: drop deprecated `StatusBarIOS` (#31466) Summary: This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097) ## 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 --> [JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS` Pull Request resolved: https://github.com/facebook/react-native/pull/31466 Test Plan: Warning when user imports `StatusBarIOS` Reviewed By: yungsters Differential Revision: D30109324 Pulled By: lunaleaps fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc * Fix OSS Buck parsing errors (#31957) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31957 Changelog: [Internal] Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs. Also adds license headers to some recently-added files that didn't have them. Reviewed By: mdvacca Differential Revision: D30114177 fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60 * Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31965 Changelog: [Internal] Reviewed By: GijsWeterings Differential Revision: D30030580 fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615 * Remove package boundary exceptions in OSS Buck config Summary: Changelog: [Internal] Reviewed By: stepancheg Differential Revision: D30102445 fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa * Update JSLoader.cpp (#29270) Summary: Since react-native-cli is deprecated, the correct command should be `npx react-native start` Pull Request resolved: https://github.com/facebook/react-native/pull/29270 Reviewed By: sammy-SC Differential Revision: D30017028 Pulled By: sota000 fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348 * Warn when negative `numberOfLines` prop set on <Text/> component Summary: Updates previous variant that was crashing a surface to the non-crashing variant. Now it prints error in console and modifies value to be 0. Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component Reviewed By: yungsters Differential Revision: D30129658 fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0 * Make So loading inside generated TMM delegates less confusing Summary: ## Rationale Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30082675 fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60 * Add TODOs to unify component names between JS - Android - iOS - C++ Summary: EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++ see task: T97384889 changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139942 fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d * Replace Paper -> old renderer Summary: Replace Paper -> old renderer changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D30139941 fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c * Fix Deadlock in RCTi18nUtil (iOS) (#31032) Summary: Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733 Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096). To summarize: 1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]` 2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread 3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread. 4- Deadlock. For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue. The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended. ## 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 deadlock on RCTi18nUtil Pull Request resolved: https://github.com/facebook/react-native/pull/31032 Test Plan: Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle. https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov Reviewed By: javache Differential Revision: D29522152 Pulled By: RSNara fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa * Codegen: Always prepare filesystem Summary: For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run. This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back. See Test Plan for more details on how to reproduce the issue being fixed. Fixes T97404254. Changelog: [Internal] Codegen invoked with every `pod install` regardless of pod install status Differential Revision: D30116640 fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8 * - Bump CLI to ^6.0.0 (#31971) Summary: Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0) ## 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] [Fix] - Bump CLI to ^6.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/31971 Test Plan: cc kelset grabbou Reviewed By: TheSavior Differential Revision: D30158170 Pulled By: ShikaSD fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b * Fix to make taps on views outside parent bounds work on Android (#29039) Summary: By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour. - Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register - Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register Related issues: - fixes https://github.com/facebook/react-native/issues/21455 - fixes https://github.com/facebook/react-native/issues/27061 - fixes https://github.com/facebook/react-native/issues/27232 ### Fix - Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead - Check that the touch is in its own bounds when returning itself - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set - Modified related code to adjust to this change - Added RNTesterApp test ## 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 --> [Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden` Pull Request resolved: https://github.com/facebook/react-native/pull/29039 Test Plan: This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp: | Before | After | | --- | --- | | ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) | Reviewed By: ShikaSD Differential Revision: D30104853 Pulled By: JoshuaGross fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23 * Create slider accessibility delegate in createViewInstance (#31942) Summary: Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper. This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules. ``` 08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206 08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare() 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:227) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at android.os.Handler.<init>(Handler.java:129) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281) 08-03 14:44:56.318 21206 21360 E AndroidRuntime: at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301) ``` To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue. Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed. ## Changelog [Android] [Fixed] - Create slider accessibility delegate in createViewInstance Pull Request resolved: https://github.com/facebook/react-native/pull/31942 Test Plan: Reproduced the crash in an app and made sure this patch fixes it. Reviewed By: JoshuaGross Differential Revision: D30167451 Pulled By: p-sun fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15 * Flush operations queue when animation starts in RCTNativeAnimatedModule Summary: changelog: [internal] If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager. For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager* Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`. There are two mechanisms that flush operations. One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture. The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed. Exampe: JavaScript calls methods on *NativeAnimated*. For example: 1. `createNode` 2. `connectAnimatedNodeToView` 3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric) All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected. But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes. Reviewed By: RSNara Differential Revision: D30099010 fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705 * Add Flow libdefs for `global` Summary: Changelog: [Internal] Currently, `global` is typed as `any` and any `global` properties accesses are untyped. This diff add a flow libdefs for the `global` object as a start point. Reviewed By: yungsters Differential Revision: D30000895 fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d * Feat/dynamic color borders (#31140) Summary: Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute. On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates. When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change. Fixes https://github.com/facebook/react-native/issues/30377 ## 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] [Added] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester Pull Request resolved: https://github.com/facebook/react-native/pull/31140 Test Plan: I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes: https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov Reviewed By: lunaleaps Differential Revision: D30073335 Pulled By: charlesbdudley fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da * Cleanup warnings in the NDK build Summary: This diff is cleaning up some configurations in the `Android.mk` files of the native build. Specifically I simplified some of the rules and removed a duplicate file specification. Changelog: Internal - Cleanup warnings in the NDK build Reviewed By: ShikaSD Differential Revision: D30220715 fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774 * Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule" Summary: Changelog: [internal] Original commit changeset: d3fc021dd434 Reviewed By: motiz88 Differential Revision: D30223203 fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2 * Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13 Summary: Changelog: Fix Xcode 13 build error in HelloWorld template Error: {F640400959} Fix: Embed `libswiftFileProvider.tbd` in app. Reviewed By: hramos Differential Revision: D30192423 fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e * introduce RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors. functionality not covered yet: - customColor - iOS Dynamic Colors - Variant Colors Reviewed By: sammy-SC Differential Revision: D30103451 fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574 * hook up PlatformColorParser to RCTPlatformColorUtils Summary: Changelog: [Internal] in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor Reviewed By: sammy-SC Differential Revision: D30110297 fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28 * replace SharedColor alias with class for more reliable template deduction Summary: Changelog: [Internal] when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following: https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132 this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`. there was a number of options i considered, but didn't feel the most correct: - wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper. - writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors. - coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds. i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above. Reviewed By: sammy-SC Differential Revision: D30149880 fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd * Deploy 0.157.0 to xplat Summary: Changelog: [Internal] Reviewed By: gkz Differential Revision: D30148513 fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72 * General Logging Util (stab) class for native errors (#31998) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/31998 Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app). This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30174404 fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada * Documenting UserFlow.endFailure Summary: We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba. This doc should add some clarity on what is expected from endFailure users. Changelog: [Internal][Added] - Documentation for method in UserFlow.js class Reviewed By: mityal Differential Revision: D30192127 fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39 * iOS: When RCTSyncImageManager image times out, log warning instead of error Reviewed By: fkgozali Differential Revision: D30255710 fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff * Un-deprecate ReactSoftException Summary: After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251651 fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9 * Rename ReactSoftException to ReactSoftExceptionLogger Summary: ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30251735 fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17 * Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010) Summary: Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete". ## Changelog [Android] [Breaking] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete` Pull Request resolved: https://github.com/facebook/react-native/pull/26010 Test Plan: Sandcastle Reviewed By: mdvacca Differential Revision: D29795575 Pulled By: lunaleaps fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c * Remove autoCompleteType as a native component prop Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component. Reviewed By: charlesbdudley Differential Revision: D30057497 fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b * Match native*.js and Native*.js srcs Summary: Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched. This change causes srcs to match with and without eden. Changelog: [Internal] Reviewed By: cute-jumper Differential Revision: D30266076 fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f * Fix TextInput Cursor jumping to the right when the placeholder null (#28995) Summary: This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658 Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right. ## 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 --> [Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right Pull Request resolved: https://github.com/facebook/react-native/pull/28995 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> More videos and information included in issue https://github.com/facebook/react-native/issues/28794 The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject) | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />| | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />| Extensive testing on `RNTester` did not identify any regression. | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />| </p> </details> **<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 https://github.com/facebook/react-native/pull/28995/commits/20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>** <p> | **BEFORE** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />| | **AFTER** | |:-------------------------:| | <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />| </p> </details> Reviewed By: charlesbdudley Differential Revision: D30095877 Pulled By: lunaleaps fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97 * Bump AGP to 4.2.2 Summary: This is just a minor bump in the Android Gradle plugin. Changelog: [Android][Changed] - Bumped AGP to 4.2.2 allow-large-files Reviewed By: ShikaSD Differential Revision: D30220591 fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead * Flatten the `react-native-codegen` included build. (#32007) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32007 This Diff simplifies the codegen Gradle build. Previously the build used to have a 2-level nesting of included build. Turns out that the `react-native-codegen/android/build.gradle` build is just providing a task and including an inner build that contains the codegen Gradle plugin. I've moved such plugin to the outer build. This will also make sure that the Gradle plugin files are properly index by the IDE when opening the build (as nested included build are not yet supported). Changelog: Internal - Flatten the `react-native-codegen` Gradle included build Reviewed By: fkgozali, ShikaSD Differential Revision: D30227784 fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f * iOS: Log image url in test environment when image times out Reviewed By: fkgozali Differential Revision: D30280757 fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9 * Fix BorderExample for DynamicColorIOS Summary: Changelog: [Internal] - Fix border example for RNTester Reviewed By: charlesbdudley Differential Revision: D30262957 fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60 * Add a flag to warn whenever the legacy NativeModule system is used Summary: When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30250363 fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028 * Log SoftExceptions when the legacy NativeModule system is used Summary: When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever: 1. A Java/Cxx NativeModule is created by the legacy system. 2. Any method on the Java NativeModule is executed, including getConstants(). NOTE: Logs to CXXModule use incoming. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30252953 fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c * Introduce JReactSoftExceptionLogger to log SoftExceptions from C++ Summary: When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D30272694 fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546 * Warn whenever CxxNativeModules are used Summary: After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used. Changelog: [Internal] Reviewed By: p-sun Differential Revision: D30272695 fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070 * Fix typo in RCTConvert.m (#31067) Summary: seperated -> separated ## 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] - Fixed typo in comment Pull Request resolved: https://github.com/facebook/react-native/pull/31067 Test Plan: NONE Reviewed By: sammy-SC Differential Revision: D30176244 Pulled By: sota000 fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1 * Allow Modal to handle hardware escape key in the same way the back button is handled (#31564) Summary: On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state. This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour. This issue isn't present on iOS, so no change is required there. ## 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 --> [Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard Pull Request resolved: https://github.com/facebook/react-native/pull/31564 Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device. Reviewed By: ShikaSD Differential Revision: D28953718 Pulled By: lunaleaps fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db * Nullable ReconnectingWebSocket params Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable Reviewed By: makovkastar Differential Revision: D30298832 fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96 * Clean up unbatched only experiment Summary: changelog: [internal] The experiment isn't shipping. Reviewed By: JoshuaGross Differential Revision: D30303379 fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04 * Clean up AsyncEventBeatV2 experiment Summary: changelog: [internal] This experiment is abandoned. It regressed engagement metrics. Reviewed By: JoshuaGross Differential Revision: D30303383 fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab * Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13" Summary: Changelog: Backout "Fix Xcode 13 build error in HelloWorld template" Original commit changeset: 59dbde441e61 This change breaks the template for Xcode 12.5: {F642871165} Reviewed By: philIip Differential Revision: D30301800 fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in HelloWorld template Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: p-sun Differential Revision: D30301799 fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf * fix#29319 - ios dismiss modal (#31500) Summary: This PR aims to resolve iOS can't dismiss Modal on swipe gesture. https://github.com/facebook/react-native/issues/29319 When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature ## 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] [Added] - Support for onRequestClose for iOS Modal component. Pull Request resolved: https://github.com/facebook/react-native/pull/31500 Test Plan: - If onRequestClose updates the visibility state, modal will be closed. ``` <Modal visible={visible} animationType="slide" presentationStyle="pageSheet" onRequestClose={dismiss}> </Modal> ``` https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov ## Notes - In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](https://github.com/facebook/react-native/commit/bb65b9a60d54b61652d608661eba876b49be3b17) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know. <!-- the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. --> Reviewed By: p-sun Differential Revision: D30041625 Pulled By: sammy-SC fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998 * Fix selectionColor doesn't style Android TextInput selection handles (#31007) Summary: This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color. The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes). ## 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 --> [Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles Pull Request resolved: https://github.com/facebook/react-native/pull/31007 Test Plan: This changes fix the Java API for which I can not write Java tests as explained in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe The java TextInputTest was excluded from the test suite in commit https://github.com/facebook/react-native/commit/709a441ecf54cd9465f5946af0454ee7d10d5cbe as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>** <p> left/right handles do not change color with the cursor | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> | center Handle color does not change color | **BEFORE** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> | The left and right handle change color with the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> | The center handle color is correctly updated | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> | `setCursorColor` changes correctly the cursor color | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> | Default Colors do not have issues | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> | | **AFTER** | |:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> | </p> </details> Reviewed By: ShikaSD Differential Revision: D28682935 Pulled By: sota000 fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0 * Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263) Summary: PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this. ## Changelog [Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" Pull Request resolved: https://github.com/facebook/react-native/pull/29263 Test Plan: ![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png) ![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png) Reviewed By: sammy-SC Differential Revision: D30176138 Pulled By: sota000 fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622 * Fix dashed/dotted border drawing when border-radius is 0 (#28359) Summary: This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns. This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles. ## Changelog `[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0` Pull Request resolved: https://github.com/facebook/react-native/pull/28359 Test Plan: **Faulty situation:** ![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png) **After the fix:** ![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png) Reviewed By: lunaleaps Differential Revision: D20590739 Pulled By: charlesbdudley fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd * Add a way to bind log function to the unified react native logger. Summary: In this diff: 1. Convert the ReactNativeLogger to c function for the future compatibility. 2. Bind the log function from Catalyst app 3. Update the call site Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30271863 fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884 * React Native sync for revisions 19092ac...5634ed1 Summary: This sync includes the following changes: - **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>// - **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>// - **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>// - **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>// - **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>// Changelog: [General][Changed] - React Native sync for revisions 19092ac...5634ed1 jest_e2e[run_all_tests] Reviewed By: kacieb Differential Revision: D30225923 fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c * Exclude nativeImageSource.js instead of matching [Nn] Summary: The change to this glob by D30266076 (https://github.com/facebook/react-native/commit/f1b4748a7c649ddff1739e4be57a1d4d89f1db56) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue. See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138 Changelog: [Internal] Reviewed By: yungsters Differential Revision: D30361375 fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa * Revert D20590739 Summary: This diff is reverting D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) D20590739 (https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff Tests affected: - https://www.internalfb.com/intern/test/281475012591721/ Multisect link: https://www.internalfb.com/intern/testinfra/multisect/476214 ## Changelog `[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0` Reviewed By: charlesbdudley Differential Revision: D30361262 fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a * Fix irregular indent in template (#29871) Summary: Fix irregular indent in template/android/app/build.gradle ![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.png) ## 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 irregular indent in template Pull Request resolved: https://github.com/facebook/react-native/pull/29871 Test Plan: N/A Reviewed By: passy, cortinico Differential Revision: D30360839 Pulled By: sota000 fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504 * JS: Fix "Modal | Basic" Test's Layout Summary: Fix the CSS on the main Modal test Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning. Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style. Reviewed By: lunaleaps Differential Revision: D30323087 fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49 * replace testing-support-lib with androidx buck targets in RN Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency Reviewed By: jiawei-lyu Differential Revision: D30379180 fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f * `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830) Summary: This pr: - Fixes: https://github.com/facebook/react-native/issues/30183 - Fixes: https://github.com/facebook/react-native/issues/30056 - Fixes: https://github.com/facebook/react-native/issues/29950 - Fixes: https://github.com/facebook/react-native/issues/29717 - Fixes: https://github.com/facebook/react-native/issues/29495 - Fixes: https://github.com/facebook/react-native/issues/29412 - Fixes: https://github.com/facebook/react-native/issues/29378 Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer. For example: https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java#L472-L479 After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter. https://github.com/facebook/react-native/blob/abb6433f506851430dffb66f0dd34c1e70a223fe/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java#L194-L215 But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0. And 0 is equal to TRANSPARENT, will cause <Text /> disappear. ## Changelog [Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent Pull Request resolved: https://github.com/facebook/react-native/pull/29830 Test Plan: Please initiated a new project and replaced the app with the following code: ``` import * as React from 'react'; import {Text, View, TouchableOpacity, PlatformColor} from 'react-native'; export default function App() { const [active, setActive] = React.useState(false); return ( <View> <Text style={active ? {color: 'green'} : null}>Example</Text> <Text style={ active ? {color: PlatformColor('android:color/holo_purple')} : null }> Example2 </Text> <TouchableOpacity onPress={() => setActive(!active)}> <Text>Toggle Active</Text> </TouchableOpacity> </View> ); } ``` Thanks you so much for your code review! Reviewed By: JoshuaGross Differential Revision: D30209262 Pulled By: lunaleaps fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76 * Fix Dimensions not updating on Android (#31973) Summary: When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android. ### Related issues - https://github.com/facebook/react-native/issues/29105 - https://github.com/facebook/react-native/issues/29451 - https://github.com/facebook/react-native/issues/29323 The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video). The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics. ## Changelog [Android] [Fixed] - Fix Dimensions not updating Pull Request resolved: https://github.com/facebook/react-native/pull/31973 Test Plan: ### Steps to reproduce 1. Install the RNTester app on Android from the `main` branch. 2. Set the device auto-rotation to ON 3. Start the RNTester app 4. While the app is loading, rotate the device 5. Navigate to the `Dimensions` screen 6. Either a. Observe the screen width and height are reversed, or b. Quit the app and return to step 3. ### Verifying the fix #### Manually Using the above steps, the issue should no longer be reproducible. #### Automatically See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java` ### Video https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4 Reviewed By: JoshuaGross Differential Revision: D30319919 Pulled By: lunaleaps fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b * refactor: remove DefaultProps from the StatusBar Component (#31631) Summary: Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional. ## Changelog [General] [Changed] - Remove defaultProps from the StatusBar Component. Pull Request resolved: https://github.com/facebook/react-native/pull/31631 Test Plan: Verified the behaviour of the existing functionality after the removal on the RN Tester app. https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov Reviewed By: sota000 Differential Revision: D30259324 Pulled By: lunaleaps fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757 * fix AGP 7 compatibility (#32030) Summary: Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin I can confirm that RN 0.65.0 app is running as expected on Android with the patch. > **compile** Depending on use case, this has been replaced by api or implementation. Also applies to *Compile variants, for example: debugCompile. ## Changelog [Android] [Changed] - Android Gradle Plugin 7 compatibility Pull Request resolved: https://github.com/facebook/react-native/pull/32030 Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app. Reviewed By: passy, ShikaSD Differential Revision: D30394238 Pulled By: cortinico fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9 * Clean up Fabric startSurface API used in Venice Summary: Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic. Changelog: [Internal] Reviewed By: sshic Differential Revision: D30346502 fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59 * Expose "unreserved" trait constants that can be mapped per-component Summary: Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits. It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components. Changelog: [Internal] Reviewed By: cortinico, RSNara Differential Revision: D30401743 fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066 * Call super.onActivityResult in ReactActivity Summary: This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native. Changelog: [Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult() Reviewed By: JoshuaGross Differential Revision: D30232449 fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5 * Move react_native_log out of utils (#32042) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32042 This diff moves react_native_log out of utils to make it easier/possible to import from modules. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30411247 fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230 * fix: Resolve NODE_BINARY *after* finding the path to node (#32029) Summary: We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined. ## Changelog [Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node Pull Request resolved: https://github.com/facebook/react-native/pull/32029 Reviewed By: TheSavior Differential Revision: D30401213 Pulled By: yungsters fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211 * Ship "Disable 'virtual view' preallocation" experiment in code Summary: The impact of this has proven impressive, and safe. Ship in code and remove feature-flag. Changelog: [Internal] Reviewed By: philIip Differential Revision: D30269561 fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb * Emit soft error for warning Summary: This diff adds a default behavior for the unified logger on Android. Added the call site in the CXXNativeModule. Changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D30377767 fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536 * Enable ktfmt Summary: Changelog: [internal] Reviewed By: zertosh Differential Revision: D30423755 fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9 * Pass configFile: false to Babel parser Summary: Changelog: [Internal] Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config. Reviewed By: javache Differential Revision: D30396331 fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10 * Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http Reviewed By: lunaleaps Differential Revision: D30218490 fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48 * Adding activity check to enable Dev mode Summary: It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check. Changelog: [Android][Fixed] - Added null check for activity in onHostResume() Reviewed By: javache Differential Revision: D30411311 fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1 * Deploy 0.158.0 to xplat Summary: Changelog: [Internal] Reviewed By: dsainati1 Differential Revision: D30426571 fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3 * - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32052 Changelog: Update the OSS React Native dependencies to match the internal dependency structure. Reviewed By: cortinico Differential Revision: D30397818 fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571 * Remove BUILD FILE SYNTAX from build files Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30410441 fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d * Apply new buildifier fixes Summary: Changelog: [Internal] Reviewed By: zertosh Differential Revision: D30407205 fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c * Remove redundant includes Summary: changelog: internal Removing unused headers. Fewer headers = faster compilation Reviewed By: p-sun Differential Revision: D30398600 fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed * Provide logger to YGConfig Summary: Changelog: [internal] Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log. Reviewed By: fkgozali Differential Revision: D30394676 fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973 * Set initial maximum surface size to viewport size Summary: Changelog: [internal] There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size. Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly. Reviewed By: fkgozali Differential Revision: D30402207 fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb * iOS: Don't display LogBox in Dev if Bridge was invalided Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface. Reviewed By: fkgozali Differential Revision: D30464848 fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e * Update ImageBackground.js (#32055) Summary: Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes. In this pr, I made width and height inside component to be optional so it won't crush. ## Changelog [General] [Fix] - Changed ImageBackground's style so it won't crush. [Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png) As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here: ![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png). In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore. Thoughts: Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all. Thanks ahead, that was my first pr, Eden Binyamin. Pull Request resolved: https://github.com/facebook/react-native/pull/32055 Reviewed By: charlesbdudley Differential Revision: D30452297 Pulled By: sshic fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d * Fix typo and grammar (#31916) Summary: > Always leave the campground cleaner than you found it. Fixing: * typo in _dismissed_ * make the subject agree with the verb ## Changelog [Internal] [Fixed] - A typo in a comment Pull Request resolved: https://github.com/facebook/react-native/pull/31916 Test Plan: Grammarly says it's better now. Reviewed By: lunaleaps Differential Revision: D29967403 Pulled By: yungsters fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc * Added Selection prop to TextInputProps Summary: Changelog: [iOS][Added] 1. Added new primitive type "Selection" to C++ 2. Added property "selection" to TextInputProps 3. Added parser for that Reviewed By: sammy-SC Differential Revision: D30043256 fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7 * Selection prop is applied for TextInput when component is mounting Summary: Changelog: [Internal] TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set. Reviewed By: sammy-SC Differential Revision: D30045271 fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904 * use correct gradle packageTask and asserts dir for android libraries (#32026) Summary: Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications. ## 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 --> [Android] [Fixed] - Fixed Android library builds with react.gradle file Pull Request resolved: https://github.com/facebook/react-native/pull/32026 Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded. Reviewed By: sshic, ShikaSD Differential Revision: D30368771 Pulled By: cortinico fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d * Codegen: Add codegen.js wrapper around generate-specs.sh Summary: Adds a simple wrapper around the generate-specs.sh bash script. Supports optional flags. Usage: `node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec` Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30439132 fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc * Add Flow libdefs for HermesInternalType Summary: Changelog: [Internal] This diff add a flow libdefs for the `HermesInternalType` to type `HermesInternal` as the first accurately typed `global` property, and filled all the type holes. Reviewed By: yungsters Differential Revision: D29986749 fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9 * Add support for the UIAccessibilityTraitsTabBar Summary: Changelog: Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar Reviewed By: yungsters Differential Revision: D30490752 fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3 * Add support for AccessibilityValue Summary: Changelog: [Fabric][iOS] Add support for AccessibilityState Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue Reviewed By: sammy-SC Differential Revision: D30452786 fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3 * fix typos in comments (#32061) Summary: Fixed some typos in the code comments. ## Changelog [Internal] [Fixed] - Fixed typo in the comments Pull Request resolved: https://github.com/facebook/react-native/pull/32061 Test Plan: N/A Reviewed By: javache Differential Revision: D30482511 Pulled By: cortinico fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2 * Add window to jest setup (#28067) Summary: `window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior. ## Background I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`: ```js const isServer = typeof window === 'undefined' ``` I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment. The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever. ## Changelog [General] [Fixed] - Fix `window` not existing in jest setup Pull Request resolved: https://github.com/facebook/react-native/pull/28067 Test Plan: Are there tests to check if the test environment is setup correctly? � Reviewed By: yungsters Differential Revision: D30317021 Pulled By: charlesbdudley fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd * React Native sync for revisions 424fe58...bd5bf55 Summary: Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/ This sync includes the following changes: - **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>// - **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>// - **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>// - **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>// - **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>// - **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>// Changelog: [General][Changed] - React Native sync for revisions 424fe58...bd5bf55 jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D30485521 fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8 * Remove usages of `dynamic_casts` that are used inside assertions Summary: This diff is part of a bigger effort to remove the RTTI flags. To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime type informations. Changelog: [Internal][Changed] - Removed extra asserts relying on dynamic_cast Reviewed By: JoshuaGross Differential Revision: D30483554 fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654 * Fix broken CI with a run of prettier Summary: This Diff is fixing a broken CircleCI on OSS due to not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822 The offending diff was D29986749 (https://github.com/facebook/react-native/commit/ff4b33672a6a27d2ed68ae6602e9d29d9b7c3eb1) Changelog: [Internal] - Fix broken CI due to not formatted js files Reviewed By: ShikaSD Differential Revision: D30515439 fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c * Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538) Summary: This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android. The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered. The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way. Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring. ## Changelog [Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android Pull Request resolved: https://github.com/facebook/react-native/pull/31538 Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov Reviewed By: mdvacca Differential Revision: D28631465 Pulled By: yungsters fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2 * Bump @react-native/polyfills version (#32074) Summary: https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one. Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish. ## Changelog [Internal][Fixed] - Bump react-native/polyfills version Pull Request resolved: https://github.com/facebook/react-native/pull/32074 Reviewed By: lunaleaps, cortinico Differential Revision: D30498104 Pulled By: yungsters fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86 * Include Swift lib in LIBRARY_SEARCH_PATHS Summary: changelog: Fix Xcode 13 build error in RNTester Including `usr/lib/swift` fixes error: {F642876047} Reviewed By: fkgozali Differential Revision: D30559838 fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329 * chore: prefer the local react-native-codegen package (#32096) Summary: Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one. ## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package Pull Request resolved: https://github.com/facebook/react-native/pull/32096 Test Plan: 1. Make the following changes ```diff diff --git a/package.json b/package.json index 847c726a69b..78da8232988 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "promise": "^8.0.3", "prop-types": "^15.7.2", "react-devtools-core": "^4.13.0", + "react-native-codegen": "^0.0.7", "react-refresh": "^0.4.0", "regenerator-runtime": "^0.13.2", "scheduler": "^0.20.2", diff --git a/template/package.json b/template/package.json index 715614112ac..5e0762b1b25 100644 --- a/template/package.json +++ b/template/package.json @@ -21,7 +21,6 @@ "eslint": "7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", - "react-native-codegen": "^0.0.7", "react-test-renderer": "17.0.2" }, "jest": { ``` 2. Run `scripts/test-manual-e2e.sh` ## Expected Behavior Task `:ReactAndroid:buildReactNdkLib` succeeds. ## Actual Behavior ``` > Task :ReactAndroid:buildReactNdkLib FAILED make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' fcntl(): Bad file descriptor make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni' ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view ~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ReactAndroid:buildReactNdkLib'. > Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 19s 20 actionable tasks: 20 executed Couldn't generate artifacts ``` Reviewed By: ShikaSD Differential Revision: D30581194 Pulled By: hramos fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c * feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079) Summary: This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them. https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488 ## Changelog [Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid Pull Request resolved: https://github.com/facebook/react-native/pull/32079 Test Plan: ``` PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE' ``` Reviewed By: cortinico Differential Revision: D30532656 Pulled By: yungsters fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9 * Update manual testing script to also test Hermes for RNTester Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester Reviewed By: ShikaSD Differential Revision: D30569403 fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737 * Move react-native-codegen to root * [0.66.0-rc.0] Bump version numbers * Native component check in deprecatedPropType was inverted (#31164) Summary: While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that https://github.com/facebook/react-native/commit/e68cf7cee9d36271a1d3899fecff817304bb8bdc appears to have accidently inverted the logic to avoid checking native components. `!UIManager.getViewManagerConfig(componentName)` become `UIManager.hasViewManagerConfig(componentName)` losing the ! Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging. [Internal] [Fixed] - Restored the previous logic of deprecatedPropType Pull Request resolved: https://github.com/facebook/react-native/pull/31164 Test Plan: Change tested and being submitted in react-native-windows: https://github.com/microsoft/react-native-windows/pull/7397 Reviewed By: hramos Differential Revision: D30624302 Pulled By: fkgozali fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f * OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds Summary: The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535 * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid https://github.com/facebook/react-native/pull/29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27 * OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround Summary: Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly. Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues Reviewed By: lunaleaps Differential Revision: D30691291 fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212 * Switch order of search libraries to fix M1 build error Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template Reviewed By: fkgozali Differential Revision: D30693466 fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e * Copy repo-config dependencies for bumping release version Summary: Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead Original commit changeset: 1dd2adc6a036 Reviewed By: fkgozali Differential Revision: D30599065 fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e * [0.66.0-rc.1] Bump version numbers * [LOCAL] postfix timestamp to bust yarn cache * Make JSI a dynamic library Summary: Ship libjsi as a standalone dynamic library. This prevents problems with exception handling caused by duplicate typeinfo across multiple shared libs, and reduces bundle size by removing duplicate copies of JSI. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D30599215 fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96 * Revert the Android specific max heap size GCConfig Summary: Changelog: [Category][Internal] This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after [Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d). You can read about more context there. Reviewed By: yungsters Differential Revision: D30726067 fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e * Bump Hermes npm to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 allow-large-files Reviewed By: lunaleaps Differential Revision: D30726474 fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00 * Bump Hermes pod to 0.9.0 Summary: Changelog: [General][Changed] - Bump Hermes to 0.9.0 (Note: this ignores all push blocking failures!) Reviewed By: lunaleaps Differential Revision: D30726473 fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80 * Update Podfile.lock * [0.66.0-rc.2] Bump version numbers * Link RCT-Folly against libc++abi Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See https://github.com/react-native-community/releases/issues/251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca * Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3 * [0.66.0-rc.3] Bump version numbers * Don’t hard-code CocoaPods’s sandbox path (#32243) Summary: When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails. References: * https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox * https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method ## Changelog [iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios` Pull Request resolved: https://github.com/facebook/react-native/pull/32243 Test Plan: 1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install` 2. `cd AwesomeProject` 3. `yarn install` 4. `pod install --project-directory=ios` This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0. 5. `npx react-native run-ios` The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834. 6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)` 7. Re-run `pod install --project-directory=ios` 8. Re-run `npx react-native run-ios` The iOS app should now run successfully. Reviewed By: sota000 Differential Revision: D31089656 Pulled By: fkgozali fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23 * OSS: update Podfile.lock automatically when bumping release version Summary: To ensure consistency of RNTester Podfile.lock: * introduce a script to run `pod install` on the current commit * have the script check the exact CocoaPods version to use for consistency * have version bump script run this automatically to keep it up-to-date with the version change To validate, have this change in `0.66-stable` branch, then try: ``` ./scripts/bump-oss-version.js 0.66.0-rc.5 ``` This automatically ran `pod install` which produced the Podfile.lock update. Changelog: [Internal] Reviewed By: TheSavior Differential Revision: D31132867 fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90 * [LOCAL] Port react-native-codegen new .gitignore from main This is to bring https://github.com/facebook/react-native/blob/c3ff336326302d7988bf7c187c9dcabed3bae10d/.gitignore#L107 to release branch * OSS: bump-oss-version -- update Podfile.lock later in the flow Summary: There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow. This also restrict the version number change check to the specific files for better reliability Changelog: [Internal] Reviewed By: sota000 Differential Revision: D31160139 fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd * [0.66.0-rc.4] Bump version numbers * [0.66.0] Bump version numbers * get ios building * remove isSelected and selectedRowIndexPath for now * add workspace * Restore .eslintignore to what it looks like in react-native-macos * Fix easy eslint errors as per the `--fix` option * Fix the rest of the yarn lint errors * Update yarn.lock * Add AccessibilityRole back to Button.js * Fix flow issues on iOS and macOS * Initialize state in VirtualizedSectionList * Update snapshots * Fix parseLogBoxLog tests to include native code blocks * Specify state explicitly for DisplayOptionsStatusExample * Disable "Text with custom accessibility actions" example * android * Fix AnimatedMock spring to handle animated configs * Fix most compile issues for macOS * Fix post_install sed script * Changes that allow RNTester to launch on macOS * Fix isHighContrastEnabled on RNTester accessibility page * Bump special targets in RNTester Podfile to iOS 11 * BorderExample: use a platform color that also exists on macOS * Disable dev mode on ship builds (#888) * revert dev mode on ship builds * rctuicolor * remove unused variable * pod install * fix text fields on macOS * add osx support * image prop and scroll view build failures osx * Fix yarn lint issues * Update Podfile.lock * endline changes * Get rid of macOS RedBox in LayoutEventsExample * fix: Apply proper accessibility role to images on macOS * Add another macOS GH#774 tag * fix snapshot image test failure * upgrade ts to a compatible version * bump podfile.lock * Fix Android patches in fb66merge * change cocoapods version * update internal cocoapods requirements * test increasing min deployable target * min deployment error in CI, bump to 10.15 osx * fix typedef redefinition build error in folly * disable use_flipper in our templates * disable USE_FRAMEWORKS for Flipper support * Revert "disable USE_FRAMEWORKS for Flipper support" This reverts commit c09b6c579c9dc59c1b19d9a82ce3071cd0505a04. * disable post_install of flipper * combine tempated macos post_install * add generate-specs.sh Co-authored-by: Xuan Huang <jsx@fb.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Charles Dudley <charlesdudley@fb.com> Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com> Co-authored-by: Sota Ogo <sota@fb.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Amy Nichol <amynichol@fb.com> Co-authored-by: swittk <switt1995@gmail.com> Co-authored-by: Ikko Ashimine <eltociear@gmail.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: CodemodService FBSourceClangFormatLinterBot <> Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu> Co-authored-by: Evan Yeung <evanyeung@fb.com> Co-authored-by: Jacob Parker <jacobparker1992@gmail.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Vegas Murphy <vegasmurphy@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: Test User <gosimek@gmail.com> Co-authored-by: Pieter De Baets <pieterdb@fb.com> Co-authored-by: Paige Sun <paigesun@fb.com> Co-authored-by: Moti Zilberman <motiz88@gmail.com> Co-authored-by: Andrei Shikov <ashikov@fb.com> Co-authored-by: Andrew Clark <acdlite@fb.com> Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com> Co-authored-by: Sunny Luo <sunnylqm@gmail.com> Co-authored-by: Saad Najmi <saadnajmi2@gmail.com> Co-authored-by: Héctor Ramos <hramos@fb.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Harry Yu <hy.harry.yu@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com> Co-authored-by: Nicola Corti <ncor@fb.com> Co-authored-by: Phillip Pan <phillippan@fb.com> Co-authored-by: Dmytro Voronkevych <zloy@fb.com> Co-authored-by: Luna Wei <luwe@fb.com> Co-authored-by: Chris Tolliday <ctolliday@fb.com> Co-authored-by: Levi Buzolic <levibuzolic@gmail.com> Co-authored-by: Nishan Bende <nishanbende@gmail.com> Co-authored-by: Matthew Gray <Matgray@microsoft.com> Co-authored-by: Hein Rutjes <hrutjes@gmail.com> Co-authored-by: nacam403 <satnakam@gmail.com> Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com> Co-authored-by: hank121314 <hank121314@gmail.com> Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com> Co-authored-by: alessandro <alessandro.fan@welld.ch> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: pera <santiagofermendy@gmail.com> Co-authored-by: Carmi Grushko <carmi@fb.com> Co-authored-by: Jimmy Zhang <jimmyzh@fb.com> Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com> Co-authored-by: Marshall Roch <mroch@fb.com> Co-authored-by: Chatura Atapattu <chatatap@fb.com> Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com> Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com> Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com> Co-authored-by: Leon Kiefer <leon.k97@gmx.de> Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com> Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com> Co-authored-by: Kacie Bawiec <kacieb@fb.com> Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com> Co-authored-by: Nick Gerleman <ngerlem@microsoft.com> Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com> Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Neil Dhar <neildhar@fb.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-15 00:11:09 +03:00
'See https://github.com/react-native-checkbox/react-native-checkbox',
);
},
});
/* $FlowFixMe[prop-missing] This is intentional: Flow will error when
* attempting to access StatusBarIOS. */
/* $FlowFixMe[invalid-export] This is intentional: Flow will error when
* attempting to access StatusBarIOS. */
Object.defineProperty(module.exports, 'StatusBarIOS', {
configurable: true,
get() {
invariant(
false,
'StatusBarIOS has been removed from React Native. ' +
'Has been merged with StatusBar. ' +
'See https://reactnative.dev/docs/statusbar',
);
},
});
/* $FlowFixMe[prop-missing] This is intentional: Flow will error when
* attempting to access PickerIOS. */
/* $FlowFixMe[invalid-export] This is intentional: Flow will error when
* attempting to access PickerIOS. */
Object.defineProperty(module.exports, 'PickerIOS', {
configurable: true,
get() {
invariant(
false,
'PickerIOS has been removed from React Native. ' +
"It can now be installed and imported from '@react-native-picker/picker' instead of 'react-native'. " +
'See https://github.com/react-native-picker/picker',
);
},
});
/* $FlowFixMe[prop-missing] This is intentional: Flow will error when
* attempting to access Picker. */
/* $FlowFixMe[invalid-export] This is intentional: Flow will error when
* attempting to access Picker. */
Object.defineProperty(module.exports, 'Picker', {
configurable: true,
get() {
invariant(
false,
'Picker has been removed from React Native. ' +
"It can now be installed and imported from '@react-native-picker/picker' instead of 'react-native'. " +
'See https://github.com/react-native-picker/picker',
Remove deprecated CheckBox module. (#801) * Update default Podfile to not depend on a path (#28572) Summary: Recently, a default Podfile has been modified to not contain all the React Native pods, but use a helper method `use_react_native!`. While this is great, it assumes a hardcoded path of `../node_modules/react-native` to be always the correct location of the React Native. https://github.com/facebook/react-native/blob/d4d8887b5018782eeb3f26efa85125e6bbff73e4/scripts/autolink-ios.rb#L7-L9 Unfortunately, due to the way Ruby works, this completely hides the path away from the users. Before, they could have seen the wrong path explicitly in a Podfile and knew to update it to resolve path-related issues. With the current version in `master`, I can see a lot of issues where developers wonder how to resolve the path issues and how to pass the path itself. https://github.com/facebook/react-native/blob/4118d798265341061105f3a53550db83c66a71cb/template/ios/Podfile#L5-L10 This PR uses React Native CLI configuration (that is already used to link 3rd party dependencies) to explicitly define the correct path to the React Native. As a result, we don't have to change the paths here whether we're running monorepo or not. ## Changelog [IOS] [INTERNAL] - Always provide an explicit path to React Native Pull Request resolved: https://github.com/facebook/react-native/pull/28572 Differential Revision: D20945194 Pulled By: TheSavior fbshipit-source-id: 010f9754f2ed78ef62fd52f4d201f296f5af6d27 * Upgrade Prettier in Xplat to version 1.19.1 Summary: Upgrades Prettier in Xplat to 1.19.1 Ignores upgrading packages on already on versions greater than 1.19.1 Changelog: [Internal] allow-large-files bypass-lint (Note: this ignores all push blocking failures!) Reviewed By: gkz, cpojer Differential Revision: D20879147 fbshipit-source-id: 0deee7ac941e91e1c3c3a1e7d3d3ed20de1d657d * Stop using get_fbobjc_enable_exception_lang_compiler_flags_DEPRECATED in xplat Summary: Old deprecated function. Changelog: [Internal] Reviewed By: nlutsenko Differential Revision: D20148856 fbshipit-source-id: 79d6fb97824b059e50f67ff5a0b4c38ec7a19469 * Add ProGuard rule for hermes (#28571) Summary: This adds a ProGuard for `hermes` rule so it does not have to be added by users manually. https://github.com/facebook/react-native/issues/28270 ## 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 --> [Android] [Added] - ProGuard rule for hermes Pull Request resolved: https://github.com/facebook/react-native/pull/28571 Test Plan: 1. Create a project with/without hermes. 2. Enable proguard. Reviewed By: cpojer Differential Revision: D20947095 Pulled By: hramos fbshipit-source-id: 79b166ad2dd060f20041d9f5cfe2f794c754843d * Move CheckBox JS files to FB Internal Summary: Move CheckBox JS files to FB internal ## Changelog: [General] [Removed] This diff removes the CheckBox export from React Native. Internally, we are requiring CheckBox directly now and externally people will have to use the community maintained module. Reviewed By: cpojer Differential Revision: D20910775 fbshipit-source-id: 809e135dc3f68911ac0a004e6eafa8488f0d5327 * Remove CheckBox from docsList.js Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: George Zahariev <gkz@fb.com> Co-authored-by: Scott Wolchok <swolchok@fb.com> Co-authored-by: Radek Czemerys <radko93@gmail.com> Co-authored-by: Lauren Tan <laurentan@fb.com>
2021-07-15 01:34:49 +03:00
);
},
});
/* $FlowFixMe[prop-missing] This is intentional: Flow will error when
* attempting to access DatePickerAndroid. */
/* $FlowFixMe[invalid-export] This is intentional: Flow will error when
* attempting to access DatePickerAndroid. */
Object.defineProperty(module.exports, 'DatePickerAndroid', {
configurable: true,
get() {
invariant(
false,
'DatePickerAndroid has been removed from React Native. ' +
"It can now be installed and imported from '@react-native-community/datetimepicker' instead of 'react-native'. " +
'See https://github.com/react-native-datetimepicker/datetimepicker',
);
},
});
}