react-native-macos/Libraries/Utilities/NativeJSDevSupport.js

24 строки
674 B
JavaScript
Исходник Обычный вид История

Merge react-native 0.61-stable (#323) * Expose JS Responder handler in Scheduler API Summary: This diff implements the JSResponderHandler methods in the core of RN (scheduler API and friends) Reviewed By: ejanzer Differential Revision: D16543437 fbshipit-source-id: dac03e30c4330d182ecf134f3174ba942dbf7289 * Implement JS Responder Handler in Fabric Android Summary: This diff implements the JSResponderHandler in Fabric Android code Reviewed By: JoshuaGross Differential Revision: D16543438 fbshipit-source-id: 13680f77a5368e8ba1180383a5f9fb7d7330b90a * Implement JNI code to invoke Android JSResponder methods from C++ Summary: This diff implements the JNI code required for Android to receive JSResponderHandler calls Reviewed By: JoshuaGross, makovkastar Differential Revision: D16543431 fbshipit-source-id: 38cff16a05633fccefa201b189d761d503a9b839 * Change AndroidDrawerLayoutNativeComponent to use JS codegen for commands Summary: `codegenNativeCommands` returns an object with functions for each command that has the previous behavior inside the React Renderer, and the new Fabric logic inside of the Fabric React Native Renderer. Changelog: [Internal] - Change AndroidDrawerLayoutNativeComponent to use JS codegen for commands Reviewed By: rickhanlonii Differential Revision: D16529887 fbshipit-source-id: 24a5307944a7f62e18482d60d26052fea3be2051 * Update commands transform to use helper Summary: This uses a new helper called `dispatchCommand` that now exists on the renderer. This was added to the renderer here: https://github.com/facebook/react/pull/16085 In Paper it calls UIManager.dispatchViewManagerCommand and in Fabric it calls the c++ Fabric UIManager Reviewed By: rickhanlonii Differential Revision: D16578708 fbshipit-source-id: 30f9468a7fd48afb506c0ee49a460b949bc863a1 * Delete jsi::Functions before jsi::Runtime gets deleted Summary: ## The Problem 1. `CatalystInstanceImpl` indirectly holds on to the `jsi::Runtime`. When you destroy `CatalystInstanceImpl`, you destroy the `jsi::Runtime`. As a part of reloading React Native, we destroy and re-create `CatalystInstanceImpl`, which destroys and re-creates the `jsi::Runtime`. 2. When JS passes in a callback to a TurboModule method, we take that callback (a `jsi::Function`) and wrap it in a Java `Callback` (implemented by `JCxxCallbackImpl`). This Java `Callback`, when executed, schedules the `jsi::Function` to be invoked on a Java thread at a later point in time. **Note:** The Java NativeModule can hold on to the Java `Callback` (and, by transitivity, the `jsi::Function`) for potentially forever. 3. It is a requirement of `jsi::Runtime` that all objects associated with the Runtime (ex: `jsi::Function`) must be destroyed before the Runtime itself is destroyed. See: https://fburl.com/m3mqk6wt ### jsi.h ``` /// .................................................... In addition, to /// make shutdown safe, destruction of objects associated with the Runtime /// must be destroyed before the Runtime is destroyed, or from the /// destructor of a managed HostObject or HostFunction. Informally, this /// means that the main source of unsafe behavior is to hold a jsi object /// in a non-Runtime-managed object, and not clean it up before the Runtime /// is shut down. If your lifecycle is such that avoiding this is hard, /// you will probably need to do use your own locks. class Runtime { public: virtual ~Runtime(); ``` Therefore, when you delete `CatalystInstanceImpl`, you could end up with a situation where the `jsi::Runtime` is destroyed before all `jsi::Function`s are destroyed. In dev, this leads the program to crash when you reload the app after having used a TurboModule method that uses callbacks. ## The Solution If the only reference to a `HostObject` or a `HostFunction` is in the JS Heap, then the `HostObject` and `HostFunction` destructors can destroy JSI objects. The TurboModule cache is the only thing, aside from the JS Heap, that holds a reference to all C++ TurboModules. But that cache (and the entire native side of `TurboModuleManager`) is destroyed when we call `mHybridData.resetNative()` in `TurboModuleManager.onCatalystInstanceDestroy()` in D16552730. (I verified this by commenting out `mHybridData.resetNative()` and placing a breakpoint in the destructor of `JavaTurboModule`). So, when we're cleaning up `TurboModuleManager`, the only reference to a Java TurboModule is the JS Heap. Therefore, it's safe and correct for us to destroy all `jsi::Function`s created by the Java TurboModule in `~JavaTurboModule`. So, in this diff, I keep a set of all `CallbackWrappers`, and explicitly call `destroy()` on them in the `JavaTurboModule` destructor. Note that since `~JavaTurboModule` accesses `callbackWrappers_`, it must be executed on the JS Thread, since `createJavaCallbackFromJSIFunction` also accesses `callbackWrappers_` on the JS Thread. For additional safety, I also eagerly destroyed the `jsi::Function` after it's been invoked once. I'm not yet sure if we only want JS callbacks to only ever be invoked once. So, I've created a Task to document this work: T48128233. Reviewed By: mdvacca Differential Revision: D16623340 fbshipit-source-id: 3a4c3efc70b9b3c8d329f19fdf4b4423c489695b * Fix missing rotateZ to useAnimatedDriver Whitelist (#25938) Summary: Added missing property to whitelist ## Changelog [General] [Fixed] - Fixed rotateZ native animation Pull Request resolved: https://github.com/facebook/react-native/pull/25938 Differential Revision: D16645798 Pulled By: cpojer fbshipit-source-id: ef74d7230fa80068dcceaaff841af27365df92e9 * Back out "[react-native][PR] Allow Animation EndResult callback to return Promise" Summary: Original commit changeset: 420d29d262b6 Reverts https://github.com/facebook/react-native/pull/25793 / D16515465 Union type property is not supported by codegen. We don't want to support unions yet and because the improvement is not that big and not yet published as stable for OSS (neither used anywhere internally) we can safely revert it. Reviewed By: RSNara Differential Revision: D16621228 fbshipit-source-id: 2fa416eef1ae353990860026ca97d2b0b429a852 * Switch Platform Constansts to use typedConstants structs Summary: It's actually the first module in OSS which is typed with taking advantages of codegen. Reviewed By: RSNara Differential Revision: D16620334 fbshipit-source-id: 65d6656506f2a4c68d493939ecfa65ba975abead * Fixed android bounding box (#25836) Summary: This PR fixes https://github.com/facebook/react-native/issues/19637. Summary of the issue: on Android, transformed touchables have press issues because the touchable's measurements are incorrect in the release phase. `UIManager.measure()` returns an incorrect size and position as explained [here](https://github.com/facebook/react-native/issues/19637#issuecomment-396065914) This is easily seen with the inspector : **Screenshot of a { scale: 2 } transform** The real view (scaled) is in pink, the incorrect touchable area is in blue. <img src="https://user-images.githubusercontent.com/110431/41190133-8d07ad02-6bd9-11e8-873d-93776a007309.png" width="200"/> **Screenshot of a { rotateZ: "-45deg" } transform** The real view (rotated) is in pink, the incorrect touchable area is in blue. <img src="https://user-images.githubusercontent.com/110431/41190136-a1a079a6-6bd9-11e8-906d-729015bcab6b.png" width="200"/> ## Changelog [Android] [Fixed] - Fix UIManager.measure() Pull Request resolved: https://github.com/facebook/react-native/pull/25836 Test Plan: Android now produces the same results as iOS as seen on these screenshots | Android without fix | Android with fix | iOS | | --- | --- | --- | | ![Screenshot_1564133103](https://user-images.githubusercontent.com/110431/61941632-28729b00-af98-11e9-9706-b13968b79df5.png) | ![Screenshot_1564130198](https://user-images.githubusercontent.com/110431/61941631-28729b00-af98-11e9-9ff3-5f2748077dbe.png) | ![Simulator Screen Shot - iPhone X - 2019-07-26 at 11 19 34](https://user-images.githubusercontent.com/110431/61941633-28729b00-af98-11e9-8dc4-22b61178242e.png) | Reviewed By: cpojer Differential Revision: D16598914 Pulled By: makovkastar fbshipit-source-id: d56b008b717ea17731fb09001cbd395aa1b044fe * Fix crash when tapping full screen button on video ad Summary: Fragment was assigned incorrect `tag` and `surfaceID` (`surfaceID` is the important one). Wrong `surfaceID` means that `navigationCoordinator` is never resolved. As a result of navigationCoordinator not being assigned, tapping a video ad on Marketplace results in showing video ad overlay rather than showing full screen video. Reviewed By: JoshuaGross Differential Revision: D16646492 fbshipit-source-id: 0da5c56ecb7c81e9f4a9469a3626ccd430a01558 * Pop frames correctly in console.error handler Reviewed By: cpojer Differential Revision: D16648992 fbshipit-source-id: 4581e2cd6859f27bc384fc3ab328ab5b9414c704 * Fix up NativeDialogManagerAndroid PR Summary: This diff has three changes: 1. Remove all references to `Stringish` from `NativeDialogManagerAndroid`. (All Fbt objects expose a `.toString` method we could call). 2. Make sure that we only access `DialogManagerAndroid` through `NativeDialogManagerAndroid`. 3. Removed a bunch of `$FlowFixMes` in the files I touched. Probably not the best idea to bite into this cleanup on this diff, but what's done is done. Since this diff is fairly large, I've commented on parts of it I thought were note-worthy. I've also commented on the changes I had to make to fix flow after removing the `$FlowFixMe`s. Reviewed By: PeteTheHeat Differential Revision: D16428855 fbshipit-source-id: 0e6daf2957f4b086ebb1e78e0a59930668c65576 * Bump hermes to v0.1.1 (#25908) Summary: Hermes has been updated to [v0.1.1](https://github.com/facebook/hermes/releases/tag/v0.1.1) and [renamed from 'hermesvm' to 'hermes-engine'](https://github.com/facebook/hermes/commit/c74842ee5c4d11dc9fe3bf012f97a0e3fde6d54f) ## Changelog [Android] [Changed] - Bump hermes to v0.1.1 Pull Request resolved: https://github.com/facebook/react-native/pull/25908 Test Plan: RNTester builds and runs as expected Differential Revision: D16645811 Pulled By: cpojer fbshipit-source-id: 4fb6a3160df2c6d08140dd1fee51acf9ff8baffc * Fabric PerfLogger: prevent ConcurrentModificationException Summary: Some surfaces throw ConcurrentModificationException when logging detailed perf for Fabric. I've refactored the ReactMarker class to use a threadsafe ArrayList and removed synchronization, which is safer and should improve perf everywhere the markers are used, even if there are zero listeners. Reviewed By: mdvacca Differential Revision: D16656139 fbshipit-source-id: 34572f9ad19028a273e0837b0b895c5e8a47976a * iOS fixed up inconsistent boolean convertion logic in RCTPlatform Summary: For some reason the conversion from a BOOL object to `bool` (C++ style) may lead to incorrect boolean value. This fixes the value provided to the builder to be of `bool` type instead. Reviewed By: JoshuaGross Differential Revision: D16657766 fbshipit-source-id: b66922aceadd20d16226a07f73b24ee0a3b825dc * Add ErrorUtils to global variables (#25947) Summary: ErrorUtils is giving an error by eslint. ('ErrorUtils is not defined'). ## Changelog [General] [Fixed] - Add ErrorUtils to eslint globals Pull Request resolved: https://github.com/facebook/react-native/pull/25947 Test Plan: Run eslint on a react native project using ErrorUtils. Eslint verification should pass. Differential Revision: D16666163 Pulled By: cpojer fbshipit-source-id: c20c4e21fe06c6863dcfc167d6d03c6217ae1235 * Update App.js (#25905) Summary: use "shorthand" of `Fragment` No need to import `Fragment` as it can be used via `<></>` vs `<Fragment><Fragment />` ## Changelog Use shorthand for Fragment in App.js [General] [Changed] - Use shorthand for Fragment in App.js Pull Request resolved: https://github.com/facebook/react-native/pull/25905 Test Plan: Ci Tests should be sufficient Differential Revision: D16666166 Pulled By: cpojer fbshipit-source-id: 70e2c9793087bf8f5e0a5477c75f178134cbd6a1 * Fix error string in codegenNativeComponent Summary: This diff fixes the error message in the codegenNativeComponent fallback Reviewed By: TheSavior Differential Revision: D16579775 fbshipit-source-id: 176f81ea91e11f671407a5e5e5b000c4b83f93b2 * Remove outdated React async component check Summary: I added this check [a couple of years ago](https://github.com/facebook/react-native/commit/1b22d49ae8945680dee4fd01e3fbb78b1e443e01) to mimic how [React used to check for async roots](https://github.com/facebook/react/blob/acabf112454e5545205da013266d8529599a2a82/packages/react-reconciler/src/ReactFiberReconciler.js#L321-L330). This code doesn't make sense anymore since there's neither an async base class or an `unstable_ConcurrentMode` export, so I'm just cleaning it up. Reviewed By: threepointone, sebmarkbage Differential Revision: D16668567 fbshipit-source-id: 5ccf5feccc4b65ffb3aeb0a09891d8be7490df26 * Add tests for codegenNativeComponent Summary: Adds tests for codegenNativeComponent Reviewed By: TheSavior Differential Revision: D16582627 fbshipit-source-id: 3527126c7838f3e2c0c56b19956c618f0a7fb9f9 * Update loading pre-bundled message Summary: Updated the message from > Loading from pre-bundled file to > Connect to Metro to develop JavaScript I also added a new RCT_PACKAGER_NAME so other packagers can override "Metro" Reviewed By: yungsters, cpojer Differential Revision: D16427501 fbshipit-source-id: 1b7f9e261f7521ba930c6248087fe6f3c3659cb7 * Add $FlowFixMeEmpty to suppressions in RN's .github.flowconfig Summary: The types-first codemod adds a few of these, so need to sync the suppressions here with the ones in xplat/js/.flowconfig Reviewed By: jbrown215 Differential Revision: D16690168 fbshipit-source-id: 49d3f80a4ab24badf11a9ac54abfe49670989a91 * Add portable bit field implementation Summary: @public Our usage of C++ bit fields has lead to quite some problems with different compiler setups. Problems include sign bits, alignment, etc. Here we introduce a portable implementation as a variadic template, allowing the user to store a number of booleans and enums (defined with `YG_ENUM_SEQ_DECL`) in an unsigned integer type of their choice. This will replace all usages of bit fields across the Yoga code base. Differential Revision: D16647801 fbshipit-source-id: 230ffab500885a3ad662ea8f19e35a5e9357a563 * Remove style property bitmask Summary: @public Removes the style properties bitmask. We have used this for experimentation, and it's no longer necessary. This simplifyies the code, and allows us to cut over to `Bitfield.h` more easily. Reviewed By: astreet Differential Revision: D16648862 fbshipit-source-id: 17c0899807af976f4ba34db54f8f0f6a3cd92519 * Use `Bitfield` in `YGNode` and `YGStyle` Summary: @public Replaces the usage of C++ bitfields with our portable `Bitfield` class. Reviewed By: SidharthGuglani Differential Revision: D16649875 fbshipit-source-id: 539f016d5e1c9a8c48cc9bacbbf6ed985e385e69 * Use `Bitfield` in `YGLayout` Summary: Replaces the usage of C++ bitfields with our portable `Bitfield` class. Reviewed By: SidharthGuglani Differential Revision: D16656361 fbshipit-source-id: 05f679e2e994e109b2bd1090c879d6850fabdc40 * Back out "[Yoga] Experiment: double invocations of measure callbacks" Summary: Removes the double measure callbacks experiment Original commit changesets: c6cf9c01a173, b157d8137c72 Reviewed By: SidharthGuglani Differential Revision: D16687367 fbshipit-source-id: 9649f8731bd1b27f4d291cee4fa30153165cea02 * Don't copy children in YGNodeComputeFlexBasisForChildren (#919) Summary: No need for a copy here. Pull Request resolved: https://github.com/facebook/yoga/pull/919 Differential Revision: D16701461 Pulled By: davidaurelio fbshipit-source-id: 3a90adbb2b5c43d5aefe693a8525aa3a37e53b3d * React edit text changes (#25964) Summary: Changing showSoftKeyboard and hideSoftKeyboard to be protected, as we need this change for an internal control that extends ReactEditText. ## Changelog [Android] [Changed] - part of our react native platform, we have a control that extends ReactEditText and we need to be able to override these 2 methods. Pull Request resolved: https://github.com/facebook/react-native/pull/25964 Test Plan: The change has been in Microsoft's branch of RN for almost 2 years, and since it's a relatively small change we've done a quick sanity check in RNTester prior to this PR, making sure the TextInput page loads fine and it's functional. Differential Revision: D16686878 Pulled By: cpojer fbshipit-source-id: 63035ee9c58e93bc0fa40e5bec318df05322c6c5 * Fix Fast Refresh on Fabric Summary: Brings in https://github.com/facebook/react/pull/16302. We were passing roots to a wrong renderer, hence a confusing Fabric-only crash. Reviewed By: JoshuaGross Differential Revision: D16672454 fbshipit-source-id: 115894eb375b50da09d145c57f15c7d5668b926d * iOS: Revert RCT->RN prefix renaming to avoid confusion Summary: The previous rename from RCT->RN prefix ended up causing some confusions on which prefix to use for which files and under what circumstances. To avoid further confusion before we're done with the re-architecture project, let's keep them as RCT. Reviewed By: mdvacca Differential Revision: D16705566 fbshipit-source-id: 395bff771c84e5ded6b2261a84c7549df1e6c5e5 * use array for passing measure callback reasons count Summary: Use an array for counting measure callbacks due to each reason. and this is now added as qpl metadata in Layout Calculation qpl event Reviewed By: davidaurelio Differential Revision: D16666786 fbshipit-source-id: ff85fba835148f06b9c5d90c4604e552a813777a * Commands codegen: added RCT prefix for protocols, extern C functions, and file names Summary: This will provide consistency with the rest of ObjC/ObjC++ files throughout RN codebase, which is also part of the iOS engineering practice to have a prefix. Highlights: * This only affects the `protocol` and extern C functions, and the .h output file name * Other C++ only file/classes are not affected * The assumption is that the RCT prefix is only for iOS specific files/names. The JS component name should **NOT** have any prefix in the long term (some of them still have RCT prefix in the name, which was an artifact of legacy inconsistency). * The RCT prefix is not relevant to Java/JNI code, since they have their own convention Reviewed By: TheSavior, mdvacca Differential Revision: D16661286 fbshipit-source-id: b8dd75fa7f176d6658183f225b27db017b4b55e7 * Add support for casting codegenNativeComponent Summary: Adds support for casting the codegenNativeComponent export Reviewed By: TheSavior Differential Revision: D16676207 fbshipit-source-id: 5e874bd5a72eb7e67e05b0f671856ae3319a335e * Format code in ReactCommon/turbomodule/core Summary: Just ran `arc f ReactCommon/turbomodule/core/**/*`. Reviewed By: ejanzer Differential Revision: D16691807 fbshipit-source-id: 3f499ffeffaae47bda550c0071c93cd7f48e2a23 * Refactor TextInput.js passes strings to Java for autoCapitalize Summary: We are working to remove constants from the view configs. On June 21st I modified native to support both numbers and strings. D15911323 Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D16697916 fbshipit-source-id: f346f37b2e664c2dd49e2a1308a0517f50284e4d * Minor improvements in native modules codegens Summary: Add handling of `$ReadOnly`, $ReadOnlyArray`. Drop handling of params for callback (does not impact native generated node) and promises' types (does not impact native generated node). Remove typo from native codegen. Reviewed By: RSNara Differential Revision: D16686886 fbshipit-source-id: 26345978bbbba0cee14d00e7b5b9e5017c89a46c * Add handling of nullable return value Summary: Retuned value can be nullable and it need to be handled Reviewed By: RSNara Differential Revision: D16687359 fbshipit-source-id: 7869c4e2b1da69b680b6eade3c88e0558077b705 * fallback not understandable types from methods to object Summary: We don't want to make our codegen breaking if type is not existing. In order to it we can always fallback to Object. That's how it currently works in old codegen #Facebook Thare're few places in our internal code where we use `Map` or tuple in these cases Reviewed By: RSNara Differential Revision: D16687360 fbshipit-source-id: bf8aafd3254fc7e18ad0d58ad1a29e2beeb15bf0 * change name convention for modules Summary: Following our internal discussion we want to change previously used name convention. Now it looks like: ``` #import <FBReactNativeTestSpec/FBReactNativeTestSpec.h> ``` Name is a param of `rn_codegen` and `rn_library`. Also, I found it the easiest to move replacing `::_IMPORT_::` into buck rule Reviewed By: fkgozali Differential Revision: D16646616 fbshipit-source-id: 2c33c5b4d1c42b0e6f5a42d9a318bd8bda9745f4 * Add pointer to generated id<NSObject> Summary: It should always be a pointer, sorry! Reviewed By: RSNara Differential Revision: D16689608 fbshipit-source-id: f67d2606b5bdc169d312c1c75748c390ee5e56ed * Fix veryfying exports in module codegen Summary: If was breaking in cases like ``` export { x as default } ``` Reviewed By: RSNara Differential Revision: D16689606 fbshipit-source-id: 2583c73c5ac06ea0fa8666d219e739e68fc75b12 * DrawerLayoutAndroid drawerPosition now expects a string, number is deprecated Summary: The native change to support strings was made in D15912607 on June 21st. Migrating the JS callsites now to start passing strings instead of the constants. Reviewed By: zackargyle, mdvacca Differential Revision: D16703569 fbshipit-source-id: cb1d8698df55d2961cde1e2b1fbfcba086a03bb2 * Introduce NativeBugReporting Summary: This diff introduces `NativeBugReporting` and eliminates all uses of `NativeModules.BugReporting` from our codebase. Reviewed By: ejanzer Differential Revision: D16717540 fbshipit-source-id: 67b8620ba9dd4b41557ae042c30bdc521e927d30 * Introduce NativeFrameRateLogger Summary: This diff introduces `NativeFrameRateLogger` and eliminates all usages of `NativeModules.FrameRateLogger` from our codebase. Reviewed By: ejanzer Differential Revision: D16718105 fbshipit-source-id: caf903162bab978ee1b3faef56aedef6ada75b89 * Fix forceUpdate method on useWindowDimensions (#25990) Summary: useState won't trigger re-renders if the value passed is the same. ## Changelog [Internal] [Fixed] - Fix forceUpdate method on useWindowDimensions Pull Request resolved: https://github.com/facebook/react-native/pull/25990 Test Plan: Codesandbox: https://codesandbox.io/embed/elegant-cori-0ixbx Differential Revision: D16723962 Pulled By: sahrens fbshipit-source-id: 8a46152908a90553151e0353bbfd8c2e64cfd2af * Update regex used to check for codegenNativeComponent Summary: Updates regex to allow for type casts Reviewed By: TheSavior Differential Revision: D16717249 fbshipit-source-id: f22561d5cd33ab129fc0af4490692344726d7d71 * Use eslint-plugin-prettier recommended config (#25674) Summary: I created a new test project today using RN 0.60.3 and saw that prettier is now used with eslint. After looking at the `react-native-community` eslint config, I notice that it wasn't using the [recommended configuration](https://github.com/prettier/eslint-plugin-prettier#recommended-configuration) of `eslint-plugin-prettier` This PR adds the `eslint-config-prettier` to avoid conflicts between eslint and prettier, it also adds the `prettier/react` config to avoid problems with the `eslint-plugin-react`. ## Changelog [General] [Changed] - Use eslint-plugin-prettier recommended config Pull Request resolved: https://github.com/facebook/react-native/pull/25674 Test Plan: - ✅ Ensure there is no difference on this repo (no ESLint errors, same number of warnings, and no changes when running prettier). Differential Revision: D16666178 Pulled By: cpojer fbshipit-source-id: 70f81db793866acc88388b7b00a496aab5e0b156 * Codemod fbandroid// => //fbandroid/ in xplat/js/ Reviewed By: zertosh Differential Revision: D16710441 fbshipit-source-id: 610e0330c486e716a61b31a8198c05aa50a261cf * Manual fixes for xplat/js/react-native-github Summary: Need to add explicit type annotations in these areas to unblock types-first architecture for Flow. These are locations the codemod could not automatically handle. I'll call out areas I need a close eye on in the comments. Reviewed By: panagosg7 Differential Revision: D16659053 fbshipit-source-id: 167dd2abe093019b128676426374c1c62cf71e7f * xplat/js/react-native-github Reviewed By: panagosg7 Differential Revision: D16657770 fbshipit-source-id: 4e260842c838a35317515044c54ccf55a083da33 * Remove usage of NativeModules.AccessibilityManager Summary: We introduced NativeAccessibilityManager a while back. This diff makes sure that there are no usages of NativeModules.AccessibilityManager in our codebase. Reviewed By: ejanzer Differential Revision: D16714424 fbshipit-source-id: edebf0f7a0fab615aa1722406f9d538696bd65a0 * React sync for revisions 55bc393...85d05b3 Summary: This sync includes the following changes: - **[85d05b3a4](https://github.com/facebook/react/commit/85d05b3a4 )**: Bump package.json versions //<Andrew Clark>// - **[d9fdec6cf](https://github.com/facebook/react/commit/d9fdec6cf )**: [Flare] Remove contextmenu logic from Press (#16322) //<Dominic Gannaway>// - **[12be8938a](https://github.com/facebook/react/commit/12be8938a )**: [Fresh] Support multiple renderers at the same time (#16302) //<Dan Abramov>// - **[6f3c8332d](https://github.com/facebook/react/commit/6f3c8332d )**: Reset hydration state after reentering (#16306) //<Sebastian Markbåge>// - **[028c07f89](https://github.com/facebook/react/commit/028c07f89 )**: Ensure Fundamental flags are added to more locations (#16311) //<Dominic Gannaway>// - **[9dfe973b5](https://github.com/facebook/react/commit/9dfe973b5 )**: Nit: fix inconsistent spacing in a warning (#16310) //<Dan Abramov>// - **[c4f0b9370](https://github.com/facebook/react/commit/c4f0b9370 )**: Warn when Using String Refs (#16217) //<lunaruan>// - **[7c838a645](https://github.com/facebook/react/commit/7c838a645 )**: [Flare] Adds support for hydrating host components with listeners (#16304) //<Dominic Gannaway>// - **[ed4970079](https://github.com/facebook/react/commit/ed4970079 )**: [react-events] Separate the Focus/FocusWithin unit tests (#16298) //<Nicolas Gallagher>// - **[23405c9c4](https://github.com/facebook/react/commit/23405c9c4 )**: [react-events] Add ContextMenu responder (#16296) //<Nicolas Gallagher>// - **[606f76b6e](https://github.com/facebook/react/commit/606f76b6e )**: Fix hydration bug with nested suspense boundaries (#16288) //<Sebastian Markbåge>// - **[a1dbb852c](https://github.com/facebook/react/commit/a1dbb852c )**: warn if you try to use act() in prod (#16282) //<Sunil Pai>// - **[dc232e677](https://github.com/facebook/react/commit/dc232e677 )**: chore: remove outdated comment about gcc (#16232) //<Ashwin Ramaswami>// - **[6b565ce73](https://github.com/facebook/react/commit/6b565ce73 )**: Rendering tasks should not jump the queue (#16284) //<Andrew Clark>// - **[c4c9f086e](https://github.com/facebook/react/commit/c4c9f086e )**: BugFix: Suspense priority warning firing when not supposed to (#16256) //<lunaruan>// - **[05dce7598](https://github.com/facebook/react/commit/05dce7598 )**: Fix priority of clean-up function on deletion (#16277) //<Andrew Clark>// - **[a53f5cc22](https://github.com/facebook/react/commit/a53f5cc22 )**: [SuspenseList] Bug fix: Reset renderState when bailing out (#16278) //<Sebastian Markbåge>// - **[0c1ec049f](https://github.com/facebook/react/commit/0c1ec049f )**: Add a feature flag to disable legacy context (#16269) //<Dan Abramov>// - **[42794557c](https://github.com/facebook/react/commit/42794557c )**: [Flare] Tweaks to Flare system design and API (#16264) //<Dominic Gannaway>// - **[b5af4fe3c](https://github.com/facebook/react/commit/b5af4fe3c )**: Remove FocusScope (#16267) //<Dominic Gannaway>// - **[375616788](https://github.com/facebook/react/commit/375616788 )**: Add missing check to unmocked Scheduler warning (#16261) //<Andrew Clark>// - **[f939df402](https://github.com/facebook/react/commit/f939df402 )**: [act] Wrap IsThisRendererActing in DEV check (#16259) //<Andrew Clark>// - **[f440bfd55](https://github.com/facebook/react/commit/f440bfd55 )**: Bugfix: Effects should never have higher than normal priority (#16257) //<Andrew Clark>// - **[db3ae32b8](https://github.com/facebook/react/commit/db3ae32b8 )**: flush fallbacks in tests (#16240) //<Sunil Pai>// - **[e6a0473c3](https://github.com/facebook/react/commit/e6a0473c3 )**: Warn when rendering tests in concurrent/batched mode without a mocked scheduler (#16207) //<Sunil Pai>// - **[e276a5e85](https://github.com/facebook/react/commit/e276a5e85 )**: [Flare] Remove delay props from Hover (#16248) //<Nicolas Gallagher>// - **[1912b4a0f](https://github.com/facebook/react/commit/1912b4a0f )**: [Flare] Remove delay props from Press (#16247) //<Nicolas Gallagher>// Changelog: [General][Changed] - React sync for revisions 55bc393...85d05b3 Reviewed By: zackargyle, rickhanlonii Differential Revision: D16720468 fbshipit-source-id: 1884ef67f404623697f516cd77ad952d1fbb4737 * @allow-large-files flow 0.105 xplat deploy Summary: bypass-lint allow_many_files Reviewed By: jbrown215 Differential Revision: D16753543 fbshipit-source-id: 1db37b56c1bb84b547e302dfe13ea0c9787deace * chore: Link to CLA wiki and CLA form. (#26016) Summary: After reading [Contributing Guidelines](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#contributing-code), I found myself googling "react native cla", and figured it makes sense to include a link to the CLA alongside the guidelines. ## Changelog [Internal] [Changed] - Link to CLA Pull Request resolved: https://github.com/facebook/react-native/pull/26016 Test Plan: N/A Differential Revision: D16761411 Pulled By: cpojer fbshipit-source-id: 49912c9e32464725d9970f1a7a8bc483ee9f68ce * Fix indentation in Gradle files (#26012) Summary: Fixes indentation in `*.gradle` files by using four-space indents [as specified in `.editorconfig`](https://github.com/facebook/react-native/blob/0ccedf3964b1ebff43e4631d1e60b3e733096e56/.editorconfig#L13-L14). ## Changelog [Internal] [Fixed] - Fix indentation in Gradle files Pull Request resolved: https://github.com/facebook/react-native/pull/26012 Test Plan: Considering [the diff consists of whitespace changes only](https://github.com/facebook/react-native/compare/master...sonicdoe:gradle-indentation?w=1), I think this is safe to merge if the test suite passes. Differential Revision: D16761514 Pulled By: cpojer fbshipit-source-id: 9b035b5c6b35a70b2b54fe35416840fb90a0c6b1 * improve VirtualizedList error message (#25973) Summary: Motivation: when you receive error like `scrollToIndex out of range: 5 vs -1` it's not immediately clear if I requested 5 or -1. This will make the error a little easier to understand. ## Changelog not needed Pull Request resolved: https://github.com/facebook/react-native/pull/25973 Test Plan: not needed, tests must pass Differential Revision: D16708522 Pulled By: osdnk fbshipit-source-id: 8dfcbd95ff0f42805dbe32cd57969a93aea55add * Use ViewManagerDelegate if provided instead of $$PropsSetter to update view props Summary: This diff introduces an interface `ViewManagerDelegate` and its base implementation `BaseViewManagerDelegate`, which is used as a parent class for all view manager delegates generated by the JS codegen. Before the changes in this diff, generated delegates didn't support setting the base view properties such as background color, rotation, opacity, etc. Now it's possible to do by using `BaseViewManagerDelegate.setProperty(...)`, and since all generated delegates extend BaseViewManagerDelegate, they can just call `super.setProperty(...)` for properties they don't want to handle. This diff also introduced a new method `ViewManager.getDelegate()`. This will allow view managers to return an instance of the delegate generated by JS and ensure that the view properties are set in a type-safe manner. If this method returns null (it does by default), we fall back to the default implementation of setting view properties using Java-generated `$$PropsSetter` classes. This is an example of an interface class generated by JS: ``` public interface RCTAxialGradientViewViewManagerInterface<T extends View> { void setColors(T view, Nullable ReadableArray value); void setLocations(T view, Nullable ReadableArray value); void setEndX(T view, Float value); void setEndY(T view, Float value); void setStartX(T view, Float value); void setStartY(T view, Float value); } ``` This is an example of a delegate class generated by JS: ``` public class RCTAxialGradientViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & RCTAxialGradientViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> { public RCTAxialGradientViewManagerDelegate(U viewManager) { super(viewManager); } Override public void setProperty(T view, String propName, Nullable Object value) { switch (propName) { case "colors": mViewManager.setColors(view, (ReadableArray) value); break; case "locations": mViewManager.setLocations(view, (ReadableArray) value); break; case "endX": mViewManager.setEndX(view, value == null ? Float.NaN : ((Double) value).floatValue()); break; case "endY": mViewManager.setEndY(view, value == null ? Float.NaN : ((Double) value).floatValue()); break; case "startX": mViewManager.setStartX(view, value == null ? Float.NaN : ((Double) value).floatValue()); break; case "startY": mViewManager.setStartY(view, value == null ? Float.NaN : ((Double) value).floatValue()); break; default: super.setProperty(view, propName, value); } } } ``` NOTE: What if a view manager, for instance ReactAxialGradientManager, wanted to add support for the borderRadius prop? In the old Java codegen, it would just need to create a method and annotate it with ReactProp (name = ViewProps.BORDER_RADIUS) and $$PropsSetter would call this method when a property with this name must be set. With the new JS codegen, borderRadius is a part of the basic view props, so setBorderRadius is not generated as a part of the ViewManagerInterface, so it’s not possible to set this value. I see two options: 1) add a method boolean setProperty (String propName, Object value) and let the view manager handle it in a non-type safe way (return true if it’s been handled). 2) Generate BaseViewManagerInterface which will include all basic view props and make BaseViewManager implement this interface, leaving all methods empty so that it stays compatible with the current implementation. Override these methods in a view manager that needs to handle a specific property in a custom way (so we would override setBorderRadius in ReactAxialGradientManager). Reviewed By: mdvacca Differential Revision: D16667686 fbshipit-source-id: 06a15a92f8af55640b7a53c5a34f40366d1be2a8 * Added jitpack repository to template (#25987) Summary: This PR will eliminate additional manual installation step for third-party RN libraries that include jitpack-published dependencies. ## Changelog [Android] [Added] - Added jitpack repository to template Pull Request resolved: https://github.com/facebook/react-native/pull/25987 Test Plan: No testing required. Differential Revision: D16763401 Pulled By: cpojer fbshipit-source-id: 72ff0146bd20c61a27b244f2dc7fea50781a4d1a * - Bump CLI to ^3.0.0-alpha.1 (#26028) Summary: Bumps the CLI to v3 alpha which includes Metro 0.56 ## Changelog [Internal] [Changed] - Bump CLI to ^3.0.0-alpha.1 Pull Request resolved: https://github.com/facebook/react-native/pull/26028 Test Plan: None Differential Revision: D16763732 Pulled By: cpojer fbshipit-source-id: 8f35fb80913f623cb44d37208f49040d4a33b07b * Fix handling of failed image downloads Summary: If you have following scenario 1. Have <Image> component with valid URL 2. Due to user action set <Image> to incorrect URL (something that 404s) Currently 1st image stay visible to the user. This is the case for both Fabric and Paper. Paper is being fixed -> https://github.com/facebook/react-native/pull/25919 Reviewed By: fkgozali Differential Revision: D16708532 fbshipit-source-id: ffdea5421faead4730e7b117a3b9f6e21869da70 * Fix crash during reload on Marketplace Home Summary: # What's the problem? `RCTSurfacePresenter._scheduler` is deallocated in `RCTSurfacePresenter.handleBridgeWillReloadNotification`. It shouldn't be used before `RCTSurfacePresenter.handleJavaScriptDidLoadNotification` is called because that's when new `RCTSurfacePresenter._batchedBridge` is created, scheduler depends on this new `RCTSurfacePresenter._batchedBridge`. But it is, it means that it is created with the old bridge, this means that it gets deallocated right away. First access point of old bridge is in `RCTSurfacePresenter.setMinimumSize`. # What's the fix? Make sure surface has correct stage before calling layout methods. The other idea was to return early in `RCTSurfacePresenter.setMinimumSize` in case bridge isn't setup. # Problems? 1. Following error still appears after reload {F176556210} 2. There is a white space for a while. By white space a mean the screen stays white for a short period of time before displaying content. Reviewed By: fkgozali, JoshuaGross Differential Revision: D16762443 fbshipit-source-id: 5a2a880b0f5345f268291c86811264f42f6058b3 * Add Object type to schema Summary: This diff adds ObjectTypeAnnotation to the codegen schema, throwing for the missing implementation sites added in the next diffs for easier review-ability. Also adds a schema fixture that is flow checked for review, but does not export it because the tests would fail Reviewed By: TheSavior Differential Revision: D16759109 fbshipit-source-id: 75c93623e8c1ae2003c7cc638e8e3447f0e7aa38 * Add object prop tests for unchanged fixtures Summary: This diff adds snapshot updates for the new object props test fixtures whose implementation does not need to change (e.g. event emitter files will not change when object props are implemented). This is for easier reviewability in later diffs. Notes that in the files that will change, we're temporarily filtering the OBJECT_PROPS test fixture Reviewed By: TheSavior Differential Revision: D16759124 fbshipit-source-id: 8aae063614f762c8bd7bf092b0d274804c38dd14 * Add view config support for Object props Summary: This diff adds handling for object prop types in the view config codegen Reviewed By: TheSavior Differential Revision: D16759136 fbshipit-source-id: ff4020f9cffe30f14a1356ac95afd7c9a1062c05 * Add Object props support for Java Summary: This diff adds Java handling for object props Reviewed By: TheSavior Differential Revision: D16759139 fbshipit-source-id: e47956dc43cd1eb4abd58636bf111dde8d7244cc * Move generateStructName to CppHelpers Summary: We'll need this helper in the prop files now so let's move it over to the generic cpp helpers Reviewed By: TheSavior Differential Revision: D16759164 fbshipit-source-id: 8765ffee3bd8219b5f0dc8677362ec45f0a8e2c5 * Add support for parsing object props Summary: This diff adds support to the flow parser to parse object props to the codegen schema This handles required and optional props, as well as required and optional object properties, WithDefault, enums, etc. Basically everything is supported that is supported at the top level Reviewed By: TheSavior, osdnk Differential Revision: D16759198 fbshipit-source-id: 6f501f4738f84f20a940235ba74f7bae93e64eef * Better error message for invalid type annotation Summary: Just a minor error message improvement Reviewed By: TheSavior, osdnk Differential Revision: D16759233 fbshipit-source-id: c53c54535eca683353085a8d2272c60596b52b54 * Add Flipper to React Native OSS by default Reviewed By: passy Differential Revision: D6723578 fbshipit-source-id: f34442689f99cd94220335a171010224a12132a8 * Improve ModuleRegistryBuilder assertion Summary: ModuleRegistryBuilder does as assertion to verify that all `cxxModules` are instances of `CxxModuleWrapperBase::javaStaticClass()`. This assertion is causing the crash in T48554656. Since we don't know which NativeModule is causing this problem, it's difficult to get to the bottom of this. So, for now, I'm improving the assertion message in the hopes that it helps us get to the bottom of this issue. Reviewed By: mdvacca Differential Revision: D16774711 fbshipit-source-id: 82318b8ff5ab735ae642da81777c1b5588e8a483 * Move HermesSamplingProfiler to OSS Reviewed By: willholen Differential Revision: D16069575 fbshipit-source-id: a67d19be8790a27e6b3fbd2da0d5c9fdd1e9d53a * Fix jest test crashes with animated components Summary: In the jest test renderer, host components have null refs by default. `createAnimatedComponent` tries to access the ref in componentDidMount, which then crashes. This is particularly problematic when trying to update test data: https://fb.workplace.com/groups/mpen00bs/permalink/494236684721027/?comment_id=510656413079054 Just checking for null fixes the issue and shouldn't affect anything else. Reviewed By: TheSavior, yungsters Differential Revision: D16777137 fbshipit-source-id: 0b9f7c5734c849f36318512ceffcc42dd44c58bb * Add RNTester and UITestBed as dev routes in main apps Summary: It's nice to have everything in one place, especially when touching native code where it's a pain to arc focus or buck build another target just to test some other JS. Reviewed By: yungsters Differential Revision: D14957052 fbshipit-source-id: fd3c388ab5b193b0fe9cebdc0c81ddbff9a714d4 * URL: Do not prepend baseUrl if the URL is not a relative URL (#26009) Summary: Fix for bug https://github.com/facebook/react-native/issues/26006 URL with base is always used, even when absolute URL is provided ## Changelog [Javascript] [Fixed] - `URL`: Base url value is ignored when the input url is not a relative url. Pull Request resolved: https://github.com/facebook/react-native/pull/26009 Test Plan: `new URL('http://github.com', 'http://google.com')` now returns `http://github.com/` Added a test case to `URL-test.js` to verify the same. Differential Revision: D16781921 Pulled By: cpojer fbshipit-source-id: 038aca3610e34f513f603e8993f9a925b7d28626 * Move TextInput PropTypes to Deprecated PropTypes (#26042) Summary: This pull request moves `TextInput`'s proptypes to `DeprecatedTextInputPropTypes`. This is in line with what is happening with other components. ## Changelog [General] [Deprecated] - Moved `TextInput`'s proptypes to `DeprecatedTextInputPropTypes` Pull Request resolved: https://github.com/facebook/react-native/pull/26042 Test Plan: Flow checks pass. Differential Revision: D16782322 Pulled By: cpojer fbshipit-source-id: c5f9caa402c0c5cd878e7fff502d380c7b468cbd * fix SectionList scrollToLocation and prevent regressions (#25997) Summary: Recently there were quite a few changes to this functionality, and they caused breakages https://github.com/facebook/react-native/issues/21577 https://github.com/facebook/react-native/issues/24034 https://github.com/facebook/react-native/issues/24734 https://github.com/facebook/react-native/issues/24735 Currently, whichever `viewOffset` I pass, it will be overridden (either by 0 or something computed in the if body). This fixes the issue and also adds tests to make sure there is no regression. ## Changelog [Javascript] [Fixed] - VirtualizedSectionList scrollToLocation viewOffset param ignored Pull Request resolved: https://github.com/facebook/react-native/pull/25997 Test Plan: tests pass Differential Revision: D16784036 Pulled By: cpojer fbshipit-source-id: 46421250993785176634b30a2629a6e12f0c2278 * Add reexport_all_header_dependencies to (yet more) misc rules Summary: Currently this is the default, but I plan to toggle the default to False shortly. False is better for build speed, as it forces you to separate deps and exported_deps. Reviewed By: williamtwilson Differential Revision: D16785991 fbshipit-source-id: 8cb73b87f1dfa50f21c0c12df1579054cdc99e6e * Commands: support Float arguments Summary: Support codegen'ing commands with Float arguments. Reviewed By: mdvacca Differential Revision: D16785534 fbshipit-source-id: 8174ae40762c1114b87a023cb2b69b2515dc6e23 * Use feature flag to enable view manager delegates for setting props Summary: This diff adds a feature flag which must be enabled if view managers should be allowed to use a delegate for setting their properties. Reviewed By: mdvacca Differential Revision: D16762876 fbshipit-source-id: ae3466d7f02ed02f203dbb79f5e0843e6d9fdd45 * fix display problems when image fails to load (#25969) Summary: This problem was also affecting Fabric and was fixed in D16708532. When the image resource is changed and the new image resource fails to load, we expect the display image to fail to load, but the image still shows the image that was successfully loaded last time. ## Changelog [iOS] [Fixed] - fix display problems when image fails to load Pull Request resolved: https://github.com/facebook/react-native/pull/25969 Test Plan: This is catalyst playground with following code P78264143. TLDR of the code, it sets URL <Image> that is 404. {F175486515} Reviewed By: makovkastar Differential Revision: D16783330 Pulled By: sammy-SC fbshipit-source-id: 1cb488590ce15d957357f32a73ebf8df6cccf4cd * Migrate RCTAxialGradientView to JS codegen Summary: This diff migrates `RCTAxialGradientView` to use generated `RCTAxialGradientViewManagerDelegate` for setting its props. The following base properties have been added to `BaseViewManager`: ``` protected void setBorderRadius(T view, float borderRadius) {} protected void setBorderBottomLeftRadius(T view, float borderRadius) {} protected void setBorderBottomRightRadius(T view, float borderRadius) {} protected void setBorderTopLeftRadius(T view, float borderRadius) {} protected void setBorderTopRightRadius(T view, float borderRadius) {} ``` Reviewed By: JoshuaGross, mdvacca Differential Revision: D16784173 fbshipit-source-id: f3971985efee2b6e0a5fb248b89c4809305e670c * hadle nullable params in generated objcpp Summary: Param of function can be optional and it should have impact on native code. Inspired by old codegen Reviewed By: RSNara Differential Revision: D16763884 fbshipit-source-id: dab50275f902dbe4af25824bb6128d3b37fc43cd * Remove multiple RTCConvert import Summary: RTCConvert was previously imported on each protocol. It was redundant. It's enough to import it once per file Reviewed By: RSNara Differential Revision: D16764834 fbshipit-source-id: 9e5dcd52e38dfefa675e3e2c9f2a8f414da1a02c * fix optional key in structs in new codegen Summary: Property should be marked as optional not only when value is optional, but also key. Reviewed By: RSNara Differential Revision: D16764332 fbshipit-source-id: d56944ef263da3aa1fce3482151c761574a83be6 * Change type of params in methods' protocols to nongeneric Summary: It was mistake which I fix here. Type of param in protocols should be generated struct. See generated struct in snap. It's exactly how it was in previous codegen Reviewed By: RSNara Differential Revision: D16770579 fbshipit-source-id: dac9c15c5d91a41ab2d06aea416f64bd7deb4476 * Fix name of key obtaining from dictionary in inline method in generated objcpp Summary: It was a mistake. We should obtain value by proper key always. Previously by a mistake I hardcoded 'a'. I wasn't break anything because it wasn't used in Internationalization. However, it was a bug Reviewed By: RSNara Differential Revision: D16782132 fbshipit-source-id: 59f7910f2be7753c07f16f00a201de856d57e29e * Add setMethodArgConversionSelector Summary: `setMethodArgConversionSelector` is method for provinding generated structs for methods' params. It was exactly how in old codegen. Reviewed By: RSNara Differential Revision: D16784403 fbshipit-source-id: d35bc8160be62385527299a6b8e68c1159002853 * Omit getConstants for codegening if object is empty Summary: Old codegen was omitting `getConstants` if it was empty. So do our. There's no point in providing this getter in this case. Reviewed By: RSNara Differential Revision: D16762230 fbshipit-source-id: 721df13a00848d23108329b152115c0f0aee8eb9 * Add documentation to TextInput's Flow types (#26054) Summary: The documentation from the Flow types' respective proptypes have been copied over to `TextInput`. ## Changelog [Internal] [Changed] - Added documentation to TextInput's Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/26054 Test Plan: `yarn flow-check-ios` and `yarn flow-check-android` both pass. Differential Revision: D16801435 Pulled By: TheSavior fbshipit-source-id: 7f3d75ba149259d5bbf719375320e2e325188826 * Delete ensureComponentIsNative.js Summary: This function was used by Touchable*. It was removed from the Touchables in D6494579 in 2017. The only remaining callsite was ImageBackground which is attaching a ref directly to the View so we know it is a native component. This is needed for some setNativeProps cleanup Reviewed By: sahrens Differential Revision: D16796973 fbshipit-source-id: 19379094b3b91920efac4bf1969fc22d4b80bcc6 * Use SoundManager in Pressability and Touchable Summary: This diff replaces the usage of UIManagerModule.playTouchSound() in Pressability and Touchable for the SoundManager.playTouchSound() Reviewed By: yungsters Differential Revision: D16543433 fbshipit-source-id: a2ba060bc480889c1e08c5c87086361e06974684 * Revert D16543433: [Fabric][JS] Use SoundManager in Pressability and Touchable Differential Revision: D16543433 Original commit changeset: a2ba060bc480 fbshipit-source-id: 0ba31019fb7a9e77577e495782a3b10029575d22 * Migrate RCTImage NativeModules to CoreModules Summary: This diff moves RCTImageLoader, RCTImageEditingManager, and RCTImageStoreManager to CoreModules. This is necessary for us to convert all these NativeModules to TurboModules. **Note:** As a part of this diff, I had to break apart `RCTImageLoader.h`. All the protocols that were in `RCTImageLoader` are now in their own headers. Furthermore, `RCTImageLoader`'s methods are defined in `RCTImageLoaderProtocol`, so that we can call them from classes like `RCTImageViewManager` in `RCTImage`. Reviewed By: PeteTheHeat Differential Revision: D16805827 fbshipit-source-id: 89f6728b0766c30b74e25f7af1be8e6b8a7e6397 * Add support for `Double` prop type Summary: Support a prop-type `Double`, in addition to `Float`, for flow typing and codegen of components. Reviewed By: TheSavior Differential Revision: D16812812 fbshipit-source-id: b5588b3218636283a4e9c5d17212dd0b92986eb9 * Support spreading locally defined types Summary: We want to be able to spread types that are defined in the same file. Reviewed By: JoshuaGross Differential Revision: D16812171 fbshipit-source-id: 7cda9869ea25f0357b3f8a3b28443407b219f04b * Support spreading locally defined types deeply Summary: We want to be able to spread props at any level, not just the top level Reviewed By: JoshuaGross Differential Revision: D16812884 fbshipit-source-id: 2e710141f833a7cc7ea25a91a1523a5c43b4e02c * Support deeply nested spreads Summary: Apparently I missed one more edge case. Thanks Josh for flagging! Reviewed By: JoshuaGross Differential Revision: D16813354 fbshipit-source-id: 6b59bc7b18184e3aa437c3b038ffd22b0fc0ba6a * Add failure tests for duplicate props with the same name Summary: There are a couple of cases where props can conflict which would cause undefined behavior. We'll throw to protect against that. Now that we support type spread this is more possible without someone realizing. Reviewed By: JoshuaGross Differential Revision: D16813884 fbshipit-source-id: 1a8fce365ab315198abdff0de6006cfe34e84fb9 * Deprecate Text proptypes (#26055) Summary: This pull request moves `Text`'s prop types to the `DeprecatedPropTypes` folder. This was already partly in progress - there were redundant `TextPropTypes` and `DeprecatedTextPropTypes` files so I removed one, and made sure the version with the doc strings was the one used. ## Changelog [General] [Deprecated] - Move `Text` component's proptypes to DeprecatedPropTypes Pull Request resolved: https://github.com/facebook/react-native/pull/26055 Test Plan: Flow checks pass for iOS and Android Differential Revision: D16801078 Pulled By: TheSavior fbshipit-source-id: ef19300945d48d0a4a83d728ee32cdf7d1c0f0cc * add the jni initializer to the build for sampling profiler Summary: The OnLoad.cpp file is needed since it actually registers the jni functions, it wasn't included in the build so it wasn't working correctly. Reviewed By: jbower-fb Differential Revision: D16826230 fbshipit-source-id: 0243e456c4015879d17650737a6a27a58a3d0d9a * Generate super call to BaseViewManagerDelegate if delegate has no props Summary: This diff adds a super call to `BaseViewManagerDelegate` if the current delegate doesn't have any props. We still want to set base view props, so we need `BaseViewManagerDelegate` to take care of this. Reviewed By: rickhanlonii Differential Revision: D16806648 fbshipit-source-id: 61963f2211cc7b2e7f5822c48bb0a7f50d909221 * Remove vendored proguard annotation (#26069) Summary: There have been multiple complaints about combining RN with various other FB libraries, including Litho and Flipper, because of bundled dependencies that can't be deduplicated by Gradle. This is one of three current conflicts: 1) Proguard annotations (this PR) 2) Yoga 3) fbjni While the Yoga group name doesn't make a massive amount of sense it was the easiest existing package to use and since we don't have a better namespace for this, we might as well use this. A similar change to Litho is landing right now. ## Changelog [Android] [Changed] - Use centralized package for DoNotStrip annotation Pull Request resolved: https://github.com/facebook/react-native/pull/26069 Test Plan: ``` yarn ./gradlew :RNTester:android:app:assembleDebug ``` Reviewed By: cpojer Differential Revision: D16827430 Pulled By: passy fbshipit-source-id: 87542b5422fee598d8e635651441f0ecd42eb9d7 * Add Object props support for cxx Summary: Adds ability to codegen object props to cxx by generating the cxx structs and conversion functions | Reviewed By: JoshuaGross Differential Revision: D16759170 fbshipit-source-id: 7437421e59f4be42fbcd4cddc2e0ed513ae71d08 * Add e2e test for object props Summary: Adds e2e tests for cxx and java object props Reviewed By: JoshuaGross Differential Revision: D16759242 fbshipit-source-id: 2307dc4b3ba26222de510cf5876c582d35fc665c * Add array<object> props to schema Summary: Adds arrays of objects to the codegen schema Reviewed By: motiz88 Differential Revision: D16814117 fbshipit-source-id: 10b20446f7aac5dccc3d2cb148891a134d136d3f * Generate array<object> props Summary: Adds the cxx generators for arrays of object props Reviewed By: JoshuaGross, TheSavior Differential Revision: D16814136 fbshipit-source-id: fa4600f60c063bfb460033f5fde43e26c04b5a3b * Parse $ReadOnlyArray<$ReadOnly{}> props Summary: Add flow type parsing for `$ReadOnlyArray<$ReadOnly<{}>>` Reviewed By: TheSavior Differential Revision: D16814261 fbshipit-source-id: 9442916f5d31f6d27f560332aee311b3ad8f0864 * Add e2e tests for array object props Summary: Adds e2e tests for the array of object prop types in the codegen Reviewed By: rubennorte, motiz88 Differential Revision: D16814301 fbshipit-source-id: 613f32a888451c0c1b7359133b7bf88878e36916 * Add error message for paring unnamed params Summary: We're currently not supporting this kind of params ``` +sample(string):void ```` and here's special exception for it. Reviewed By: RSNara Differential Revision: D16708583 fbshipit-source-id: 809f9808b77108857c8363536b896089e9cb957f * Split buck rules for component and modules Summary: Split buck rules for component and modules for our further convenience Reviewed By: rickhanlonii Differential Revision: D16803703 fbshipit-source-id: c01fb97875b43be4020edd054cad538ec8ed6861 * Support Double in when generating props for .h files, in parsing component props, and for commands and events Summary: I realized my previous diff was incomplete. Adding parsing and generation code for Double for props, commands, and events. Reviewed By: rickhanlonii Differential Revision: D16823540 fbshipit-source-id: fbed9897bb84b789c502cf4153e81060590152b8 * Add support for spread with ReadOnlyArray Summary: The new support for ReadOnlyArray needs to call this new function for spreads too. Reviewed By: JoshuaGross Differential Revision: D16823796 fbshipit-source-id: 9de94b41cdead7ce5238c77a9e39b5daf760dfe2 * Convert RCTImageLoader to TurboModules [4/N] Summary: This diff adds a JS spec for RCTImageLoader, and conforms to it in ObjC++. Since RCTImageLoader isn't called from JS, the js spec is empty. Since `/CoreModules/` is the only dir in OSS which supports TM, move the ObjC++ impl there. The change in `NativeExceptionsManager.js` fixes a weird bug I was hitting in codegen, where the codegen cpp file wouldn't compile due to unused variable. Reviewed By: JoshuaGross Differential Revision: D16495674 fbshipit-source-id: 191897b87730a6b0b96022eedc6412551fae04a6 * Pass RCTImageLoader into RCTSurfacePresenter [5/N] Summary: Instead of grabbing `imageManager` from the bridge, pass it from above. Right now, still use bridge to pass from above, but this gives us flexibility to not use bridge in the future. Reviewed By: shergin Differential Revision: D16504270 fbshipit-source-id: 7977a7957b659375f8348d26cd57b648e9d5959f * Pass RuntimeExecutor into RCTSurfacePresenter Summary: Instead of getting `RuntimeExecutor` from the bridge, pass it from above. Right now pass through `null`, but eventually this will work :) Reviewed By: RSNara Differential Revision: D16626288 fbshipit-source-id: bce527f85c0a79cfe6cf240a3633bbbe357f75c4 * Fix BUCK-related React Native CI failures Reviewed By: cpojer Differential Revision: D16812633 fbshipit-source-id: 50de7603fbb514ff1c3bb6c5fa6afd579d8a20b8 * Move RCTExceptionsManager to CoreModules and make it conform to spec Summary: `NativeExceptionsManager.js` contains the JS spec for this native module. This diff moves the objc code to CoreModules (since it's the only directory that supports TM at the moment) and makes it conform to the spec. NOTE: I will update podfiles after this diff is reviewed, before I land. Adding those generated changes makes it really hard to review. Reviewed By: RSNara Differential Revision: D16812212 fbshipit-source-id: 38b6e9a20ce15e7e9995df34493b37ed7adb2911 * Bump test version for cache issues * Tweak script to work with no global CLI * Revert "Remove vendored proguard annotation (#26069)" This reverts commit 35fc0add2d3a278bf90257284fe23e03898008de. * Revert "Remove 's.static_framework = true' requirement for podspec (#25816)" This reverts commit ca9e108110e4a3cc39044805f879d9a9cb637c41. * [0.61.0-rc.0] Bump version numbers * Revert "[0.61.0-rc.0] Bump version numbers" This reverts commit 9296ab1a615f0eb322e22cb85a61aa5b5acdb76e. * [0.61.0-rc.0] Bump version numbers * Revert "[0.61.0-rc.0] Bump version numbers" This reverts commit 2575eb318f01c8d1e680e3e3aaf07c14e159daaf. * Add RCTWeakProxy to properly deallocate RCTUIImageViewAnimated Summary: @public CADisplayLink strongly holds onto its target, so you have to use a weak proxy object to pass the target into the CADisplayLink. Previously we passed a weak-self point (i.e. weakSelf) but this did not have the intended effect, since the pointer to self would still be passed to CADisplayLink, and thus it would hold onto the RCTUIImageViewAnimated strongly. So is weakSelf doing anything other than using self? It is but it's very minor and not useful. In the case that the object got de-allocated between assigning self to weakSelf and creating the CADisplayLink, then we would pass a nil target. This is actually impossible though because we are running an instance method, so self is implicitly retained! So semantically it is something different but in practice it is the same as passing self through. Notes: * This system was added originally in https://github.com/facebook/react-native/pull/24822 * https://github.com/facebook/react-native/pull/25636 then "enabled" this system by deprecating existing approach Reviewed By: fkgozali Differential Revision: D16939869 fbshipit-source-id: 7a0e947896f23aa30ad074d1dcb4d4db7543e00a * Remove RCTUIImageViewAnimated WeakProxy gating Summary: To help determine how severe this issue is, put the fix behind a MC. We will only pick the parent diff to the RC branch so that the fix immediately goes to master and we don't have to worry about fixing this any further. Reviewed By: fkgozali Differential Revision: D16940181 fbshipit-source-id: 91eb08181f82f51aea6a20b3fd489a33bdc0e424 * [0.61.0-rc.0] Bump version numbers * Revert "[0.61.0-rc.0] Bump version numbers" This reverts commit bc28eee87f777b19106d4df7f2ac775cb357a12b. * Update CircleCI config as per support request * [0.61.0-rc.0] Bump version numbers * Memory Leak due to JSStringRelease not called in multiple places in JSCRuntime.cpp (#25884) Summary: Memory Leak due to JSStringRelease not called in multiple places in JSCRuntime.cpp Issue: https://github.com/facebook/react-native/issues/25664 Reproducible repo: https://github.com/bhandarijiwan/memory_issue_repro ## Changelog [JSC] [JSCRuntime.cpp] - Added missing JSStringRelease calls in missing places Pull Request resolved: https://github.com/facebook/react-native/pull/25884 Test Plan: Tested that is no memory leak with various NativeModule to JS call flows Reviewed By: JoshuaGross Differential Revision: D16928985 Pulled By: TheSavior fbshipit-source-id: 65ce15ae32482d0db39bad7e22a2fed9ee04f230 * Fix Redbox on iOS Summary: Looks like we broke iOS redbox in D16812212. It stopped showing up because the feature detection stopped working, and we started calling noops. The fix is an explicit platform check. Fixes #26260 Reviewed By: motiz88 Differential Revision: D17139310 fbshipit-source-id: 829eec23cbb49151ac250889c34ab28d36b05e6a * Partial RN sync Summary: This cherry-picks one commit: https://github.com/facebook/react/commit/01fb68b9bf680ab8bbf96e86501e0fc540b3cc97 It fixes a bug in Fast Refresh. Reviewed By: threepointone Differential Revision: D17140543 fbshipit-source-id: a7654152d1cc7c27e7c4024380349b44ac496b22 * Change podspec name of yoga to Yoga Summary: Needed to capitalize the name, since this is the convention used elsewhere too [iOS] [Changed] - Renamed yoga podspec to Yoga Reviewed By: shergin Differential Revision: D17127104 fbshipit-source-id: 14047bf452edda000037701f4ba7f4a02a0e717b * Update the version of yoga podspec to match the actual version of Yoga published Summary: Yoga is currently published in cocoapods. While we don't use the Yoga from Cocoapods in React Native, we should atleast try to follow that version, so that other integrations with Yoga are possible Reviewed By: shergin Differential Revision: D17127625 fbshipit-source-id: bca2e1e33ad775e2a0d7a6f1e4177c3b480c023a * Sync Podfile * Update release script * [0.61.0-rc.2] Bump version numbers * TM iOS: Disable in test environment Summary: For now, disable TM completely in test environment, like RNTester integration/unit tests. See details in T53341772 This also fixes the failure discussed in https://github.com/facebook/react-native/pull/26151 Reviewed By: PeteTheHeat Differential Revision: D17147915 fbshipit-source-id: 1c48ebb9c3b81fc08bc33606dcc38c29297d6010 * Revert "Revert "Remove 's.static_framework = true' requirement for podspec (#25816)"" This reverts commit 612c033918e6f61713966a24fa024048fc520fca. * Add missing dependencies to React-CoreModules.podspec * Fix incorrect `module.name_mapper` in template .flowconfig (#26330) Summary: Has explained in https://github.com/facebook/react-native/issues/26233, current template is incorrect & can create error, like having require() of png that are considered as `string` instead of `number. This can probably hide tons of similar mistakes. The change in this PR should resolve the previous behavior (& for example, some places in previous version of the flowconfig have the full path like here https://github.com/facebook/react-native/blob/35300147ca66677f42e8544264be72ac0e9d1b45/template/_flowconfig#L61) Closes https://github.com/facebook/react-native/issues/26233 ## Changelog ``` [General] [Fixed] Fix incorrect `module.name_mapper` in template .flowconfig ``` Alternatively, message could be ``` [General] [Internal] Fix incorrect `module.name_mapper` in template .flowconfig ``` As it hasn't this "bug" hasn't been released in a public stable release. You decide Pull Request resolved: https://github.com/facebook/react-native/pull/26330 Test Plan: I just tested this in my project, thymikee might be able to confirm & approve this PR. Differential Revision: D17258891 Pulled By: cpojer fbshipit-source-id: 3904ffbc6f076ee0e435311249d694b8604fc7b8 * Rename Yoga * [0.61.0-rc.3] Bump version numbers * Fixing Yoga imports and includes on case-sensitive machines (#26416) Summary: In addition of the issue resolved by https://github.com/facebook/react-native/pull/26360 (already merged), machines with case-sensitive disks are still not able to build a project on Xcode due not found `<yoga/...` imports: ``` 'yoga/Yoga.h' file not found ``` ![Screen Shot 2019-09-12 at 11 15 54](https://user-images.githubusercontent.com/1728387/64791885-c58c9180-d54e-11e9-95cb-40befaab7acc.png) ## Changelog [iOS] [Fixed] - Fix Yoga imports and includes Pull Request resolved: https://github.com/facebook/react-native/pull/26416 Test Plan: `Build` command on Xcode now runs successfully in a Mac with disk in case-sensitive mode Differential Revision: D17370392 Pulled By: PeteTheHeat fbshipit-source-id: 2a225f47046113267adb154a4c6a9ef4664a12c3 * Fix build break in MSVC (#26462) Summary: Merging react-native-windows to 0.60 - the visual studio compiler seems to take issue with the existing code ## Changelog [Internal] [Fixed] - Build fix for react-native-windows (MSVC) Pull Request resolved: https://github.com/facebook/react-native/pull/26462 Test Plan: No real change, just making compilers happy. ### Side Note We'll want this change cherry-pickered to RN 0.60 and RN 0.61 so users of react-native-windows dont have to use our fork of react-native. Reviewed By: mhorowitz Differential Revision: D17406081 Pulled By: TheSavior fbshipit-source-id: bc056e1a545c6478fdcbd5645f3a8dea657162c8 * Revert "Fix onDismiss in Modal" This reverts commit bd2b7d6c0366b5f19de56b71cb706a0af4b0be43. * Bump hermes to v0.2.1 (#26451) Summary: Bump hermes to v0.2.1 allow-large-files ## Changelog See https://github.com/facebook/hermes/releases/tag/v0.2.1 [Android] [Changed] - Bump hermes to v0.2.1 Pull Request resolved: https://github.com/facebook/react-native/pull/26451 Test Plan: RNTester builds and runs as expected Differential Revision: D17394921 Pulled By: cpojer fbshipit-source-id: 07ce5da3517b7aa24bfb5e1f6eefed6cdc9f5cb5 * React Partial Sync Summary: Base: 85d05b3a4d439c504ee43652d586ee253a01faf6 Author: Dan Abramov <dan.abramov@gmail.com> Date: Wed Sep 18 16:32:11 2019 +0100 [Fresh] Always remount classes (#16823) commit acfdc9760b4dc55d192b08de42b2c45e5e5bb531 Author: Ricky <rickhanlonii@gmail.com> Date: Wed Sep 18 15:31:00 2019 +0100 [React Native] Fix for view config registrations (#16821) commit dbe593d96c35b33fcc1f1bec70af86c24779392b Author: Dominic Gannaway <trueadm@users.noreply.github.com> Date: Wed Sep 18 14:18:32 2019 +0200 [react-core] Do not null fiber.sibling in detachFiber (#16820) commit 30fa2f5ea3313b4b7932783d8ac71b5d59b8a8c7 Author: Dominic Gannaway <trueadm@users.noreply.github.com> Date: Tue Sep 17 17:30:22 2019 +0200 [react-core] Clear more properties in detachFiber (#16807) commit ea374e751b164ed029b35063b84c825305024a0a Author: Dan Abramov <dan.abramov@gmail.com> Date: Wed Aug 28 16:55:56 2019 +0100 Don't ignore dependencies for render phase update (#16574) Reviewed By: gaearon Differential Revision: D17456249 fbshipit-source-id: 87bad63fed4a571f65592ee904606828e3aa39af * bump android gradle plugin to 3.5.0 (#26129) Summary: Android Gradle Plugin 3.5.0 released with a lot of improvements and bug fixes. It's important to have this change merged before 0.61 release. See https://developer.android.com/studio/releases/gradle-plugin ## Changelog [Android] [Changed] - bump android gradle plugin to 3.5.0 Pull Request resolved: https://github.com/facebook/react-native/pull/26129 Test Plan: RNTester builds and runs as expected Reviewed By: mdvacca Differential Revision: D17091520 Pulled By: osdnk fbshipit-source-id: 232b9209526e62a7344d74422fd8471a03dec7f4 * Update Gradle wrapper to 5.6 (#26079) Summary: ``` Welcome to Gradle 5.6! Here are the highlights of this release: - Incremental Groovy compilation - Groovy compile avoidance - Test fixtures for Java projects - Manage plugin versions via settings script For more details see https://docs.gradle.org/5.6/release-notes.html ``` ## Changelog [Android] [Changed] - Gradle wrapper 5.6 Pull Request resolved: https://github.com/facebook/react-native/pull/26079 Test Plan: Ran build and tests locally. Differential Revision: D17054310 Pulled By: mdvacca fbshipit-source-id: de7ba3a6d04058e51b8bc6a21d5a3f828ef8bc25 * Revert "bump android gradle plugin to 3.5.0 (#26129)" This reverts commit 8d4e8a377528895c5ea3928e9c209eafa467f46b. * Revert "Update Gradle wrapper to 5.6 (#26079)" This reverts commit afd35296f2bd0a04e3406c03ff9c023e7192161f. * [0.61.0] Bump version numbers * Allow again for injecting custom root view via ReactActivityDelegate (#26495) Summary: This change restores the possibility of injecting custom root views via ReactAcitivtyDelegate. It has been used by react-native-gesture-handler library in order to replace default root view with a one that'd route touch events to gesture-handler internal pipeline. The regression happened in d0792d4b8ac42711dfd9fccb782f16e72ce3e335 where new `ReactDelegate` was introduced to provide support for rendering react native views in both Android fragments and activities. As a part of that change the logic responsible for creating root view has been moved from `ReactActivityDelegate` to `ReactDelegate` rendering `ReactActivityDelegate.createRootView` unused – that is there is no code path that leads to this method being called. Instead `ReactDelegate.createRootView` method has been added which now plays the same role. The custom root view injection was relying on overwriting that method and hence the method is no longer referenced overwriting it has no effect. Following the logic migration out of `ReactActivityDelegate` into `ReactDelegate` we could potentially now start overwriting methods of `ReactDelegate`. However when working with Android's activities in React Native we can only provide an instance of `ReactActivityDelegate` and in my opinion it does not make too much sense to expose also a way to provide own instance of `ReactDelegate`. The proposed fix was to route `ReactDelegate.createRootView` to call `ReactActivityDelegate.createRootView` and this way regaining control over root view creation to `ReactActivityDelgate`. The change of the behavior has been implemented by subclassing `ReactDelegate` directly from `ReactActivityDelegate` and hooking the aforementioned methods together. Thanks to this approach, the change has no effect on `ReactDelegate` being used directly from fragments or in other scenarios where it is not being instantiated from `ReactActivityDelegate`. This fixes an issue reported in https://github.com/kmagiera/react-native-gesture-handler/issues/745 and discussed on 0.61 release thread: https://github.com/react-native-community/releases/issues/140#issuecomment-532235945 ## Changelog [Internal] [Fixed] - Allow for custom root view to be injected via ReactActivityDelegate Pull Request resolved: https://github.com/facebook/react-native/pull/26495 Test Plan: 1. Run RNTester, take layout snapshot, see the react root view being on the top of view hierarchy. 2. Run gesture-handler Example app (or some other app that overwrites ReactActivityDelegate.createRootView method), on layout snapshot see custom root view being used. Differential Revision: D17482966 Pulled By: mdvacca fbshipit-source-id: 866f551b8b077bafe1eb9e34e5dccb1240fa935e * Fix ShareSheet crash on iOS 13 (#26429) Summary: Currently on iOS 13 the app will crash if you: - Open the share sheet - Tap something like messages or photos - Cancel the dialog - Perform any other action This is because `shareController.completionWithItemsHandler` is called when the dialog box is canceled and currently `failureCallback` or `successCallback` will always be called. In the situation above, `activityError` is `nil` so `successCallback` will be called even though `completed` is false. This leaves us in a state where the callback has been invoked but the ShareSheet is still active, meaning the success or error callback will be invoked again, leading to the crash. This PR adds a check to make sure `completed` is true before calling `successCallback`. This way `successCallback` will only be called when the user has successfully completed an action and the ShareSheet is closed. ## Changelog [iOS] [Fixed] - Fix crash in RCTActionSheetManager.m on iOS 13 Pull Request resolved: https://github.com/facebook/react-native/pull/26429 Test Plan: - Saved an image successfully - Opened and dismissed the `Photos` dialog multiple times without crashing Differential Revision: D17369712 Pulled By: PeteTheHeat fbshipit-source-id: 228b696243cd39fad1fa134f4412d95d845b1bc5 * [0.61.1] Bump version numbers * Revert "[0.61.1] Bump version numbers" This reverts commit 2577ca534008e362a977ce7c83eb4b51e14a0b52. * Revert "Add generated `xcshareddata` folder to gitignore (#25451)" This reverts commit d57cdac62b814d38d2d03cdbb1cb3da60a09c948. * [0.61.1] Bump version numbers * Bring back RNTester manual step * Removing the workspace (#26566) The workspace file is file to be added to git. Consider it as a lockfile for native ios :) * Revert "Set rounded rectangle mask on TouchableNativeFeedback's ripples (#25342)" This reverts commit 14b455f69a30d128db384749347f41b03b9a6000. * Include transform in OUTER_PROPS (#26611) Summary: Without `transform` in `OUTER_PROPS`, the refresh control component would not include `transform: {scaleY: -1}` in its style and so pulling down, rather than up, on a scroll view would trigger a refresh. Fixes https://github.com/facebook/react-native/issues/26181 ## Changelog [Android] [Fixed] - Fixed issue with refresh control not working properly on an inverted ScrollView Pull Request resolved: https://github.com/facebook/react-native/pull/26611 Test Plan: Updated unit test in splitLayoutProps-test.js. Differential Revision: D17661079 Pulled By: cpojer fbshipit-source-id: 747da27b11c3ca59b7f639f393ae5ac137f5490a * Use `warnOnce` for excessive number of callbacks error (#26508) Summary: I happened to hit this error a couple times and the issue is that if there are let's say 1000 pending callbacks the error would be triggered 500 times and pretty much crash the app. I think it is reasonable to use warn once here so it only happens once. ## Changelog [General] [Fixed] - Use `warnOnce` for excessive number of callbacks error Pull Request resolved: https://github.com/facebook/react-native/pull/26508 Test Plan: Tested by reducing the number of pending callbacks required to trigger the error. Reviewed By: TheSavior Differential Revision: D17512917 Pulled By: JoshuaGross fbshipit-source-id: 5ce8e2a0a166805cc6f3fe6d78e2716d6792a80e * improve error message in NativeModuleRegistryBuilder.java (#26467) Summary: ## Motivation I have seen a spike in users reporting this error. Unfortunately I did not receive any repros that would confirm this, but my hypothesis is that they ran into situation when `new XYZPackage()` was present in `getPackages()` method and then the CLI kicked in with autolinking and they were left with this incomplete error. someone more knowledgeable of autolinking should review this. Pull Request resolved: https://github.com/facebook/react-native/pull/26467 Differential Revision: D17661242 Pulled By: cpojer fbshipit-source-id: 63dfcd85a0d41d85a0dd52f84ab16cb7ceb64ba2 * iOS13 status bar has now 3 styles (#26294) Summary: iOS13 status bar has now 3 styles UIStatusBarStyleDefault, UIStatusBarStyleLightContent, UIStatusBarStyleDarkContent UIStatusBarStyleDefault now acts as an automatic style which will set it’s value dynamically based on the the userinterfacestyle(One of the traits) of the viewcontroller that controls the status bar appearance. ## Changelog [iOS] [Fixed] - iOS13 new status bar style UIStatusBarStyleDarkContent Pull Request resolved: https://github.com/facebook/react-native/pull/26294 Differential Revision: D17314054 Pulled By: cpojer fbshipit-source-id: ea109e729bb551dff314bc00a056860a8febb0e9 * [0.61.2] Bump version numbers * Release underlying resources when JS instance is GC'ed on Android try 2 (#26155) Summary: Reland https://github.com/facebook/react-native/pull/24767 The commit had to be reverted because it caused a crash when using remote debugging in chrome. This is normal since jsi is not available in that environment. The crash was caused by `jsContext.get()` being 0, then being dereferenced later in c++. We can simply skip initializing the blob collector in this case. This also includes the fix from https://github.com/facebook/react-native/issues/25720 to fix a crash when using hermes. ## Changelog [Android] [Fixed] - Release underlying resources when JS instance is GC'ed on Android Pull Request resolved: https://github.com/facebook/react-native/pull/26155 Test Plan: Test using RN tester with jsc and hermes Test remote debugging Reviewed By: mdvacca, fred2028 Differential Revision: D17072644 Pulled By: makovkastar fbshipit-source-id: 079d1d43501e854297fbbe586ba229920c892584 * Bump SoLoader to 0.8.0 (#26759) Summary: This PR bumps bumps Soloader to 0.8.0. This fixes white screen/ crash issues when downloading from Google Play. Related to: https://github.com/facebook/react-native/issues/25927 #26400 ## Changelog [Android] [Changed] - Bump Soloader to 0.8.0 Pull Request resolved: https://github.com/facebook/react-native/pull/26759 Test Plan: A few CI tests fail, but I don't see the link with what I changed, especially the ios tests. It's working locally though, and for people on github who tried this solution as well. Differential Revision: D17828891 Pulled By: mdvacca fbshipit-source-id: 1c7809aa681b41b8ed9a4da96d041d52f3cfbb76 * Revert "Bump SoLoader to 0.8.0 (#26759)" This reverts commit 66ae1caccd2c1142c519ce1913a6ac15d6f335fa. * Improve Flow Type for ScrollResponder Summary: FlatList and VirtualizedList were typing this value as any instead of using the actual type from ScrollView. I started with that change and then fixed the type to solve the other callsites in the codebase. Reviewed By: zackargyle Differential Revision: D17089934 fbshipit-source-id: bfc22cec9993904d779cad37b1de7cb3c0484d2c * Migrate scrollResponderScrollNativeHandleToKeyboard function to take nativeRef Summary: We need to get rid of findNodeHandle calls so migrating scrollResponderScrollNativeHandleToKeyboard to take a ref to a host component. I made this change with Flow, and tested by rendering UserJobApplicationForm Reviewed By: mdvacca Differential Revision: D17099280 fbshipit-source-id: 96af692006aace2c206f268f5416984b00f8a438 * Fix exception in scrollResponderScrollNativeHandleToKeyboard when ref is null Summary: We are seeing these errors in prod: ``` TypeError: Cannot read property '_nativeTag' of null at ReactNativeFiberHostComponent.prototype.measureLayout(ReactNativeRenderer-prod.fb.js:1594) ScrollResponderMixin.scrollResponderScrollNativeHandleToKeyboard(ScrollResponder.js:557) ``` This error is coming from these lines: https://github.com/facebook/react-native/blob/69c38e5a639f34620038ae5724426c92c355e509/Libraries/Components/ScrollResponder.js#L563-L567 Either `nodeHandle` is null or `this.getInnerViewRef()`. If `nodeHandle` was null, we'd get an error that we can't call `measureLayout` on null. So `this.getInnerViewRef()` must be null. In the React Native Renderer this error of `_nativeTag of null` is coming from this line: https://github.com/facebook/react/blob/db8afe4f6318dba422177a2054204ef089570ad8/packages/react-native-renderer/src/ReactNativeFiberHostComponent.js#L84 Which means indeed `this.getInnerViewRef()` is null. So adding a null check here which is what we do at all the other product callsites of `measureLayout`. Flow should have caught this, but because ScrollView is one of the only components left using mixins (ScrollResponder), `this.getInnerViewRef` is typed as `any` instead of what it should be: ``` ?React.ElementRef<Class<ReactNative.NativeComponent<mixed>>> ``` If `scrollResponder` was typed correctly then Flow would have caught this. Changelog: [Fixed] Exception in scrollResponderScrollNativeHandleToKeyboard when ref is null Reviewed By: mmmulani Differential Revision: D17717150 fbshipit-source-id: d7bc4c897ad259fb588e8100f37ccfb8a5d07874 * Fix bug where ScrollView contentInset top set to undefined wouldn't default to 0 Summary: If you passed ``` contentInset: { bottom: 10 } ``` then it wouldn't go into the if case and it could try to call `setOffset` with `undefined`. `setOffset` requires a number. Changelog: [Fix][ScrollView] ScrollView contentInset top now defaults to 0 in expected situations Reviewed By: JoshuaGross Differential Revision: D17796155 fbshipit-source-id: 951dbbb0de1052f64a6835963e8bbc564990c120 * Fix TimingAnimation rounding error issue (Take 2) Summary: This fixes a bug where the frames array can contain a duplicate entry at the end. For example, suppose the duration is 1000.0 then it would create an array with the following: ``` [ 0, 0.0010119824303159884, 0.00391003997863186, 0.00851330482578147, 0.01466951184383165, 0.022249135687575607, 0.03114100006836614, 0.041248932923769244, 0.05248918022066495, 0.06478838042267626, 0.07808196049642172, 0.09231285402599128, 0.1074304693764467, 0.12338985513375342, 0.14015102395653428, 0.15767840628626964, 0.17594041329987542, 0.1949090949486824, 0.21455988464815853, 0.23487142789035506, 0.25582549864491233, 0.27740701626433145, 0.2996041891505173, 0.3224088345090182, 0.34581696665965683, 0.36982983491413496, 0.394455794287552, 0.4197139228812336, 0.44564199741037275, 0.4723190090623474, 0.5000000572130084, 0.5276809909376533, 0.5543580025896278, 0.5802860771187669, 0.6055442057124484, 0.6301701650858652, 0.6541830333403433, 0.6775911654909819, 0.7003958108494828, 0.7225929837356684, 0.7441745013550876, 0.7651285721096447, 0.785440115351841, 0.8050909050513173, 0.8240595867001241, 0.84232159371373, 0.8598489760434653, 0.876610144866246, 0.8925695306235529, 0.9076871459740083, 0.9219180395035779, 0.9352116195773232, 0.9475108197793346, 0.9587510670762303, 0.9688589999316335, 0.9777508643124241, 0.9853304881561681, 0.9914866951742183, 0.996089960021368, 0.9989880175696839, 1, 1 ] ``` With this change, it now generates the following array: ``` [ 0, 0.0010119824303159884, 0.00391003997863186, 0.00851330482578147, 0.01466951184383165, 0.022249135687575607, 0.03114100006836614, 0.041248932923769244, 0.05248918022066495, 0.06478838042267626, 0.07808196049642172, 0.09231285402599128, 0.1074304693764467, 0.12338985513375342, 0.14015102395653428, 0.15767840628626964, 0.17594041329987542, 0.1949090949486824, 0.21455988464815853, 0.23487142789035506, 0.25582549864491233, 0.27740701626433145, 0.2996041891505173, 0.3224088345090182, 0.34581696665965683, 0.36982983491413496, 0.394455794287552, 0.4197139228812336, 0.44564199741037275, 0.4723190090623474, 0.5000000572130084, 0.5276809909376533, 0.5543580025896278, 0.5802860771187669, 0.6055442057124484, 0.6301701650858652, 0.6541830333403433, 0.6775911654909819, 0.7003958108494828, 0.7225929837356684, 0.7441745013550876, 0.7651285721096447, 0.785440115351841, 0.8050909050513173, 0.8240595867001241, 0.84232159371373, 0.8598489760434653, 0.876610144866246, 0.8925695306235529, 0.9076871459740083, 0.9219180395035779, 0.9352116195773232, 0.9475108197793346, 0.9587510670762303, 0.9688589999316335, 0.9777508643124241, 0.9853304881561681, 0.9914866951742183, 0.996089960021368, 0.9989880175696839, 1 ] ``` Note that the duplicate 1 at the end is now gone. This is because previously when it accumulated dt for 60 frames. dt wasn't quite exactly 1000, it was instead 999.9999999999999 and so didn't break out of the loop when it should have. This adds a tolerance so that it does break out of the loop. Reviewed By: dimach1977 Differential Revision: D17828204 fbshipit-source-id: 4483303de852071436cf9a82e50296baf3392329 * Fix ref type for Native Scroll View Summary: These types were wrong, this is a HostComponent, not a ReactNative.NativeComponent Reviewed By: lunaleaps Differential Revision: D17862305 fbshipit-source-id: e1e7acc7a5892f124b07cdc39d73d6ce7d414063 * Fix selecting videos from library in iOS 13 Summary: In iOS 13, Apple made a change that results in video URLs returned by UIImagePickerController becoming invalidated as soon as the info object from the delegate callback is released. This commit works around this issue by retaining these info objects by default and giving the application a way to release them once it is done processing the video. See also https://stackoverflow.com/questions/57798968/didfinishpickingmediawithinfo-returns-different-url-in-ios-13 Reviewed By: olegbl, mmmulani Differential Revision: D17845889 fbshipit-source-id: 12d0e496508dafa2581ef12730f7537ef98c60e2 * Fix bug in iOS13 nested text rendering Summary: This fixes a bug reported by Oculus and OSS. https://github.com/facebook/react-native/issues/26577 When rendering images nested in a `<Text/>` node, on the native side, `RCTTextShadowView` adds an empty NSTextAttachment to the attributed string to add some extra space. The image is then overlaid in the empty space . This all works fine and dandy on iOS12 and below. Starting in iOS13, an empty NSTextAttachment doesn't render as blank space. It renders as the "missing image" white page. When the real image is overlaid on the white page, it looks super broken. See github issue and test plan for examples. This fix is to assign an empty image to `NSTextAttachment`. I tried seeing if there was any other attribute we could use to just add white space to an attributed string, but this seems like the best one. Changelog: [iOS][Fixed] Fixed bug rendering nested text on iOS13 Reviewed By: xyin96 Differential Revision: D18048277 fbshipit-source-id: 711cee96934fc1937d694621a4417c152dde3a31 * Revert "Fix ref type for Native Scroll View" This reverts commit db662af5b28d0ad42abd1da67c32f2c38ff04900. * Invalidate cache * [0.61.3] Bump version numbers * Revert release and remove extraneous commits This reverts commit 7fa3eef2a11b094a59a43fb7db4ba5edb9ccdff5. * Revert "Fix exception in scrollResponderScrollNativeHandleToKeyboard when ref is null" This reverts commit 0da6a9bb45dc085db701de06ac354538e6814c64. * Revert "Migrate scrollResponderScrollNativeHandleToKeyboard function to take nativeRef" This reverts commit 09c4e7caf053d593d897f80ccd9df8f5bf96252b. * Revert "Improve Flow Type for ScrollResponder" This reverts commit 54bf3ae1cfaf49562d60ebf06386c157fc27131e. * [0.61.3] Bump version numbers * Bump react to 16.9.0 (#27060) * Bump react to 16.9.0 * Update package.json * might as well do everything * Update package.json * fix build with hermes on windows (#26556) Summary: On the Windows platform, with hermes-engine enabled, the assembly crashes with an error: ![image](https://user-images.githubusercontent.com/8634793/65568495-ab11d980-df8c-11e9-83a0-2a2d26447860.png) The problem lies in calling hermes command without the leading arguments `"cmd", "/c"` ([react.gradle, line: 152](https://github.com/facebook/react-native/blob/e028ac7af2d5b48860f01055f3bbacf91f6b6956/react.gradle#L152) ) ## Changelog [General] [Fixed] - Added a platform check and running commandLine with the corresponding arguments Pull Request resolved: https://github.com/facebook/react-native/pull/26556 Test Plan: Under Windows, enable hermes-engine in _build.gradle_ and run the `gradlew assembleRelease` or `gradlew bundleRelease` command Also check assembly on other available platforms Differential Revision: D17587023 Pulled By: cpojer fbshipit-source-id: bab10213b23fac5ab6a46ac4929759dcd43e39c2 * Don't wrap console methods for metro logging in Chrome debugger (#26883) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/26883 This diff fixes an issue reported in https://github.com/facebook/react-native/issues/26788 where logs in the Chrome console were showing a different location than previous versions. In the change here, we stop wrapping the console functions to attach the metro websocket in any environment that isn't a native app environment. We do this by checking `global.nativeLoggingHook` which is bound only by native apps and not environments like the Chrome DevTools. Changelog: [General][Fixed] - Fix wrong lines logging in Chrome debugger Reviewed By: cpojer, gaearon Differential Revision: D17951707 fbshipit-source-id: f045ea9abaa8aecc6afb8eca7db9842146a3d872 * Reverts "Timing: Fixes timer when app get into background (#24649)" (#27065) This reverts commit 338298417f8077dee177057c57b38671b4ec8c75 * [0.61.4] Bump version numbers * fix: Bundle assets in monorepo (#26940) Summary: In monorepo environment, `metro` isn't able to resolve `react-native` because the path to it is hardcoded. I've also added `packagingOptions` to RNTester to make Android builds work for me. Let me know if this is something that is only specific to my setup, and shouldn't be added. ## Changelog [Android] [Fixed] - Fix `bundleReleaseJsAndAssets` in monorepo env Pull Request resolved: https://github.com/facebook/react-native/pull/26940 Test Plan: - [x] - Works in monorepo setup on MacOS - [x] - Works with RNTester app Differential Revision: D18323703 Pulled By: cpojer fbshipit-source-id: b8eb15dfd8a32ae11fd862fc725af9cffea2cf96 * Fix multiple `set-cookie` not aggregated correctly in response headers (#27066) Summary: Multiple `set-cookie` headers should be aggregated as one `set-cookie` with values in a comma separated list. It is working as expected on iOS but not on Android. On Android, only the last one is preserved The problem arises because `NetworkingModule.translateHeaders()` uses `WritableNativeMap` as the translated headers but uses both native and non-native methods. The mixup causes out of sync data that both sets of methods do no agree. A simple fix is to use `Bundle` as the storage and only convert it to `WritableMap` at the end in one go Related issues: https://github.com/facebook/react-native/issues/26280, https://github.com/facebook/react-native/issues/21795, https://github.com/facebook/react-native/issues/23185 ## Changelog [Android] [Fixed] - Fix multiple headers of the same name (e.g. `set-cookie`) not aggregated correctly Pull Request resolved: https://github.com/facebook/react-native/pull/27066 Test Plan: A mock api, https://demo6524373.mockable.io/, will return 2 `set-cookie` as follows: ``` set-cookie: cookie1=value1 set-cookie: cookie2=value2 ``` Verify the following will print the `set-cookie` with a value `cookie1=value1, cookie2=value2` ```javascript fetch('https://demo6524373.mockable.io/') .then(response => { console.log(response.headers); }); ``` On iOS, `set-cookie` will have `cookie1=value1, cookie2=value2` while on Android it will have `cookie2=value2` (preserving only the last one) Differential Revision: D18298933 Pulled By: cpojer fbshipit-source-id: ce53cd41d7c6de0469700617900f30a7d0914c26 * - Bump CLI to ^3.0.0 (#27235) Summary: Upgrading CLI to latest. It's likely not yet compatible with master, because we depend on Metro 0.56, and master is on 0.57. This diff is intended to be cherry-picked to 0.61 and 0.62. cc grabbou ## Changelog [Internal] [Changed] - Bump CLI to ^3.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/27235 Test Plan: None Differential Revision: D18527709 Pulled By: cpojer fbshipit-source-id: 44448058c48a66d22a1d71abdc908f532f5aa547 * [0.61.5] Bump version numbers * Create and checkout branch for 0.61 merge: fb61merge * Fix up some basic merge issues with config files * Mostly fixing bad merges and podfile moves. Gets iOS building and some progress to getting macOS built * JS is not lint free. * iOS RNTester booting * Update test snapshot files * Get macOS building. Mostly image-related fixup with high probability of regression. Also take the opportunity to remove some stuff from RCTUIKit to help de-monolithize it * Fix iOS build breaks from last commit * Fix minor yarn lint issues to bring yarn lint parity with facebook's 0.61-stable branch * RNTester booting, but UIView is now being rejected because generated view config doesn't match native. * Fix a few yarn flow-check-ios issues * Make iOS flow clean * RNTester mac booting * Fix all yarn flow-check-macos issues * Add macOS equivalents for new iOS bundles * Make Android pass flow check * Fixed merge conflict errors, updated upstream diff comments. * Fixed more merge comments * Fixed PaperUIManager.js to add 'ios' || 'macos' case. Enabled building of RCTSurface for macos. * Fix macOS unit tests. * All macOS tests passing * Updated build scripts to build and test via Pods. * Fix lint and flow errors * Fix pod install * Change files * Fix build script to specify RNTesterPods.xcworkspace * Fix Release * Change files * Remove beachball change files. * Fix beachball to exclude internal packages * Fix react-native-macos-init * Fix react-native run-macos * Fix react-native-xcode.sh to work in repo and out of repo. * Fix RedBox * Synchronize android sources under ReactAndroid & ReactCommon with RNv0.61.5 .. This builds a clean base upon which all the patches will be rebased .. * Patches for some of the basic build customizations. Includes (1) Nuget step configuration files (2) build param to support excluding all SOs from library archives * Exclude package from beachball * Fixing the nuget configuration patches.. which was badly created last time * V8Integration patches * Changing patching command in pipeline definitions to only apply rebased patches * Consuming downloaded third party packages for folly, glog, double-conv and boost * Fixing the pipeline hacky step to update the POM file Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Eli White <eliwhite@fb.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Thibault Malbranche <thibault.malbranche@epitech.eu> Co-authored-by: Michał Osadnik <osdnk@fb.com> Co-authored-by: Florian Cargoët <florian.cargoet@gmail.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: sunnylqm <sunnylqm@qq.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Rodinei Fagundes <rodinei.jf@gmail.com> Co-authored-by: Kid Commit <26439946+ferdicus@users.noreply.github.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: Brian Vaughn <bvaughn@fb.com> Co-authored-by: Logan Daniels <logand@fb.com> Co-authored-by: David Aurelio <davidaurelio@fb.com> Co-authored-by: Adlai Holler <adlai@google.com> Co-authored-by: Onti Vals <ontiv@microsoft.com> Co-authored-by: Dan Abramov <gaearon@fb.com> Co-authored-by: Sidharth Guglani <sidharthguglani@fb.com> Co-authored-by: Bruno Lemos <brunohplemos@gmail.com> Co-authored-by: Kant <quent92100@gmail.com> Co-authored-by: Scott Rice <srice@fb.com> Co-authored-by: Avik Chaudhuri <avik@fb.com> Co-authored-by: justin ross <ross.justin.t@gmail.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Vojtech Novak <vonovak@gmail.com> Co-authored-by: Oleksandr Melnykov <omelnykov@fb.com> Co-authored-by: iyegoroff <iegoroff@gmail.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Ram N <axe@fb.com> Co-authored-by: Spencer Ahrens <sahrens@fb.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: empyrical <empyrical@outlook.com> Co-authored-by: Adam Ernst <adamjernst@fb.com> Co-authored-by: jsfu <sen870825@qq.com> Co-authored-by: Rodrigo Salazar <rodrigos@fb.com> Co-authored-by: Pascal Hartig <phartig@rdrei.net> Co-authored-by: Peter Argany <petetheheat@fb.com> Co-authored-by: Marc Horowitz <mhorowitz@fb.com> Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Mehdi Mulani <mehdi@fb.com> Co-authored-by: SachinTotale <sachin.totale@servicemax.com> Co-authored-by: James Treanor <jtreanor3@gmail.com> Co-authored-by: Max Thirouin <git@moox.io> Co-authored-by: Gabriel Furini <gabrielfurini@gmail.com> Co-authored-by: REDMOND\acoates <acoates@microsoft.com> Co-authored-by: Alexander Kawrykow <akawry@fb.com> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Frieder Bluemle <frieder.bluemle@gmail.com> Co-authored-by: Krzysztof Magiera <krzys@swmansion.com> Co-authored-by: Tom Targosz <tom.targosz@yahoo.com> Co-authored-by: Pavlos Vinieratos <pvinis@gmail.com> Co-authored-by: Miguel Alatzar <this.migbot@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: gaodeng <gaodengming@gmail.com> Co-authored-by: Alaa Ben El Ahmar <alaa.benelahmar@qucit.com> Co-authored-by: Martin Sherburn <mns@oculus.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: Ilia Burdukovski <ilia.burdukovski@ya.ru> Co-authored-by: Radek Czemerys <radko93@gmail.com> Co-authored-by: Kacper Wiszczuk <kacperwiszczuk@gmail.com> Co-authored-by: Vincent Cheung <vincent.cheung@rea-group.com> Co-authored-by: Anand Rajeswaran <anand.rajeswaran@outlook.com> Co-authored-by: Anandraj Govindan <anandrag@microsoft.com>
2020-04-28 21:49:15 +03:00
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
Merge react-native 0.61-stable (#323) * Expose JS Responder handler in Scheduler API Summary: This diff implements the JSResponderHandler methods in the core of RN (scheduler API and friends) Reviewed By: ejanzer Differential Revision: D16543437 fbshipit-source-id: dac03e30c4330d182ecf134f3174ba942dbf7289 * Implement JS Responder Handler in Fabric Android Summary: This diff implements the JSResponderHandler in Fabric Android code Reviewed By: JoshuaGross Differential Revision: D16543438 fbshipit-source-id: 13680f77a5368e8ba1180383a5f9fb7d7330b90a * Implement JNI code to invoke Android JSResponder methods from C++ Summary: This diff implements the JNI code required for Android to receive JSResponderHandler calls Reviewed By: JoshuaGross, makovkastar Differential Revision: D16543431 fbshipit-source-id: 38cff16a05633fccefa201b189d761d503a9b839 * Change AndroidDrawerLayoutNativeComponent to use JS codegen for commands Summary: `codegenNativeCommands` returns an object with functions for each command that has the previous behavior inside the React Renderer, and the new Fabric logic inside of the Fabric React Native Renderer. Changelog: [Internal] - Change AndroidDrawerLayoutNativeComponent to use JS codegen for commands Reviewed By: rickhanlonii Differential Revision: D16529887 fbshipit-source-id: 24a5307944a7f62e18482d60d26052fea3be2051 * Update commands transform to use helper Summary: This uses a new helper called `dispatchCommand` that now exists on the renderer. This was added to the renderer here: https://github.com/facebook/react/pull/16085 In Paper it calls UIManager.dispatchViewManagerCommand and in Fabric it calls the c++ Fabric UIManager Reviewed By: rickhanlonii Differential Revision: D16578708 fbshipit-source-id: 30f9468a7fd48afb506c0ee49a460b949bc863a1 * Delete jsi::Functions before jsi::Runtime gets deleted Summary: ## The Problem 1. `CatalystInstanceImpl` indirectly holds on to the `jsi::Runtime`. When you destroy `CatalystInstanceImpl`, you destroy the `jsi::Runtime`. As a part of reloading React Native, we destroy and re-create `CatalystInstanceImpl`, which destroys and re-creates the `jsi::Runtime`. 2. When JS passes in a callback to a TurboModule method, we take that callback (a `jsi::Function`) and wrap it in a Java `Callback` (implemented by `JCxxCallbackImpl`). This Java `Callback`, when executed, schedules the `jsi::Function` to be invoked on a Java thread at a later point in time. **Note:** The Java NativeModule can hold on to the Java `Callback` (and, by transitivity, the `jsi::Function`) for potentially forever. 3. It is a requirement of `jsi::Runtime` that all objects associated with the Runtime (ex: `jsi::Function`) must be destroyed before the Runtime itself is destroyed. See: https://fburl.com/m3mqk6wt ### jsi.h ``` /// .................................................... In addition, to /// make shutdown safe, destruction of objects associated with the Runtime /// must be destroyed before the Runtime is destroyed, or from the /// destructor of a managed HostObject or HostFunction. Informally, this /// means that the main source of unsafe behavior is to hold a jsi object /// in a non-Runtime-managed object, and not clean it up before the Runtime /// is shut down. If your lifecycle is such that avoiding this is hard, /// you will probably need to do use your own locks. class Runtime { public: virtual ~Runtime(); ``` Therefore, when you delete `CatalystInstanceImpl`, you could end up with a situation where the `jsi::Runtime` is destroyed before all `jsi::Function`s are destroyed. In dev, this leads the program to crash when you reload the app after having used a TurboModule method that uses callbacks. ## The Solution If the only reference to a `HostObject` or a `HostFunction` is in the JS Heap, then the `HostObject` and `HostFunction` destructors can destroy JSI objects. The TurboModule cache is the only thing, aside from the JS Heap, that holds a reference to all C++ TurboModules. But that cache (and the entire native side of `TurboModuleManager`) is destroyed when we call `mHybridData.resetNative()` in `TurboModuleManager.onCatalystInstanceDestroy()` in D16552730. (I verified this by commenting out `mHybridData.resetNative()` and placing a breakpoint in the destructor of `JavaTurboModule`). So, when we're cleaning up `TurboModuleManager`, the only reference to a Java TurboModule is the JS Heap. Therefore, it's safe and correct for us to destroy all `jsi::Function`s created by the Java TurboModule in `~JavaTurboModule`. So, in this diff, I keep a set of all `CallbackWrappers`, and explicitly call `destroy()` on them in the `JavaTurboModule` destructor. Note that since `~JavaTurboModule` accesses `callbackWrappers_`, it must be executed on the JS Thread, since `createJavaCallbackFromJSIFunction` also accesses `callbackWrappers_` on the JS Thread. For additional safety, I also eagerly destroyed the `jsi::Function` after it's been invoked once. I'm not yet sure if we only want JS callbacks to only ever be invoked once. So, I've created a Task to document this work: T48128233. Reviewed By: mdvacca Differential Revision: D16623340 fbshipit-source-id: 3a4c3efc70b9b3c8d329f19fdf4b4423c489695b * Fix missing rotateZ to useAnimatedDriver Whitelist (#25938) Summary: Added missing property to whitelist ## Changelog [General] [Fixed] - Fixed rotateZ native animation Pull Request resolved: https://github.com/facebook/react-native/pull/25938 Differential Revision: D16645798 Pulled By: cpojer fbshipit-source-id: ef74d7230fa80068dcceaaff841af27365df92e9 * Back out "[react-native][PR] Allow Animation EndResult callback to return Promise" Summary: Original commit changeset: 420d29d262b6 Reverts https://github.com/facebook/react-native/pull/25793 / D16515465 Union type property is not supported by codegen. We don't want to support unions yet and because the improvement is not that big and not yet published as stable for OSS (neither used anywhere internally) we can safely revert it. Reviewed By: RSNara Differential Revision: D16621228 fbshipit-source-id: 2fa416eef1ae353990860026ca97d2b0b429a852 * Switch Platform Constansts to use typedConstants structs Summary: It's actually the first module in OSS which is typed with taking advantages of codegen. Reviewed By: RSNara Differential Revision: D16620334 fbshipit-source-id: 65d6656506f2a4c68d493939ecfa65ba975abead * Fixed android bounding box (#25836) Summary: This PR fixes https://github.com/facebook/react-native/issues/19637. Summary of the issue: on Android, transformed touchables have press issues because the touchable's measurements are incorrect in the release phase. `UIManager.measure()` returns an incorrect size and position as explained [here](https://github.com/facebook/react-native/issues/19637#issuecomment-396065914) This is easily seen with the inspector : **Screenshot of a { scale: 2 } transform** The real view (scaled) is in pink, the incorrect touchable area is in blue. <img src="https://user-images.githubusercontent.com/110431/41190133-8d07ad02-6bd9-11e8-873d-93776a007309.png" width="200"/> **Screenshot of a { rotateZ: "-45deg" } transform** The real view (rotated) is in pink, the incorrect touchable area is in blue. <img src="https://user-images.githubusercontent.com/110431/41190136-a1a079a6-6bd9-11e8-906d-729015bcab6b.png" width="200"/> ## Changelog [Android] [Fixed] - Fix UIManager.measure() Pull Request resolved: https://github.com/facebook/react-native/pull/25836 Test Plan: Android now produces the same results as iOS as seen on these screenshots | Android without fix | Android with fix | iOS | | --- | --- | --- | | ![Screenshot_1564133103](https://user-images.githubusercontent.com/110431/61941632-28729b00-af98-11e9-9706-b13968b79df5.png) | ![Screenshot_1564130198](https://user-images.githubusercontent.com/110431/61941631-28729b00-af98-11e9-9ff3-5f2748077dbe.png) | ![Simulator Screen Shot - iPhone X - 2019-07-26 at 11 19 34](https://user-images.githubusercontent.com/110431/61941633-28729b00-af98-11e9-8dc4-22b61178242e.png) | Reviewed By: cpojer Differential Revision: D16598914 Pulled By: makovkastar fbshipit-source-id: d56b008b717ea17731fb09001cbd395aa1b044fe * Fix crash when tapping full screen button on video ad Summary: Fragment was assigned incorrect `tag` and `surfaceID` (`surfaceID` is the important one). Wrong `surfaceID` means that `navigationCoordinator` is never resolved. As a result of navigationCoordinator not being assigned, tapping a video ad on Marketplace results in showing video ad overlay rather than showing full screen video. Reviewed By: JoshuaGross Differential Revision: D16646492 fbshipit-source-id: 0da5c56ecb7c81e9f4a9469a3626ccd430a01558 * Pop frames correctly in console.error handler Reviewed By: cpojer Differential Revision: D16648992 fbshipit-source-id: 4581e2cd6859f27bc384fc3ab328ab5b9414c704 * Fix up NativeDialogManagerAndroid PR Summary: This diff has three changes: 1. Remove all references to `Stringish` from `NativeDialogManagerAndroid`. (All Fbt objects expose a `.toString` method we could call). 2. Make sure that we only access `DialogManagerAndroid` through `NativeDialogManagerAndroid`. 3. Removed a bunch of `$FlowFixMes` in the files I touched. Probably not the best idea to bite into this cleanup on this diff, but what's done is done. Since this diff is fairly large, I've commented on parts of it I thought were note-worthy. I've also commented on the changes I had to make to fix flow after removing the `$FlowFixMe`s. Reviewed By: PeteTheHeat Differential Revision: D16428855 fbshipit-source-id: 0e6daf2957f4b086ebb1e78e0a59930668c65576 * Bump hermes to v0.1.1 (#25908) Summary: Hermes has been updated to [v0.1.1](https://github.com/facebook/hermes/releases/tag/v0.1.1) and [renamed from 'hermesvm' to 'hermes-engine'](https://github.com/facebook/hermes/commit/c74842ee5c4d11dc9fe3bf012f97a0e3fde6d54f) ## Changelog [Android] [Changed] - Bump hermes to v0.1.1 Pull Request resolved: https://github.com/facebook/react-native/pull/25908 Test Plan: RNTester builds and runs as expected Differential Revision: D16645811 Pulled By: cpojer fbshipit-source-id: 4fb6a3160df2c6d08140dd1fee51acf9ff8baffc * Fabric PerfLogger: prevent ConcurrentModificationException Summary: Some surfaces throw ConcurrentModificationException when logging detailed perf for Fabric. I've refactored the ReactMarker class to use a threadsafe ArrayList and removed synchronization, which is safer and should improve perf everywhere the markers are used, even if there are zero listeners. Reviewed By: mdvacca Differential Revision: D16656139 fbshipit-source-id: 34572f9ad19028a273e0837b0b895c5e8a47976a * iOS fixed up inconsistent boolean convertion logic in RCTPlatform Summary: For some reason the conversion from a BOOL object to `bool` (C++ style) may lead to incorrect boolean value. This fixes the value provided to the builder to be of `bool` type instead. Reviewed By: JoshuaGross Differential Revision: D16657766 fbshipit-source-id: b66922aceadd20d16226a07f73b24ee0a3b825dc * Add ErrorUtils to global variables (#25947) Summary: ErrorUtils is giving an error by eslint. ('ErrorUtils is not defined'). ## Changelog [General] [Fixed] - Add ErrorUtils to eslint globals Pull Request resolved: https://github.com/facebook/react-native/pull/25947 Test Plan: Run eslint on a react native project using ErrorUtils. Eslint verification should pass. Differential Revision: D16666163 Pulled By: cpojer fbshipit-source-id: c20c4e21fe06c6863dcfc167d6d03c6217ae1235 * Update App.js (#25905) Summary: use "shorthand" of `Fragment` No need to import `Fragment` as it can be used via `<></>` vs `<Fragment><Fragment />` ## Changelog Use shorthand for Fragment in App.js [General] [Changed] - Use shorthand for Fragment in App.js Pull Request resolved: https://github.com/facebook/react-native/pull/25905 Test Plan: Ci Tests should be sufficient Differential Revision: D16666166 Pulled By: cpojer fbshipit-source-id: 70e2c9793087bf8f5e0a5477c75f178134cbd6a1 * Fix error string in codegenNativeComponent Summary: This diff fixes the error message in the codegenNativeComponent fallback Reviewed By: TheSavior Differential Revision: D16579775 fbshipit-source-id: 176f81ea91e11f671407a5e5e5b000c4b83f93b2 * Remove outdated React async component check Summary: I added this check [a couple of years ago](https://github.com/facebook/react-native/commit/1b22d49ae8945680dee4fd01e3fbb78b1e443e01) to mimic how [React used to check for async roots](https://github.com/facebook/react/blob/acabf112454e5545205da013266d8529599a2a82/packages/react-reconciler/src/ReactFiberReconciler.js#L321-L330). This code doesn't make sense anymore since there's neither an async base class or an `unstable_ConcurrentMode` export, so I'm just cleaning it up. Reviewed By: threepointone, sebmarkbage Differential Revision: D16668567 fbshipit-source-id: 5ccf5feccc4b65ffb3aeb0a09891d8be7490df26 * Add tests for codegenNativeComponent Summary: Adds tests for codegenNativeComponent Reviewed By: TheSavior Differential Revision: D16582627 fbshipit-source-id: 3527126c7838f3e2c0c56b19956c618f0a7fb9f9 * Update loading pre-bundled message Summary: Updated the message from > Loading from pre-bundled file to > Connect to Metro to develop JavaScript I also added a new RCT_PACKAGER_NAME so other packagers can override "Metro" Reviewed By: yungsters, cpojer Differential Revision: D16427501 fbshipit-source-id: 1b7f9e261f7521ba930c6248087fe6f3c3659cb7 * Add $FlowFixMeEmpty to suppressions in RN's .github.flowconfig Summary: The types-first codemod adds a few of these, so need to sync the suppressions here with the ones in xplat/js/.flowconfig Reviewed By: jbrown215 Differential Revision: D16690168 fbshipit-source-id: 49d3f80a4ab24badf11a9ac54abfe49670989a91 * Add portable bit field implementation Summary: @public Our usage of C++ bit fields has lead to quite some problems with different compiler setups. Problems include sign bits, alignment, etc. Here we introduce a portable implementation as a variadic template, allowing the user to store a number of booleans and enums (defined with `YG_ENUM_SEQ_DECL`) in an unsigned integer type of their choice. This will replace all usages of bit fields across the Yoga code base. Differential Revision: D16647801 fbshipit-source-id: 230ffab500885a3ad662ea8f19e35a5e9357a563 * Remove style property bitmask Summary: @public Removes the style properties bitmask. We have used this for experimentation, and it's no longer necessary. This simplifyies the code, and allows us to cut over to `Bitfield.h` more easily. Reviewed By: astreet Differential Revision: D16648862 fbshipit-source-id: 17c0899807af976f4ba34db54f8f0f6a3cd92519 * Use `Bitfield` in `YGNode` and `YGStyle` Summary: @public Replaces the usage of C++ bitfields with our portable `Bitfield` class. Reviewed By: SidharthGuglani Differential Revision: D16649875 fbshipit-source-id: 539f016d5e1c9a8c48cc9bacbbf6ed985e385e69 * Use `Bitfield` in `YGLayout` Summary: Replaces the usage of C++ bitfields with our portable `Bitfield` class. Reviewed By: SidharthGuglani Differential Revision: D16656361 fbshipit-source-id: 05f679e2e994e109b2bd1090c879d6850fabdc40 * Back out "[Yoga] Experiment: double invocations of measure callbacks" Summary: Removes the double measure callbacks experiment Original commit changesets: c6cf9c01a173, b157d8137c72 Reviewed By: SidharthGuglani Differential Revision: D16687367 fbshipit-source-id: 9649f8731bd1b27f4d291cee4fa30153165cea02 * Don't copy children in YGNodeComputeFlexBasisForChildren (#919) Summary: No need for a copy here. Pull Request resolved: https://github.com/facebook/yoga/pull/919 Differential Revision: D16701461 Pulled By: davidaurelio fbshipit-source-id: 3a90adbb2b5c43d5aefe693a8525aa3a37e53b3d * React edit text changes (#25964) Summary: Changing showSoftKeyboard and hideSoftKeyboard to be protected, as we need this change for an internal control that extends ReactEditText. ## Changelog [Android] [Changed] - part of our react native platform, we have a control that extends ReactEditText and we need to be able to override these 2 methods. Pull Request resolved: https://github.com/facebook/react-native/pull/25964 Test Plan: The change has been in Microsoft's branch of RN for almost 2 years, and since it's a relatively small change we've done a quick sanity check in RNTester prior to this PR, making sure the TextInput page loads fine and it's functional. Differential Revision: D16686878 Pulled By: cpojer fbshipit-source-id: 63035ee9c58e93bc0fa40e5bec318df05322c6c5 * Fix Fast Refresh on Fabric Summary: Brings in https://github.com/facebook/react/pull/16302. We were passing roots to a wrong renderer, hence a confusing Fabric-only crash. Reviewed By: JoshuaGross Differential Revision: D16672454 fbshipit-source-id: 115894eb375b50da09d145c57f15c7d5668b926d * iOS: Revert RCT->RN prefix renaming to avoid confusion Summary: The previous rename from RCT->RN prefix ended up causing some confusions on which prefix to use for which files and under what circumstances. To avoid further confusion before we're done with the re-architecture project, let's keep them as RCT. Reviewed By: mdvacca Differential Revision: D16705566 fbshipit-source-id: 395bff771c84e5ded6b2261a84c7549df1e6c5e5 * use array for passing measure callback reasons count Summary: Use an array for counting measure callbacks due to each reason. and this is now added as qpl metadata in Layout Calculation qpl event Reviewed By: davidaurelio Differential Revision: D16666786 fbshipit-source-id: ff85fba835148f06b9c5d90c4604e552a813777a * Commands codegen: added RCT prefix for protocols, extern C functions, and file names Summary: This will provide consistency with the rest of ObjC/ObjC++ files throughout RN codebase, which is also part of the iOS engineering practice to have a prefix. Highlights: * This only affects the `protocol` and extern C functions, and the .h output file name * Other C++ only file/classes are not affected * The assumption is that the RCT prefix is only for iOS specific files/names. The JS component name should **NOT** have any prefix in the long term (some of them still have RCT prefix in the name, which was an artifact of legacy inconsistency). * The RCT prefix is not relevant to Java/JNI code, since they have their own convention Reviewed By: TheSavior, mdvacca Differential Revision: D16661286 fbshipit-source-id: b8dd75fa7f176d6658183f225b27db017b4b55e7 * Add support for casting codegenNativeComponent Summary: Adds support for casting the codegenNativeComponent export Reviewed By: TheSavior Differential Revision: D16676207 fbshipit-source-id: 5e874bd5a72eb7e67e05b0f671856ae3319a335e * Format code in ReactCommon/turbomodule/core Summary: Just ran `arc f ReactCommon/turbomodule/core/**/*`. Reviewed By: ejanzer Differential Revision: D16691807 fbshipit-source-id: 3f499ffeffaae47bda550c0071c93cd7f48e2a23 * Refactor TextInput.js passes strings to Java for autoCapitalize Summary: We are working to remove constants from the view configs. On June 21st I modified native to support both numbers and strings. D15911323 Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D16697916 fbshipit-source-id: f346f37b2e664c2dd49e2a1308a0517f50284e4d * Minor improvements in native modules codegens Summary: Add handling of `$ReadOnly`, $ReadOnlyArray`. Drop handling of params for callback (does not impact native generated node) and promises' types (does not impact native generated node). Remove typo from native codegen. Reviewed By: RSNara Differential Revision: D16686886 fbshipit-source-id: 26345978bbbba0cee14d00e7b5b9e5017c89a46c * Add handling of nullable return value Summary: Retuned value can be nullable and it need to be handled Reviewed By: RSNara Differential Revision: D16687359 fbshipit-source-id: 7869c4e2b1da69b680b6eade3c88e0558077b705 * fallback not understandable types from methods to object Summary: We don't want to make our codegen breaking if type is not existing. In order to it we can always fallback to Object. That's how it currently works in old codegen #Facebook Thare're few places in our internal code where we use `Map` or tuple in these cases Reviewed By: RSNara Differential Revision: D16687360 fbshipit-source-id: bf8aafd3254fc7e18ad0d58ad1a29e2beeb15bf0 * change name convention for modules Summary: Following our internal discussion we want to change previously used name convention. Now it looks like: ``` #import <FBReactNativeTestSpec/FBReactNativeTestSpec.h> ``` Name is a param of `rn_codegen` and `rn_library`. Also, I found it the easiest to move replacing `::_IMPORT_::` into buck rule Reviewed By: fkgozali Differential Revision: D16646616 fbshipit-source-id: 2c33c5b4d1c42b0e6f5a42d9a318bd8bda9745f4 * Add pointer to generated id<NSObject> Summary: It should always be a pointer, sorry! Reviewed By: RSNara Differential Revision: D16689608 fbshipit-source-id: f67d2606b5bdc169d312c1c75748c390ee5e56ed * Fix veryfying exports in module codegen Summary: If was breaking in cases like ``` export { x as default } ``` Reviewed By: RSNara Differential Revision: D16689606 fbshipit-source-id: 2583c73c5ac06ea0fa8666d219e739e68fc75b12 * DrawerLayoutAndroid drawerPosition now expects a string, number is deprecated Summary: The native change to support strings was made in D15912607 on June 21st. Migrating the JS callsites now to start passing strings instead of the constants. Reviewed By: zackargyle, mdvacca Differential Revision: D16703569 fbshipit-source-id: cb1d8698df55d2961cde1e2b1fbfcba086a03bb2 * Introduce NativeBugReporting Summary: This diff introduces `NativeBugReporting` and eliminates all uses of `NativeModules.BugReporting` from our codebase. Reviewed By: ejanzer Differential Revision: D16717540 fbshipit-source-id: 67b8620ba9dd4b41557ae042c30bdc521e927d30 * Introduce NativeFrameRateLogger Summary: This diff introduces `NativeFrameRateLogger` and eliminates all usages of `NativeModules.FrameRateLogger` from our codebase. Reviewed By: ejanzer Differential Revision: D16718105 fbshipit-source-id: caf903162bab978ee1b3faef56aedef6ada75b89 * Fix forceUpdate method on useWindowDimensions (#25990) Summary: useState won't trigger re-renders if the value passed is the same. ## Changelog [Internal] [Fixed] - Fix forceUpdate method on useWindowDimensions Pull Request resolved: https://github.com/facebook/react-native/pull/25990 Test Plan: Codesandbox: https://codesandbox.io/embed/elegant-cori-0ixbx Differential Revision: D16723962 Pulled By: sahrens fbshipit-source-id: 8a46152908a90553151e0353bbfd8c2e64cfd2af * Update regex used to check for codegenNativeComponent Summary: Updates regex to allow for type casts Reviewed By: TheSavior Differential Revision: D16717249 fbshipit-source-id: f22561d5cd33ab129fc0af4490692344726d7d71 * Use eslint-plugin-prettier recommended config (#25674) Summary: I created a new test project today using RN 0.60.3 and saw that prettier is now used with eslint. After looking at the `react-native-community` eslint config, I notice that it wasn't using the [recommended configuration](https://github.com/prettier/eslint-plugin-prettier#recommended-configuration) of `eslint-plugin-prettier` This PR adds the `eslint-config-prettier` to avoid conflicts between eslint and prettier, it also adds the `prettier/react` config to avoid problems with the `eslint-plugin-react`. ## Changelog [General] [Changed] - Use eslint-plugin-prettier recommended config Pull Request resolved: https://github.com/facebook/react-native/pull/25674 Test Plan: - ✅ Ensure there is no difference on this repo (no ESLint errors, same number of warnings, and no changes when running prettier). Differential Revision: D16666178 Pulled By: cpojer fbshipit-source-id: 70f81db793866acc88388b7b00a496aab5e0b156 * Codemod fbandroid// => //fbandroid/ in xplat/js/ Reviewed By: zertosh Differential Revision: D16710441 fbshipit-source-id: 610e0330c486e716a61b31a8198c05aa50a261cf * Manual fixes for xplat/js/react-native-github Summary: Need to add explicit type annotations in these areas to unblock types-first architecture for Flow. These are locations the codemod could not automatically handle. I'll call out areas I need a close eye on in the comments. Reviewed By: panagosg7 Differential Revision: D16659053 fbshipit-source-id: 167dd2abe093019b128676426374c1c62cf71e7f * xplat/js/react-native-github Reviewed By: panagosg7 Differential Revision: D16657770 fbshipit-source-id: 4e260842c838a35317515044c54ccf55a083da33 * Remove usage of NativeModules.AccessibilityManager Summary: We introduced NativeAccessibilityManager a while back. This diff makes sure that there are no usages of NativeModules.AccessibilityManager in our codebase. Reviewed By: ejanzer Differential Revision: D16714424 fbshipit-source-id: edebf0f7a0fab615aa1722406f9d538696bd65a0 * React sync for revisions 55bc393...85d05b3 Summary: This sync includes the following changes: - **[85d05b3a4](https://github.com/facebook/react/commit/85d05b3a4 )**: Bump package.json versions //<Andrew Clark>// - **[d9fdec6cf](https://github.com/facebook/react/commit/d9fdec6cf )**: [Flare] Remove contextmenu logic from Press (#16322) //<Dominic Gannaway>// - **[12be8938a](https://github.com/facebook/react/commit/12be8938a )**: [Fresh] Support multiple renderers at the same time (#16302) //<Dan Abramov>// - **[6f3c8332d](https://github.com/facebook/react/commit/6f3c8332d )**: Reset hydration state after reentering (#16306) //<Sebastian Markbåge>// - **[028c07f89](https://github.com/facebook/react/commit/028c07f89 )**: Ensure Fundamental flags are added to more locations (#16311) //<Dominic Gannaway>// - **[9dfe973b5](https://github.com/facebook/react/commit/9dfe973b5 )**: Nit: fix inconsistent spacing in a warning (#16310) //<Dan Abramov>// - **[c4f0b9370](https://github.com/facebook/react/commit/c4f0b9370 )**: Warn when Using String Refs (#16217) //<lunaruan>// - **[7c838a645](https://github.com/facebook/react/commit/7c838a645 )**: [Flare] Adds support for hydrating host components with listeners (#16304) //<Dominic Gannaway>// - **[ed4970079](https://github.com/facebook/react/commit/ed4970079 )**: [react-events] Separate the Focus/FocusWithin unit tests (#16298) //<Nicolas Gallagher>// - **[23405c9c4](https://github.com/facebook/react/commit/23405c9c4 )**: [react-events] Add ContextMenu responder (#16296) //<Nicolas Gallagher>// - **[606f76b6e](https://github.com/facebook/react/commit/606f76b6e )**: Fix hydration bug with nested suspense boundaries (#16288) //<Sebastian Markbåge>// - **[a1dbb852c](https://github.com/facebook/react/commit/a1dbb852c )**: warn if you try to use act() in prod (#16282) //<Sunil Pai>// - **[dc232e677](https://github.com/facebook/react/commit/dc232e677 )**: chore: remove outdated comment about gcc (#16232) //<Ashwin Ramaswami>// - **[6b565ce73](https://github.com/facebook/react/commit/6b565ce73 )**: Rendering tasks should not jump the queue (#16284) //<Andrew Clark>// - **[c4c9f086e](https://github.com/facebook/react/commit/c4c9f086e )**: BugFix: Suspense priority warning firing when not supposed to (#16256) //<lunaruan>// - **[05dce7598](https://github.com/facebook/react/commit/05dce7598 )**: Fix priority of clean-up function on deletion (#16277) //<Andrew Clark>// - **[a53f5cc22](https://github.com/facebook/react/commit/a53f5cc22 )**: [SuspenseList] Bug fix: Reset renderState when bailing out (#16278) //<Sebastian Markbåge>// - **[0c1ec049f](https://github.com/facebook/react/commit/0c1ec049f )**: Add a feature flag to disable legacy context (#16269) //<Dan Abramov>// - **[42794557c](https://github.com/facebook/react/commit/42794557c )**: [Flare] Tweaks to Flare system design and API (#16264) //<Dominic Gannaway>// - **[b5af4fe3c](https://github.com/facebook/react/commit/b5af4fe3c )**: Remove FocusScope (#16267) //<Dominic Gannaway>// - **[375616788](https://github.com/facebook/react/commit/375616788 )**: Add missing check to unmocked Scheduler warning (#16261) //<Andrew Clark>// - **[f939df402](https://github.com/facebook/react/commit/f939df402 )**: [act] Wrap IsThisRendererActing in DEV check (#16259) //<Andrew Clark>// - **[f440bfd55](https://github.com/facebook/react/commit/f440bfd55 )**: Bugfix: Effects should never have higher than normal priority (#16257) //<Andrew Clark>// - **[db3ae32b8](https://github.com/facebook/react/commit/db3ae32b8 )**: flush fallbacks in tests (#16240) //<Sunil Pai>// - **[e6a0473c3](https://github.com/facebook/react/commit/e6a0473c3 )**: Warn when rendering tests in concurrent/batched mode without a mocked scheduler (#16207) //<Sunil Pai>// - **[e276a5e85](https://github.com/facebook/react/commit/e276a5e85 )**: [Flare] Remove delay props from Hover (#16248) //<Nicolas Gallagher>// - **[1912b4a0f](https://github.com/facebook/react/commit/1912b4a0f )**: [Flare] Remove delay props from Press (#16247) //<Nicolas Gallagher>// Changelog: [General][Changed] - React sync for revisions 55bc393...85d05b3 Reviewed By: zackargyle, rickhanlonii Differential Revision: D16720468 fbshipit-source-id: 1884ef67f404623697f516cd77ad952d1fbb4737 * @allow-large-files flow 0.105 xplat deploy Summary: bypass-lint allow_many_files Reviewed By: jbrown215 Differential Revision: D16753543 fbshipit-source-id: 1db37b56c1bb84b547e302dfe13ea0c9787deace * chore: Link to CLA wiki and CLA form. (#26016) Summary: After reading [Contributing Guidelines](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#contributing-code), I found myself googling "react native cla", and figured it makes sense to include a link to the CLA alongside the guidelines. ## Changelog [Internal] [Changed] - Link to CLA Pull Request resolved: https://github.com/facebook/react-native/pull/26016 Test Plan: N/A Differential Revision: D16761411 Pulled By: cpojer fbshipit-source-id: 49912c9e32464725d9970f1a7a8bc483ee9f68ce * Fix indentation in Gradle files (#26012) Summary: Fixes indentation in `*.gradle` files by using four-space indents [as specified in `.editorconfig`](https://github.com/facebook/react-native/blob/0ccedf3964b1ebff43e4631d1e60b3e733096e56/.editorconfig#L13-L14). ## Changelog [Internal] [Fixed] - Fix indentation in Gradle files Pull Request resolved: https://github.com/facebook/react-native/pull/26012 Test Plan: Considering [the diff consists of whitespace changes only](https://github.com/facebook/react-native/compare/master...sonicdoe:gradle-indentation?w=1), I think this is safe to merge if the test suite passes. Differential Revision: D16761514 Pulled By: cpojer fbshipit-source-id: 9b035b5c6b35a70b2b54fe35416840fb90a0c6b1 * improve VirtualizedList error message (#25973) Summary: Motivation: when you receive error like `scrollToIndex out of range: 5 vs -1` it's not immediately clear if I requested 5 or -1. This will make the error a little easier to understand. ## Changelog not needed Pull Request resolved: https://github.com/facebook/react-native/pull/25973 Test Plan: not needed, tests must pass Differential Revision: D16708522 Pulled By: osdnk fbshipit-source-id: 8dfcbd95ff0f42805dbe32cd57969a93aea55add * Use ViewManagerDelegate if provided instead of $$PropsSetter to update view props Summary: This diff introduces an interface `ViewManagerDelegate` and its base implementation `BaseViewManagerDelegate`, which is used as a parent class for all view manager delegates generated by the JS codegen. Before the changes in this diff, generated delegates didn't support setting the base view properties such as background color, rotation, opacity, etc. Now it's possible to do by using `BaseViewManagerDelegate.setProperty(...)`, and since all generated delegates extend BaseViewManagerDelegate, they can just call `super.setProperty(...)` for properties they don't want to handle. This diff also introduced a new method `ViewManager.getDelegate()`. This will allow view managers to return an instance of the delegate generated by JS and ensure that the view properties are set in a type-safe manner. If this method returns null (it does by default), we fall back to the default implementation of setting view properties using Java-generated `$$PropsSetter` classes. This is an example of an interface class generated by JS: ``` public interface RCTAxialGradientViewViewManagerInterface<T extends View> { void setColors(T view, Nullable ReadableArray value); void setLocations(T view, Nullable ReadableArray value); void setEndX(T view, Float value); void setEndY(T view, Float value); void setStartX(T view, Float value); void setStartY(T view, Float value); } ``` This is an example of a delegate class generated by JS: ``` public class RCTAxialGradientViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & RCTAxialGradientViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> { public RCTAxialGradientViewManagerDelegate(U viewManager) { super(viewManager); } Override public void setProperty(T view, String propName, Nullable Object value) { switch (propName) { case "colors": mViewManager.setColors(view, (ReadableArray) value); break; case "locations": mViewManager.setLocations(view, (ReadableArray) value); break; case "endX": mViewManager.setEndX(view, value == null ? Float.NaN : ((Double) value).floatValue()); break; case "endY": mViewManager.setEndY(view, value == null ? Float.NaN : ((Double) value).floatValue()); break; case "startX": mViewManager.setStartX(view, value == null ? Float.NaN : ((Double) value).floatValue()); break; case "startY": mViewManager.setStartY(view, value == null ? Float.NaN : ((Double) value).floatValue()); break; default: super.setProperty(view, propName, value); } } } ``` NOTE: What if a view manager, for instance ReactAxialGradientManager, wanted to add support for the borderRadius prop? In the old Java codegen, it would just need to create a method and annotate it with ReactProp (name = ViewProps.BORDER_RADIUS) and $$PropsSetter would call this method when a property with this name must be set. With the new JS codegen, borderRadius is a part of the basic view props, so setBorderRadius is not generated as a part of the ViewManagerInterface, so it’s not possible to set this value. I see two options: 1) add a method boolean setProperty (String propName, Object value) and let the view manager handle it in a non-type safe way (return true if it’s been handled). 2) Generate BaseViewManagerInterface which will include all basic view props and make BaseViewManager implement this interface, leaving all methods empty so that it stays compatible with the current implementation. Override these methods in a view manager that needs to handle a specific property in a custom way (so we would override setBorderRadius in ReactAxialGradientManager). Reviewed By: mdvacca Differential Revision: D16667686 fbshipit-source-id: 06a15a92f8af55640b7a53c5a34f40366d1be2a8 * Added jitpack repository to template (#25987) Summary: This PR will eliminate additional manual installation step for third-party RN libraries that include jitpack-published dependencies. ## Changelog [Android] [Added] - Added jitpack repository to template Pull Request resolved: https://github.com/facebook/react-native/pull/25987 Test Plan: No testing required. Differential Revision: D16763401 Pulled By: cpojer fbshipit-source-id: 72ff0146bd20c61a27b244f2dc7fea50781a4d1a * - Bump CLI to ^3.0.0-alpha.1 (#26028) Summary: Bumps the CLI to v3 alpha which includes Metro 0.56 ## Changelog [Internal] [Changed] - Bump CLI to ^3.0.0-alpha.1 Pull Request resolved: https://github.com/facebook/react-native/pull/26028 Test Plan: None Differential Revision: D16763732 Pulled By: cpojer fbshipit-source-id: 8f35fb80913f623cb44d37208f49040d4a33b07b * Fix handling of failed image downloads Summary: If you have following scenario 1. Have <Image> component with valid URL 2. Due to user action set <Image> to incorrect URL (something that 404s) Currently 1st image stay visible to the user. This is the case for both Fabric and Paper. Paper is being fixed -> https://github.com/facebook/react-native/pull/25919 Reviewed By: fkgozali Differential Revision: D16708532 fbshipit-source-id: ffdea5421faead4730e7b117a3b9f6e21869da70 * Fix crash during reload on Marketplace Home Summary: # What's the problem? `RCTSurfacePresenter._scheduler` is deallocated in `RCTSurfacePresenter.handleBridgeWillReloadNotification`. It shouldn't be used before `RCTSurfacePresenter.handleJavaScriptDidLoadNotification` is called because that's when new `RCTSurfacePresenter._batchedBridge` is created, scheduler depends on this new `RCTSurfacePresenter._batchedBridge`. But it is, it means that it is created with the old bridge, this means that it gets deallocated right away. First access point of old bridge is in `RCTSurfacePresenter.setMinimumSize`. # What's the fix? Make sure surface has correct stage before calling layout methods. The other idea was to return early in `RCTSurfacePresenter.setMinimumSize` in case bridge isn't setup. # Problems? 1. Following error still appears after reload {F176556210} 2. There is a white space for a while. By white space a mean the screen stays white for a short period of time before displaying content. Reviewed By: fkgozali, JoshuaGross Differential Revision: D16762443 fbshipit-source-id: 5a2a880b0f5345f268291c86811264f42f6058b3 * Add Object type to schema Summary: This diff adds ObjectTypeAnnotation to the codegen schema, throwing for the missing implementation sites added in the next diffs for easier review-ability. Also adds a schema fixture that is flow checked for review, but does not export it because the tests would fail Reviewed By: TheSavior Differential Revision: D16759109 fbshipit-source-id: 75c93623e8c1ae2003c7cc638e8e3447f0e7aa38 * Add object prop tests for unchanged fixtures Summary: This diff adds snapshot updates for the new object props test fixtures whose implementation does not need to change (e.g. event emitter files will not change when object props are implemented). This is for easier reviewability in later diffs. Notes that in the files that will change, we're temporarily filtering the OBJECT_PROPS test fixture Reviewed By: TheSavior Differential Revision: D16759124 fbshipit-source-id: 8aae063614f762c8bd7bf092b0d274804c38dd14 * Add view config support for Object props Summary: This diff adds handling for object prop types in the view config codegen Reviewed By: TheSavior Differential Revision: D16759136 fbshipit-source-id: ff4020f9cffe30f14a1356ac95afd7c9a1062c05 * Add Object props support for Java Summary: This diff adds Java handling for object props Reviewed By: TheSavior Differential Revision: D16759139 fbshipit-source-id: e47956dc43cd1eb4abd58636bf111dde8d7244cc * Move generateStructName to CppHelpers Summary: We'll need this helper in the prop files now so let's move it over to the generic cpp helpers Reviewed By: TheSavior Differential Revision: D16759164 fbshipit-source-id: 8765ffee3bd8219b5f0dc8677362ec45f0a8e2c5 * Add support for parsing object props Summary: This diff adds support to the flow parser to parse object props to the codegen schema This handles required and optional props, as well as required and optional object properties, WithDefault, enums, etc. Basically everything is supported that is supported at the top level Reviewed By: TheSavior, osdnk Differential Revision: D16759198 fbshipit-source-id: 6f501f4738f84f20a940235ba74f7bae93e64eef * Better error message for invalid type annotation Summary: Just a minor error message improvement Reviewed By: TheSavior, osdnk Differential Revision: D16759233 fbshipit-source-id: c53c54535eca683353085a8d2272c60596b52b54 * Add Flipper to React Native OSS by default Reviewed By: passy Differential Revision: D6723578 fbshipit-source-id: f34442689f99cd94220335a171010224a12132a8 * Improve ModuleRegistryBuilder assertion Summary: ModuleRegistryBuilder does as assertion to verify that all `cxxModules` are instances of `CxxModuleWrapperBase::javaStaticClass()`. This assertion is causing the crash in T48554656. Since we don't know which NativeModule is causing this problem, it's difficult to get to the bottom of this. So, for now, I'm improving the assertion message in the hopes that it helps us get to the bottom of this issue. Reviewed By: mdvacca Differential Revision: D16774711 fbshipit-source-id: 82318b8ff5ab735ae642da81777c1b5588e8a483 * Move HermesSamplingProfiler to OSS Reviewed By: willholen Differential Revision: D16069575 fbshipit-source-id: a67d19be8790a27e6b3fbd2da0d5c9fdd1e9d53a * Fix jest test crashes with animated components Summary: In the jest test renderer, host components have null refs by default. `createAnimatedComponent` tries to access the ref in componentDidMount, which then crashes. This is particularly problematic when trying to update test data: https://fb.workplace.com/groups/mpen00bs/permalink/494236684721027/?comment_id=510656413079054 Just checking for null fixes the issue and shouldn't affect anything else. Reviewed By: TheSavior, yungsters Differential Revision: D16777137 fbshipit-source-id: 0b9f7c5734c849f36318512ceffcc42dd44c58bb * Add RNTester and UITestBed as dev routes in main apps Summary: It's nice to have everything in one place, especially when touching native code where it's a pain to arc focus or buck build another target just to test some other JS. Reviewed By: yungsters Differential Revision: D14957052 fbshipit-source-id: fd3c388ab5b193b0fe9cebdc0c81ddbff9a714d4 * URL: Do not prepend baseUrl if the URL is not a relative URL (#26009) Summary: Fix for bug https://github.com/facebook/react-native/issues/26006 URL with base is always used, even when absolute URL is provided ## Changelog [Javascript] [Fixed] - `URL`: Base url value is ignored when the input url is not a relative url. Pull Request resolved: https://github.com/facebook/react-native/pull/26009 Test Plan: `new URL('http://github.com', 'http://google.com')` now returns `http://github.com/` Added a test case to `URL-test.js` to verify the same. Differential Revision: D16781921 Pulled By: cpojer fbshipit-source-id: 038aca3610e34f513f603e8993f9a925b7d28626 * Move TextInput PropTypes to Deprecated PropTypes (#26042) Summary: This pull request moves `TextInput`'s proptypes to `DeprecatedTextInputPropTypes`. This is in line with what is happening with other components. ## Changelog [General] [Deprecated] - Moved `TextInput`'s proptypes to `DeprecatedTextInputPropTypes` Pull Request resolved: https://github.com/facebook/react-native/pull/26042 Test Plan: Flow checks pass. Differential Revision: D16782322 Pulled By: cpojer fbshipit-source-id: c5f9caa402c0c5cd878e7fff502d380c7b468cbd * fix SectionList scrollToLocation and prevent regressions (#25997) Summary: Recently there were quite a few changes to this functionality, and they caused breakages https://github.com/facebook/react-native/issues/21577 https://github.com/facebook/react-native/issues/24034 https://github.com/facebook/react-native/issues/24734 https://github.com/facebook/react-native/issues/24735 Currently, whichever `viewOffset` I pass, it will be overridden (either by 0 or something computed in the if body). This fixes the issue and also adds tests to make sure there is no regression. ## Changelog [Javascript] [Fixed] - VirtualizedSectionList scrollToLocation viewOffset param ignored Pull Request resolved: https://github.com/facebook/react-native/pull/25997 Test Plan: tests pass Differential Revision: D16784036 Pulled By: cpojer fbshipit-source-id: 46421250993785176634b30a2629a6e12f0c2278 * Add reexport_all_header_dependencies to (yet more) misc rules Summary: Currently this is the default, but I plan to toggle the default to False shortly. False is better for build speed, as it forces you to separate deps and exported_deps. Reviewed By: williamtwilson Differential Revision: D16785991 fbshipit-source-id: 8cb73b87f1dfa50f21c0c12df1579054cdc99e6e * Commands: support Float arguments Summary: Support codegen'ing commands with Float arguments. Reviewed By: mdvacca Differential Revision: D16785534 fbshipit-source-id: 8174ae40762c1114b87a023cb2b69b2515dc6e23 * Use feature flag to enable view manager delegates for setting props Summary: This diff adds a feature flag which must be enabled if view managers should be allowed to use a delegate for setting their properties. Reviewed By: mdvacca Differential Revision: D16762876 fbshipit-source-id: ae3466d7f02ed02f203dbb79f5e0843e6d9fdd45 * fix display problems when image fails to load (#25969) Summary: This problem was also affecting Fabric and was fixed in D16708532. When the image resource is changed and the new image resource fails to load, we expect the display image to fail to load, but the image still shows the image that was successfully loaded last time. ## Changelog [iOS] [Fixed] - fix display problems when image fails to load Pull Request resolved: https://github.com/facebook/react-native/pull/25969 Test Plan: This is catalyst playground with following code P78264143. TLDR of the code, it sets URL <Image> that is 404. {F175486515} Reviewed By: makovkastar Differential Revision: D16783330 Pulled By: sammy-SC fbshipit-source-id: 1cb488590ce15d957357f32a73ebf8df6cccf4cd * Migrate RCTAxialGradientView to JS codegen Summary: This diff migrates `RCTAxialGradientView` to use generated `RCTAxialGradientViewManagerDelegate` for setting its props. The following base properties have been added to `BaseViewManager`: ``` protected void setBorderRadius(T view, float borderRadius) {} protected void setBorderBottomLeftRadius(T view, float borderRadius) {} protected void setBorderBottomRightRadius(T view, float borderRadius) {} protected void setBorderTopLeftRadius(T view, float borderRadius) {} protected void setBorderTopRightRadius(T view, float borderRadius) {} ``` Reviewed By: JoshuaGross, mdvacca Differential Revision: D16784173 fbshipit-source-id: f3971985efee2b6e0a5fb248b89c4809305e670c * hadle nullable params in generated objcpp Summary: Param of function can be optional and it should have impact on native code. Inspired by old codegen Reviewed By: RSNara Differential Revision: D16763884 fbshipit-source-id: dab50275f902dbe4af25824bb6128d3b37fc43cd * Remove multiple RTCConvert import Summary: RTCConvert was previously imported on each protocol. It was redundant. It's enough to import it once per file Reviewed By: RSNara Differential Revision: D16764834 fbshipit-source-id: 9e5dcd52e38dfefa675e3e2c9f2a8f414da1a02c * fix optional key in structs in new codegen Summary: Property should be marked as optional not only when value is optional, but also key. Reviewed By: RSNara Differential Revision: D16764332 fbshipit-source-id: d56944ef263da3aa1fce3482151c761574a83be6 * Change type of params in methods' protocols to nongeneric Summary: It was mistake which I fix here. Type of param in protocols should be generated struct. See generated struct in snap. It's exactly how it was in previous codegen Reviewed By: RSNara Differential Revision: D16770579 fbshipit-source-id: dac9c15c5d91a41ab2d06aea416f64bd7deb4476 * Fix name of key obtaining from dictionary in inline method in generated objcpp Summary: It was a mistake. We should obtain value by proper key always. Previously by a mistake I hardcoded 'a'. I wasn't break anything because it wasn't used in Internationalization. However, it was a bug Reviewed By: RSNara Differential Revision: D16782132 fbshipit-source-id: 59f7910f2be7753c07f16f00a201de856d57e29e * Add setMethodArgConversionSelector Summary: `setMethodArgConversionSelector` is method for provinding generated structs for methods' params. It was exactly how in old codegen. Reviewed By: RSNara Differential Revision: D16784403 fbshipit-source-id: d35bc8160be62385527299a6b8e68c1159002853 * Omit getConstants for codegening if object is empty Summary: Old codegen was omitting `getConstants` if it was empty. So do our. There's no point in providing this getter in this case. Reviewed By: RSNara Differential Revision: D16762230 fbshipit-source-id: 721df13a00848d23108329b152115c0f0aee8eb9 * Add documentation to TextInput's Flow types (#26054) Summary: The documentation from the Flow types' respective proptypes have been copied over to `TextInput`. ## Changelog [Internal] [Changed] - Added documentation to TextInput's Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/26054 Test Plan: `yarn flow-check-ios` and `yarn flow-check-android` both pass. Differential Revision: D16801435 Pulled By: TheSavior fbshipit-source-id: 7f3d75ba149259d5bbf719375320e2e325188826 * Delete ensureComponentIsNative.js Summary: This function was used by Touchable*. It was removed from the Touchables in D6494579 in 2017. The only remaining callsite was ImageBackground which is attaching a ref directly to the View so we know it is a native component. This is needed for some setNativeProps cleanup Reviewed By: sahrens Differential Revision: D16796973 fbshipit-source-id: 19379094b3b91920efac4bf1969fc22d4b80bcc6 * Use SoundManager in Pressability and Touchable Summary: This diff replaces the usage of UIManagerModule.playTouchSound() in Pressability and Touchable for the SoundManager.playTouchSound() Reviewed By: yungsters Differential Revision: D16543433 fbshipit-source-id: a2ba060bc480889c1e08c5c87086361e06974684 * Revert D16543433: [Fabric][JS] Use SoundManager in Pressability and Touchable Differential Revision: D16543433 Original commit changeset: a2ba060bc480 fbshipit-source-id: 0ba31019fb7a9e77577e495782a3b10029575d22 * Migrate RCTImage NativeModules to CoreModules Summary: This diff moves RCTImageLoader, RCTImageEditingManager, and RCTImageStoreManager to CoreModules. This is necessary for us to convert all these NativeModules to TurboModules. **Note:** As a part of this diff, I had to break apart `RCTImageLoader.h`. All the protocols that were in `RCTImageLoader` are now in their own headers. Furthermore, `RCTImageLoader`'s methods are defined in `RCTImageLoaderProtocol`, so that we can call them from classes like `RCTImageViewManager` in `RCTImage`. Reviewed By: PeteTheHeat Differential Revision: D16805827 fbshipit-source-id: 89f6728b0766c30b74e25f7af1be8e6b8a7e6397 * Add support for `Double` prop type Summary: Support a prop-type `Double`, in addition to `Float`, for flow typing and codegen of components. Reviewed By: TheSavior Differential Revision: D16812812 fbshipit-source-id: b5588b3218636283a4e9c5d17212dd0b92986eb9 * Support spreading locally defined types Summary: We want to be able to spread types that are defined in the same file. Reviewed By: JoshuaGross Differential Revision: D16812171 fbshipit-source-id: 7cda9869ea25f0357b3f8a3b28443407b219f04b * Support spreading locally defined types deeply Summary: We want to be able to spread props at any level, not just the top level Reviewed By: JoshuaGross Differential Revision: D16812884 fbshipit-source-id: 2e710141f833a7cc7ea25a91a1523a5c43b4e02c * Support deeply nested spreads Summary: Apparently I missed one more edge case. Thanks Josh for flagging! Reviewed By: JoshuaGross Differential Revision: D16813354 fbshipit-source-id: 6b59bc7b18184e3aa437c3b038ffd22b0fc0ba6a * Add failure tests for duplicate props with the same name Summary: There are a couple of cases where props can conflict which would cause undefined behavior. We'll throw to protect against that. Now that we support type spread this is more possible without someone realizing. Reviewed By: JoshuaGross Differential Revision: D16813884 fbshipit-source-id: 1a8fce365ab315198abdff0de6006cfe34e84fb9 * Deprecate Text proptypes (#26055) Summary: This pull request moves `Text`'s prop types to the `DeprecatedPropTypes` folder. This was already partly in progress - there were redundant `TextPropTypes` and `DeprecatedTextPropTypes` files so I removed one, and made sure the version with the doc strings was the one used. ## Changelog [General] [Deprecated] - Move `Text` component's proptypes to DeprecatedPropTypes Pull Request resolved: https://github.com/facebook/react-native/pull/26055 Test Plan: Flow checks pass for iOS and Android Differential Revision: D16801078 Pulled By: TheSavior fbshipit-source-id: ef19300945d48d0a4a83d728ee32cdf7d1c0f0cc * add the jni initializer to the build for sampling profiler Summary: The OnLoad.cpp file is needed since it actually registers the jni functions, it wasn't included in the build so it wasn't working correctly. Reviewed By: jbower-fb Differential Revision: D16826230 fbshipit-source-id: 0243e456c4015879d17650737a6a27a58a3d0d9a * Generate super call to BaseViewManagerDelegate if delegate has no props Summary: This diff adds a super call to `BaseViewManagerDelegate` if the current delegate doesn't have any props. We still want to set base view props, so we need `BaseViewManagerDelegate` to take care of this. Reviewed By: rickhanlonii Differential Revision: D16806648 fbshipit-source-id: 61963f2211cc7b2e7f5822c48bb0a7f50d909221 * Remove vendored proguard annotation (#26069) Summary: There have been multiple complaints about combining RN with various other FB libraries, including Litho and Flipper, because of bundled dependencies that can't be deduplicated by Gradle. This is one of three current conflicts: 1) Proguard annotations (this PR) 2) Yoga 3) fbjni While the Yoga group name doesn't make a massive amount of sense it was the easiest existing package to use and since we don't have a better namespace for this, we might as well use this. A similar change to Litho is landing right now. ## Changelog [Android] [Changed] - Use centralized package for DoNotStrip annotation Pull Request resolved: https://github.com/facebook/react-native/pull/26069 Test Plan: ``` yarn ./gradlew :RNTester:android:app:assembleDebug ``` Reviewed By: cpojer Differential Revision: D16827430 Pulled By: passy fbshipit-source-id: 87542b5422fee598d8e635651441f0ecd42eb9d7 * Add Object props support for cxx Summary: Adds ability to codegen object props to cxx by generating the cxx structs and conversion functions | Reviewed By: JoshuaGross Differential Revision: D16759170 fbshipit-source-id: 7437421e59f4be42fbcd4cddc2e0ed513ae71d08 * Add e2e test for object props Summary: Adds e2e tests for cxx and java object props Reviewed By: JoshuaGross Differential Revision: D16759242 fbshipit-source-id: 2307dc4b3ba26222de510cf5876c582d35fc665c * Add array<object> props to schema Summary: Adds arrays of objects to the codegen schema Reviewed By: motiz88 Differential Revision: D16814117 fbshipit-source-id: 10b20446f7aac5dccc3d2cb148891a134d136d3f * Generate array<object> props Summary: Adds the cxx generators for arrays of object props Reviewed By: JoshuaGross, TheSavior Differential Revision: D16814136 fbshipit-source-id: fa4600f60c063bfb460033f5fde43e26c04b5a3b * Parse $ReadOnlyArray<$ReadOnly{}> props Summary: Add flow type parsing for `$ReadOnlyArray<$ReadOnly<{}>>` Reviewed By: TheSavior Differential Revision: D16814261 fbshipit-source-id: 9442916f5d31f6d27f560332aee311b3ad8f0864 * Add e2e tests for array object props Summary: Adds e2e tests for the array of object prop types in the codegen Reviewed By: rubennorte, motiz88 Differential Revision: D16814301 fbshipit-source-id: 613f32a888451c0c1b7359133b7bf88878e36916 * Add error message for paring unnamed params Summary: We're currently not supporting this kind of params ``` +sample(string):void ```` and here's special exception for it. Reviewed By: RSNara Differential Revision: D16708583 fbshipit-source-id: 809f9808b77108857c8363536b896089e9cb957f * Split buck rules for component and modules Summary: Split buck rules for component and modules for our further convenience Reviewed By: rickhanlonii Differential Revision: D16803703 fbshipit-source-id: c01fb97875b43be4020edd054cad538ec8ed6861 * Support Double in when generating props for .h files, in parsing component props, and for commands and events Summary: I realized my previous diff was incomplete. Adding parsing and generation code for Double for props, commands, and events. Reviewed By: rickhanlonii Differential Revision: D16823540 fbshipit-source-id: fbed9897bb84b789c502cf4153e81060590152b8 * Add support for spread with ReadOnlyArray Summary: The new support for ReadOnlyArray needs to call this new function for spreads too. Reviewed By: JoshuaGross Differential Revision: D16823796 fbshipit-source-id: 9de94b41cdead7ce5238c77a9e39b5daf760dfe2 * Convert RCTImageLoader to TurboModules [4/N] Summary: This diff adds a JS spec for RCTImageLoader, and conforms to it in ObjC++. Since RCTImageLoader isn't called from JS, the js spec is empty. Since `/CoreModules/` is the only dir in OSS which supports TM, move the ObjC++ impl there. The change in `NativeExceptionsManager.js` fixes a weird bug I was hitting in codegen, where the codegen cpp file wouldn't compile due to unused variable. Reviewed By: JoshuaGross Differential Revision: D16495674 fbshipit-source-id: 191897b87730a6b0b96022eedc6412551fae04a6 * Pass RCTImageLoader into RCTSurfacePresenter [5/N] Summary: Instead of grabbing `imageManager` from the bridge, pass it from above. Right now, still use bridge to pass from above, but this gives us flexibility to not use bridge in the future. Reviewed By: shergin Differential Revision: D16504270 fbshipit-source-id: 7977a7957b659375f8348d26cd57b648e9d5959f * Pass RuntimeExecutor into RCTSurfacePresenter Summary: Instead of getting `RuntimeExecutor` from the bridge, pass it from above. Right now pass through `null`, but eventually this will work :) Reviewed By: RSNara Differential Revision: D16626288 fbshipit-source-id: bce527f85c0a79cfe6cf240a3633bbbe357f75c4 * Fix BUCK-related React Native CI failures Reviewed By: cpojer Differential Revision: D16812633 fbshipit-source-id: 50de7603fbb514ff1c3bb6c5fa6afd579d8a20b8 * Move RCTExceptionsManager to CoreModules and make it conform to spec Summary: `NativeExceptionsManager.js` contains the JS spec for this native module. This diff moves the objc code to CoreModules (since it's the only directory that supports TM at the moment) and makes it conform to the spec. NOTE: I will update podfiles after this diff is reviewed, before I land. Adding those generated changes makes it really hard to review. Reviewed By: RSNara Differential Revision: D16812212 fbshipit-source-id: 38b6e9a20ce15e7e9995df34493b37ed7adb2911 * Bump test version for cache issues * Tweak script to work with no global CLI * Revert "Remove vendored proguard annotation (#26069)" This reverts commit 35fc0add2d3a278bf90257284fe23e03898008de. * Revert "Remove 's.static_framework = true' requirement for podspec (#25816)" This reverts commit ca9e108110e4a3cc39044805f879d9a9cb637c41. * [0.61.0-rc.0] Bump version numbers * Revert "[0.61.0-rc.0] Bump version numbers" This reverts commit 9296ab1a615f0eb322e22cb85a61aa5b5acdb76e. * [0.61.0-rc.0] Bump version numbers * Revert "[0.61.0-rc.0] Bump version numbers" This reverts commit 2575eb318f01c8d1e680e3e3aaf07c14e159daaf. * Add RCTWeakProxy to properly deallocate RCTUIImageViewAnimated Summary: @public CADisplayLink strongly holds onto its target, so you have to use a weak proxy object to pass the target into the CADisplayLink. Previously we passed a weak-self point (i.e. weakSelf) but this did not have the intended effect, since the pointer to self would still be passed to CADisplayLink, and thus it would hold onto the RCTUIImageViewAnimated strongly. So is weakSelf doing anything other than using self? It is but it's very minor and not useful. In the case that the object got de-allocated between assigning self to weakSelf and creating the CADisplayLink, then we would pass a nil target. This is actually impossible though because we are running an instance method, so self is implicitly retained! So semantically it is something different but in practice it is the same as passing self through. Notes: * This system was added originally in https://github.com/facebook/react-native/pull/24822 * https://github.com/facebook/react-native/pull/25636 then "enabled" this system by deprecating existing approach Reviewed By: fkgozali Differential Revision: D16939869 fbshipit-source-id: 7a0e947896f23aa30ad074d1dcb4d4db7543e00a * Remove RCTUIImageViewAnimated WeakProxy gating Summary: To help determine how severe this issue is, put the fix behind a MC. We will only pick the parent diff to the RC branch so that the fix immediately goes to master and we don't have to worry about fixing this any further. Reviewed By: fkgozali Differential Revision: D16940181 fbshipit-source-id: 91eb08181f82f51aea6a20b3fd489a33bdc0e424 * [0.61.0-rc.0] Bump version numbers * Revert "[0.61.0-rc.0] Bump version numbers" This reverts commit bc28eee87f777b19106d4df7f2ac775cb357a12b. * Update CircleCI config as per support request * [0.61.0-rc.0] Bump version numbers * Memory Leak due to JSStringRelease not called in multiple places in JSCRuntime.cpp (#25884) Summary: Memory Leak due to JSStringRelease not called in multiple places in JSCRuntime.cpp Issue: https://github.com/facebook/react-native/issues/25664 Reproducible repo: https://github.com/bhandarijiwan/memory_issue_repro ## Changelog [JSC] [JSCRuntime.cpp] - Added missing JSStringRelease calls in missing places Pull Request resolved: https://github.com/facebook/react-native/pull/25884 Test Plan: Tested that is no memory leak with various NativeModule to JS call flows Reviewed By: JoshuaGross Differential Revision: D16928985 Pulled By: TheSavior fbshipit-source-id: 65ce15ae32482d0db39bad7e22a2fed9ee04f230 * Fix Redbox on iOS Summary: Looks like we broke iOS redbox in D16812212. It stopped showing up because the feature detection stopped working, and we started calling noops. The fix is an explicit platform check. Fixes #26260 Reviewed By: motiz88 Differential Revision: D17139310 fbshipit-source-id: 829eec23cbb49151ac250889c34ab28d36b05e6a * Partial RN sync Summary: This cherry-picks one commit: https://github.com/facebook/react/commit/01fb68b9bf680ab8bbf96e86501e0fc540b3cc97 It fixes a bug in Fast Refresh. Reviewed By: threepointone Differential Revision: D17140543 fbshipit-source-id: a7654152d1cc7c27e7c4024380349b44ac496b22 * Change podspec name of yoga to Yoga Summary: Needed to capitalize the name, since this is the convention used elsewhere too [iOS] [Changed] - Renamed yoga podspec to Yoga Reviewed By: shergin Differential Revision: D17127104 fbshipit-source-id: 14047bf452edda000037701f4ba7f4a02a0e717b * Update the version of yoga podspec to match the actual version of Yoga published Summary: Yoga is currently published in cocoapods. While we don't use the Yoga from Cocoapods in React Native, we should atleast try to follow that version, so that other integrations with Yoga are possible Reviewed By: shergin Differential Revision: D17127625 fbshipit-source-id: bca2e1e33ad775e2a0d7a6f1e4177c3b480c023a * Sync Podfile * Update release script * [0.61.0-rc.2] Bump version numbers * TM iOS: Disable in test environment Summary: For now, disable TM completely in test environment, like RNTester integration/unit tests. See details in T53341772 This also fixes the failure discussed in https://github.com/facebook/react-native/pull/26151 Reviewed By: PeteTheHeat Differential Revision: D17147915 fbshipit-source-id: 1c48ebb9c3b81fc08bc33606dcc38c29297d6010 * Revert "Revert "Remove 's.static_framework = true' requirement for podspec (#25816)"" This reverts commit 612c033918e6f61713966a24fa024048fc520fca. * Add missing dependencies to React-CoreModules.podspec * Fix incorrect `module.name_mapper` in template .flowconfig (#26330) Summary: Has explained in https://github.com/facebook/react-native/issues/26233, current template is incorrect & can create error, like having require() of png that are considered as `string` instead of `number. This can probably hide tons of similar mistakes. The change in this PR should resolve the previous behavior (& for example, some places in previous version of the flowconfig have the full path like here https://github.com/facebook/react-native/blob/35300147ca66677f42e8544264be72ac0e9d1b45/template/_flowconfig#L61) Closes https://github.com/facebook/react-native/issues/26233 ## Changelog ``` [General] [Fixed] Fix incorrect `module.name_mapper` in template .flowconfig ``` Alternatively, message could be ``` [General] [Internal] Fix incorrect `module.name_mapper` in template .flowconfig ``` As it hasn't this "bug" hasn't been released in a public stable release. You decide Pull Request resolved: https://github.com/facebook/react-native/pull/26330 Test Plan: I just tested this in my project, thymikee might be able to confirm & approve this PR. Differential Revision: D17258891 Pulled By: cpojer fbshipit-source-id: 3904ffbc6f076ee0e435311249d694b8604fc7b8 * Rename Yoga * [0.61.0-rc.3] Bump version numbers * Fixing Yoga imports and includes on case-sensitive machines (#26416) Summary: In addition of the issue resolved by https://github.com/facebook/react-native/pull/26360 (already merged), machines with case-sensitive disks are still not able to build a project on Xcode due not found `<yoga/...` imports: ``` 'yoga/Yoga.h' file not found ``` ![Screen Shot 2019-09-12 at 11 15 54](https://user-images.githubusercontent.com/1728387/64791885-c58c9180-d54e-11e9-95cb-40befaab7acc.png) ## Changelog [iOS] [Fixed] - Fix Yoga imports and includes Pull Request resolved: https://github.com/facebook/react-native/pull/26416 Test Plan: `Build` command on Xcode now runs successfully in a Mac with disk in case-sensitive mode Differential Revision: D17370392 Pulled By: PeteTheHeat fbshipit-source-id: 2a225f47046113267adb154a4c6a9ef4664a12c3 * Fix build break in MSVC (#26462) Summary: Merging react-native-windows to 0.60 - the visual studio compiler seems to take issue with the existing code ## Changelog [Internal] [Fixed] - Build fix for react-native-windows (MSVC) Pull Request resolved: https://github.com/facebook/react-native/pull/26462 Test Plan: No real change, just making compilers happy. ### Side Note We'll want this change cherry-pickered to RN 0.60 and RN 0.61 so users of react-native-windows dont have to use our fork of react-native. Reviewed By: mhorowitz Differential Revision: D17406081 Pulled By: TheSavior fbshipit-source-id: bc056e1a545c6478fdcbd5645f3a8dea657162c8 * Revert "Fix onDismiss in Modal" This reverts commit bd2b7d6c0366b5f19de56b71cb706a0af4b0be43. * Bump hermes to v0.2.1 (#26451) Summary: Bump hermes to v0.2.1 allow-large-files ## Changelog See https://github.com/facebook/hermes/releases/tag/v0.2.1 [Android] [Changed] - Bump hermes to v0.2.1 Pull Request resolved: https://github.com/facebook/react-native/pull/26451 Test Plan: RNTester builds and runs as expected Differential Revision: D17394921 Pulled By: cpojer fbshipit-source-id: 07ce5da3517b7aa24bfb5e1f6eefed6cdc9f5cb5 * React Partial Sync Summary: Base: 85d05b3a4d439c504ee43652d586ee253a01faf6 Author: Dan Abramov <dan.abramov@gmail.com> Date: Wed Sep 18 16:32:11 2019 +0100 [Fresh] Always remount classes (#16823) commit acfdc9760b4dc55d192b08de42b2c45e5e5bb531 Author: Ricky <rickhanlonii@gmail.com> Date: Wed Sep 18 15:31:00 2019 +0100 [React Native] Fix for view config registrations (#16821) commit dbe593d96c35b33fcc1f1bec70af86c24779392b Author: Dominic Gannaway <trueadm@users.noreply.github.com> Date: Wed Sep 18 14:18:32 2019 +0200 [react-core] Do not null fiber.sibling in detachFiber (#16820) commit 30fa2f5ea3313b4b7932783d8ac71b5d59b8a8c7 Author: Dominic Gannaway <trueadm@users.noreply.github.com> Date: Tue Sep 17 17:30:22 2019 +0200 [react-core] Clear more properties in detachFiber (#16807) commit ea374e751b164ed029b35063b84c825305024a0a Author: Dan Abramov <dan.abramov@gmail.com> Date: Wed Aug 28 16:55:56 2019 +0100 Don't ignore dependencies for render phase update (#16574) Reviewed By: gaearon Differential Revision: D17456249 fbshipit-source-id: 87bad63fed4a571f65592ee904606828e3aa39af * bump android gradle plugin to 3.5.0 (#26129) Summary: Android Gradle Plugin 3.5.0 released with a lot of improvements and bug fixes. It's important to have this change merged before 0.61 release. See https://developer.android.com/studio/releases/gradle-plugin ## Changelog [Android] [Changed] - bump android gradle plugin to 3.5.0 Pull Request resolved: https://github.com/facebook/react-native/pull/26129 Test Plan: RNTester builds and runs as expected Reviewed By: mdvacca Differential Revision: D17091520 Pulled By: osdnk fbshipit-source-id: 232b9209526e62a7344d74422fd8471a03dec7f4 * Update Gradle wrapper to 5.6 (#26079) Summary: ``` Welcome to Gradle 5.6! Here are the highlights of this release: - Incremental Groovy compilation - Groovy compile avoidance - Test fixtures for Java projects - Manage plugin versions via settings script For more details see https://docs.gradle.org/5.6/release-notes.html ``` ## Changelog [Android] [Changed] - Gradle wrapper 5.6 Pull Request resolved: https://github.com/facebook/react-native/pull/26079 Test Plan: Ran build and tests locally. Differential Revision: D17054310 Pulled By: mdvacca fbshipit-source-id: de7ba3a6d04058e51b8bc6a21d5a3f828ef8bc25 * Revert "bump android gradle plugin to 3.5.0 (#26129)" This reverts commit 8d4e8a377528895c5ea3928e9c209eafa467f46b. * Revert "Update Gradle wrapper to 5.6 (#26079)" This reverts commit afd35296f2bd0a04e3406c03ff9c023e7192161f. * [0.61.0] Bump version numbers * Allow again for injecting custom root view via ReactActivityDelegate (#26495) Summary: This change restores the possibility of injecting custom root views via ReactAcitivtyDelegate. It has been used by react-native-gesture-handler library in order to replace default root view with a one that'd route touch events to gesture-handler internal pipeline. The regression happened in d0792d4b8ac42711dfd9fccb782f16e72ce3e335 where new `ReactDelegate` was introduced to provide support for rendering react native views in both Android fragments and activities. As a part of that change the logic responsible for creating root view has been moved from `ReactActivityDelegate` to `ReactDelegate` rendering `ReactActivityDelegate.createRootView` unused – that is there is no code path that leads to this method being called. Instead `ReactDelegate.createRootView` method has been added which now plays the same role. The custom root view injection was relying on overwriting that method and hence the method is no longer referenced overwriting it has no effect. Following the logic migration out of `ReactActivityDelegate` into `ReactDelegate` we could potentially now start overwriting methods of `ReactDelegate`. However when working with Android's activities in React Native we can only provide an instance of `ReactActivityDelegate` and in my opinion it does not make too much sense to expose also a way to provide own instance of `ReactDelegate`. The proposed fix was to route `ReactDelegate.createRootView` to call `ReactActivityDelegate.createRootView` and this way regaining control over root view creation to `ReactActivityDelgate`. The change of the behavior has been implemented by subclassing `ReactDelegate` directly from `ReactActivityDelegate` and hooking the aforementioned methods together. Thanks to this approach, the change has no effect on `ReactDelegate` being used directly from fragments or in other scenarios where it is not being instantiated from `ReactActivityDelegate`. This fixes an issue reported in https://github.com/kmagiera/react-native-gesture-handler/issues/745 and discussed on 0.61 release thread: https://github.com/react-native-community/releases/issues/140#issuecomment-532235945 ## Changelog [Internal] [Fixed] - Allow for custom root view to be injected via ReactActivityDelegate Pull Request resolved: https://github.com/facebook/react-native/pull/26495 Test Plan: 1. Run RNTester, take layout snapshot, see the react root view being on the top of view hierarchy. 2. Run gesture-handler Example app (or some other app that overwrites ReactActivityDelegate.createRootView method), on layout snapshot see custom root view being used. Differential Revision: D17482966 Pulled By: mdvacca fbshipit-source-id: 866f551b8b077bafe1eb9e34e5dccb1240fa935e * Fix ShareSheet crash on iOS 13 (#26429) Summary: Currently on iOS 13 the app will crash if you: - Open the share sheet - Tap something like messages or photos - Cancel the dialog - Perform any other action This is because `shareController.completionWithItemsHandler` is called when the dialog box is canceled and currently `failureCallback` or `successCallback` will always be called. In the situation above, `activityError` is `nil` so `successCallback` will be called even though `completed` is false. This leaves us in a state where the callback has been invoked but the ShareSheet is still active, meaning the success or error callback will be invoked again, leading to the crash. This PR adds a check to make sure `completed` is true before calling `successCallback`. This way `successCallback` will only be called when the user has successfully completed an action and the ShareSheet is closed. ## Changelog [iOS] [Fixed] - Fix crash in RCTActionSheetManager.m on iOS 13 Pull Request resolved: https://github.com/facebook/react-native/pull/26429 Test Plan: - Saved an image successfully - Opened and dismissed the `Photos` dialog multiple times without crashing Differential Revision: D17369712 Pulled By: PeteTheHeat fbshipit-source-id: 228b696243cd39fad1fa134f4412d95d845b1bc5 * [0.61.1] Bump version numbers * Revert "[0.61.1] Bump version numbers" This reverts commit 2577ca534008e362a977ce7c83eb4b51e14a0b52. * Revert "Add generated `xcshareddata` folder to gitignore (#25451)" This reverts commit d57cdac62b814d38d2d03cdbb1cb3da60a09c948. * [0.61.1] Bump version numbers * Bring back RNTester manual step * Removing the workspace (#26566) The workspace file is file to be added to git. Consider it as a lockfile for native ios :) * Revert "Set rounded rectangle mask on TouchableNativeFeedback's ripples (#25342)" This reverts commit 14b455f69a30d128db384749347f41b03b9a6000. * Include transform in OUTER_PROPS (#26611) Summary: Without `transform` in `OUTER_PROPS`, the refresh control component would not include `transform: {scaleY: -1}` in its style and so pulling down, rather than up, on a scroll view would trigger a refresh. Fixes https://github.com/facebook/react-native/issues/26181 ## Changelog [Android] [Fixed] - Fixed issue with refresh control not working properly on an inverted ScrollView Pull Request resolved: https://github.com/facebook/react-native/pull/26611 Test Plan: Updated unit test in splitLayoutProps-test.js. Differential Revision: D17661079 Pulled By: cpojer fbshipit-source-id: 747da27b11c3ca59b7f639f393ae5ac137f5490a * Use `warnOnce` for excessive number of callbacks error (#26508) Summary: I happened to hit this error a couple times and the issue is that if there are let's say 1000 pending callbacks the error would be triggered 500 times and pretty much crash the app. I think it is reasonable to use warn once here so it only happens once. ## Changelog [General] [Fixed] - Use `warnOnce` for excessive number of callbacks error Pull Request resolved: https://github.com/facebook/react-native/pull/26508 Test Plan: Tested by reducing the number of pending callbacks required to trigger the error. Reviewed By: TheSavior Differential Revision: D17512917 Pulled By: JoshuaGross fbshipit-source-id: 5ce8e2a0a166805cc6f3fe6d78e2716d6792a80e * improve error message in NativeModuleRegistryBuilder.java (#26467) Summary: ## Motivation I have seen a spike in users reporting this error. Unfortunately I did not receive any repros that would confirm this, but my hypothesis is that they ran into situation when `new XYZPackage()` was present in `getPackages()` method and then the CLI kicked in with autolinking and they were left with this incomplete error. someone more knowledgeable of autolinking should review this. Pull Request resolved: https://github.com/facebook/react-native/pull/26467 Differential Revision: D17661242 Pulled By: cpojer fbshipit-source-id: 63dfcd85a0d41d85a0dd52f84ab16cb7ceb64ba2 * iOS13 status bar has now 3 styles (#26294) Summary: iOS13 status bar has now 3 styles UIStatusBarStyleDefault, UIStatusBarStyleLightContent, UIStatusBarStyleDarkContent UIStatusBarStyleDefault now acts as an automatic style which will set it’s value dynamically based on the the userinterfacestyle(One of the traits) of the viewcontroller that controls the status bar appearance. ## Changelog [iOS] [Fixed] - iOS13 new status bar style UIStatusBarStyleDarkContent Pull Request resolved: https://github.com/facebook/react-native/pull/26294 Differential Revision: D17314054 Pulled By: cpojer fbshipit-source-id: ea109e729bb551dff314bc00a056860a8febb0e9 * [0.61.2] Bump version numbers * Release underlying resources when JS instance is GC'ed on Android try 2 (#26155) Summary: Reland https://github.com/facebook/react-native/pull/24767 The commit had to be reverted because it caused a crash when using remote debugging in chrome. This is normal since jsi is not available in that environment. The crash was caused by `jsContext.get()` being 0, then being dereferenced later in c++. We can simply skip initializing the blob collector in this case. This also includes the fix from https://github.com/facebook/react-native/issues/25720 to fix a crash when using hermes. ## Changelog [Android] [Fixed] - Release underlying resources when JS instance is GC'ed on Android Pull Request resolved: https://github.com/facebook/react-native/pull/26155 Test Plan: Test using RN tester with jsc and hermes Test remote debugging Reviewed By: mdvacca, fred2028 Differential Revision: D17072644 Pulled By: makovkastar fbshipit-source-id: 079d1d43501e854297fbbe586ba229920c892584 * Bump SoLoader to 0.8.0 (#26759) Summary: This PR bumps bumps Soloader to 0.8.0. This fixes white screen/ crash issues when downloading from Google Play. Related to: https://github.com/facebook/react-native/issues/25927 #26400 ## Changelog [Android] [Changed] - Bump Soloader to 0.8.0 Pull Request resolved: https://github.com/facebook/react-native/pull/26759 Test Plan: A few CI tests fail, but I don't see the link with what I changed, especially the ios tests. It's working locally though, and for people on github who tried this solution as well. Differential Revision: D17828891 Pulled By: mdvacca fbshipit-source-id: 1c7809aa681b41b8ed9a4da96d041d52f3cfbb76 * Revert "Bump SoLoader to 0.8.0 (#26759)" This reverts commit 66ae1caccd2c1142c519ce1913a6ac15d6f335fa. * Improve Flow Type for ScrollResponder Summary: FlatList and VirtualizedList were typing this value as any instead of using the actual type from ScrollView. I started with that change and then fixed the type to solve the other callsites in the codebase. Reviewed By: zackargyle Differential Revision: D17089934 fbshipit-source-id: bfc22cec9993904d779cad37b1de7cb3c0484d2c * Migrate scrollResponderScrollNativeHandleToKeyboard function to take nativeRef Summary: We need to get rid of findNodeHandle calls so migrating scrollResponderScrollNativeHandleToKeyboard to take a ref to a host component. I made this change with Flow, and tested by rendering UserJobApplicationForm Reviewed By: mdvacca Differential Revision: D17099280 fbshipit-source-id: 96af692006aace2c206f268f5416984b00f8a438 * Fix exception in scrollResponderScrollNativeHandleToKeyboard when ref is null Summary: We are seeing these errors in prod: ``` TypeError: Cannot read property '_nativeTag' of null at ReactNativeFiberHostComponent.prototype.measureLayout(ReactNativeRenderer-prod.fb.js:1594) ScrollResponderMixin.scrollResponderScrollNativeHandleToKeyboard(ScrollResponder.js:557) ``` This error is coming from these lines: https://github.com/facebook/react-native/blob/69c38e5a639f34620038ae5724426c92c355e509/Libraries/Components/ScrollResponder.js#L563-L567 Either `nodeHandle` is null or `this.getInnerViewRef()`. If `nodeHandle` was null, we'd get an error that we can't call `measureLayout` on null. So `this.getInnerViewRef()` must be null. In the React Native Renderer this error of `_nativeTag of null` is coming from this line: https://github.com/facebook/react/blob/db8afe4f6318dba422177a2054204ef089570ad8/packages/react-native-renderer/src/ReactNativeFiberHostComponent.js#L84 Which means indeed `this.getInnerViewRef()` is null. So adding a null check here which is what we do at all the other product callsites of `measureLayout`. Flow should have caught this, but because ScrollView is one of the only components left using mixins (ScrollResponder), `this.getInnerViewRef` is typed as `any` instead of what it should be: ``` ?React.ElementRef<Class<ReactNative.NativeComponent<mixed>>> ``` If `scrollResponder` was typed correctly then Flow would have caught this. Changelog: [Fixed] Exception in scrollResponderScrollNativeHandleToKeyboard when ref is null Reviewed By: mmmulani Differential Revision: D17717150 fbshipit-source-id: d7bc4c897ad259fb588e8100f37ccfb8a5d07874 * Fix bug where ScrollView contentInset top set to undefined wouldn't default to 0 Summary: If you passed ``` contentInset: { bottom: 10 } ``` then it wouldn't go into the if case and it could try to call `setOffset` with `undefined`. `setOffset` requires a number. Changelog: [Fix][ScrollView] ScrollView contentInset top now defaults to 0 in expected situations Reviewed By: JoshuaGross Differential Revision: D17796155 fbshipit-source-id: 951dbbb0de1052f64a6835963e8bbc564990c120 * Fix TimingAnimation rounding error issue (Take 2) Summary: This fixes a bug where the frames array can contain a duplicate entry at the end. For example, suppose the duration is 1000.0 then it would create an array with the following: ``` [ 0, 0.0010119824303159884, 0.00391003997863186, 0.00851330482578147, 0.01466951184383165, 0.022249135687575607, 0.03114100006836614, 0.041248932923769244, 0.05248918022066495, 0.06478838042267626, 0.07808196049642172, 0.09231285402599128, 0.1074304693764467, 0.12338985513375342, 0.14015102395653428, 0.15767840628626964, 0.17594041329987542, 0.1949090949486824, 0.21455988464815853, 0.23487142789035506, 0.25582549864491233, 0.27740701626433145, 0.2996041891505173, 0.3224088345090182, 0.34581696665965683, 0.36982983491413496, 0.394455794287552, 0.4197139228812336, 0.44564199741037275, 0.4723190090623474, 0.5000000572130084, 0.5276809909376533, 0.5543580025896278, 0.5802860771187669, 0.6055442057124484, 0.6301701650858652, 0.6541830333403433, 0.6775911654909819, 0.7003958108494828, 0.7225929837356684, 0.7441745013550876, 0.7651285721096447, 0.785440115351841, 0.8050909050513173, 0.8240595867001241, 0.84232159371373, 0.8598489760434653, 0.876610144866246, 0.8925695306235529, 0.9076871459740083, 0.9219180395035779, 0.9352116195773232, 0.9475108197793346, 0.9587510670762303, 0.9688589999316335, 0.9777508643124241, 0.9853304881561681, 0.9914866951742183, 0.996089960021368, 0.9989880175696839, 1, 1 ] ``` With this change, it now generates the following array: ``` [ 0, 0.0010119824303159884, 0.00391003997863186, 0.00851330482578147, 0.01466951184383165, 0.022249135687575607, 0.03114100006836614, 0.041248932923769244, 0.05248918022066495, 0.06478838042267626, 0.07808196049642172, 0.09231285402599128, 0.1074304693764467, 0.12338985513375342, 0.14015102395653428, 0.15767840628626964, 0.17594041329987542, 0.1949090949486824, 0.21455988464815853, 0.23487142789035506, 0.25582549864491233, 0.27740701626433145, 0.2996041891505173, 0.3224088345090182, 0.34581696665965683, 0.36982983491413496, 0.394455794287552, 0.4197139228812336, 0.44564199741037275, 0.4723190090623474, 0.5000000572130084, 0.5276809909376533, 0.5543580025896278, 0.5802860771187669, 0.6055442057124484, 0.6301701650858652, 0.6541830333403433, 0.6775911654909819, 0.7003958108494828, 0.7225929837356684, 0.7441745013550876, 0.7651285721096447, 0.785440115351841, 0.8050909050513173, 0.8240595867001241, 0.84232159371373, 0.8598489760434653, 0.876610144866246, 0.8925695306235529, 0.9076871459740083, 0.9219180395035779, 0.9352116195773232, 0.9475108197793346, 0.9587510670762303, 0.9688589999316335, 0.9777508643124241, 0.9853304881561681, 0.9914866951742183, 0.996089960021368, 0.9989880175696839, 1 ] ``` Note that the duplicate 1 at the end is now gone. This is because previously when it accumulated dt for 60 frames. dt wasn't quite exactly 1000, it was instead 999.9999999999999 and so didn't break out of the loop when it should have. This adds a tolerance so that it does break out of the loop. Reviewed By: dimach1977 Differential Revision: D17828204 fbshipit-source-id: 4483303de852071436cf9a82e50296baf3392329 * Fix ref type for Native Scroll View Summary: These types were wrong, this is a HostComponent, not a ReactNative.NativeComponent Reviewed By: lunaleaps Differential Revision: D17862305 fbshipit-source-id: e1e7acc7a5892f124b07cdc39d73d6ce7d414063 * Fix selecting videos from library in iOS 13 Summary: In iOS 13, Apple made a change that results in video URLs returned by UIImagePickerController becoming invalidated as soon as the info object from the delegate callback is released. This commit works around this issue by retaining these info objects by default and giving the application a way to release them once it is done processing the video. See also https://stackoverflow.com/questions/57798968/didfinishpickingmediawithinfo-returns-different-url-in-ios-13 Reviewed By: olegbl, mmmulani Differential Revision: D17845889 fbshipit-source-id: 12d0e496508dafa2581ef12730f7537ef98c60e2 * Fix bug in iOS13 nested text rendering Summary: This fixes a bug reported by Oculus and OSS. https://github.com/facebook/react-native/issues/26577 When rendering images nested in a `<Text/>` node, on the native side, `RCTTextShadowView` adds an empty NSTextAttachment to the attributed string to add some extra space. The image is then overlaid in the empty space . This all works fine and dandy on iOS12 and below. Starting in iOS13, an empty NSTextAttachment doesn't render as blank space. It renders as the "missing image" white page. When the real image is overlaid on the white page, it looks super broken. See github issue and test plan for examples. This fix is to assign an empty image to `NSTextAttachment`. I tried seeing if there was any other attribute we could use to just add white space to an attributed string, but this seems like the best one. Changelog: [iOS][Fixed] Fixed bug rendering nested text on iOS13 Reviewed By: xyin96 Differential Revision: D18048277 fbshipit-source-id: 711cee96934fc1937d694621a4417c152dde3a31 * Revert "Fix ref type for Native Scroll View" This reverts commit db662af5b28d0ad42abd1da67c32f2c38ff04900. * Invalidate cache * [0.61.3] Bump version numbers * Revert release and remove extraneous commits This reverts commit 7fa3eef2a11b094a59a43fb7db4ba5edb9ccdff5. * Revert "Fix exception in scrollResponderScrollNativeHandleToKeyboard when ref is null" This reverts commit 0da6a9bb45dc085db701de06ac354538e6814c64. * Revert "Migrate scrollResponderScrollNativeHandleToKeyboard function to take nativeRef" This reverts commit 09c4e7caf053d593d897f80ccd9df8f5bf96252b. * Revert "Improve Flow Type for ScrollResponder" This reverts commit 54bf3ae1cfaf49562d60ebf06386c157fc27131e. * [0.61.3] Bump version numbers * Bump react to 16.9.0 (#27060) * Bump react to 16.9.0 * Update package.json * might as well do everything * Update package.json * fix build with hermes on windows (#26556) Summary: On the Windows platform, with hermes-engine enabled, the assembly crashes with an error: ![image](https://user-images.githubusercontent.com/8634793/65568495-ab11d980-df8c-11e9-83a0-2a2d26447860.png) The problem lies in calling hermes command without the leading arguments `"cmd", "/c"` ([react.gradle, line: 152](https://github.com/facebook/react-native/blob/e028ac7af2d5b48860f01055f3bbacf91f6b6956/react.gradle#L152) ) ## Changelog [General] [Fixed] - Added a platform check and running commandLine with the corresponding arguments Pull Request resolved: https://github.com/facebook/react-native/pull/26556 Test Plan: Under Windows, enable hermes-engine in _build.gradle_ and run the `gradlew assembleRelease` or `gradlew bundleRelease` command Also check assembly on other available platforms Differential Revision: D17587023 Pulled By: cpojer fbshipit-source-id: bab10213b23fac5ab6a46ac4929759dcd43e39c2 * Don't wrap console methods for metro logging in Chrome debugger (#26883) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/26883 This diff fixes an issue reported in https://github.com/facebook/react-native/issues/26788 where logs in the Chrome console were showing a different location than previous versions. In the change here, we stop wrapping the console functions to attach the metro websocket in any environment that isn't a native app environment. We do this by checking `global.nativeLoggingHook` which is bound only by native apps and not environments like the Chrome DevTools. Changelog: [General][Fixed] - Fix wrong lines logging in Chrome debugger Reviewed By: cpojer, gaearon Differential Revision: D17951707 fbshipit-source-id: f045ea9abaa8aecc6afb8eca7db9842146a3d872 * Reverts "Timing: Fixes timer when app get into background (#24649)" (#27065) This reverts commit 338298417f8077dee177057c57b38671b4ec8c75 * [0.61.4] Bump version numbers * fix: Bundle assets in monorepo (#26940) Summary: In monorepo environment, `metro` isn't able to resolve `react-native` because the path to it is hardcoded. I've also added `packagingOptions` to RNTester to make Android builds work for me. Let me know if this is something that is only specific to my setup, and shouldn't be added. ## Changelog [Android] [Fixed] - Fix `bundleReleaseJsAndAssets` in monorepo env Pull Request resolved: https://github.com/facebook/react-native/pull/26940 Test Plan: - [x] - Works in monorepo setup on MacOS - [x] - Works with RNTester app Differential Revision: D18323703 Pulled By: cpojer fbshipit-source-id: b8eb15dfd8a32ae11fd862fc725af9cffea2cf96 * Fix multiple `set-cookie` not aggregated correctly in response headers (#27066) Summary: Multiple `set-cookie` headers should be aggregated as one `set-cookie` with values in a comma separated list. It is working as expected on iOS but not on Android. On Android, only the last one is preserved The problem arises because `NetworkingModule.translateHeaders()` uses `WritableNativeMap` as the translated headers but uses both native and non-native methods. The mixup causes out of sync data that both sets of methods do no agree. A simple fix is to use `Bundle` as the storage and only convert it to `WritableMap` at the end in one go Related issues: https://github.com/facebook/react-native/issues/26280, https://github.com/facebook/react-native/issues/21795, https://github.com/facebook/react-native/issues/23185 ## Changelog [Android] [Fixed] - Fix multiple headers of the same name (e.g. `set-cookie`) not aggregated correctly Pull Request resolved: https://github.com/facebook/react-native/pull/27066 Test Plan: A mock api, https://demo6524373.mockable.io/, will return 2 `set-cookie` as follows: ``` set-cookie: cookie1=value1 set-cookie: cookie2=value2 ``` Verify the following will print the `set-cookie` with a value `cookie1=value1, cookie2=value2` ```javascript fetch('https://demo6524373.mockable.io/') .then(response => { console.log(response.headers); }); ``` On iOS, `set-cookie` will have `cookie1=value1, cookie2=value2` while on Android it will have `cookie2=value2` (preserving only the last one) Differential Revision: D18298933 Pulled By: cpojer fbshipit-source-id: ce53cd41d7c6de0469700617900f30a7d0914c26 * - Bump CLI to ^3.0.0 (#27235) Summary: Upgrading CLI to latest. It's likely not yet compatible with master, because we depend on Metro 0.56, and master is on 0.57. This diff is intended to be cherry-picked to 0.61 and 0.62. cc grabbou ## Changelog [Internal] [Changed] - Bump CLI to ^3.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/27235 Test Plan: None Differential Revision: D18527709 Pulled By: cpojer fbshipit-source-id: 44448058c48a66d22a1d71abdc908f532f5aa547 * [0.61.5] Bump version numbers * Create and checkout branch for 0.61 merge: fb61merge * Fix up some basic merge issues with config files * Mostly fixing bad merges and podfile moves. Gets iOS building and some progress to getting macOS built * JS is not lint free. * iOS RNTester booting * Update test snapshot files * Get macOS building. Mostly image-related fixup with high probability of regression. Also take the opportunity to remove some stuff from RCTUIKit to help de-monolithize it * Fix iOS build breaks from last commit * Fix minor yarn lint issues to bring yarn lint parity with facebook's 0.61-stable branch * RNTester booting, but UIView is now being rejected because generated view config doesn't match native. * Fix a few yarn flow-check-ios issues * Make iOS flow clean * RNTester mac booting * Fix all yarn flow-check-macos issues * Add macOS equivalents for new iOS bundles * Make Android pass flow check * Fixed merge conflict errors, updated upstream diff comments. * Fixed more merge comments * Fixed PaperUIManager.js to add 'ios' || 'macos' case. Enabled building of RCTSurface for macos. * Fix macOS unit tests. * All macOS tests passing * Updated build scripts to build and test via Pods. * Fix lint and flow errors * Fix pod install * Change files * Fix build script to specify RNTesterPods.xcworkspace * Fix Release * Change files * Remove beachball change files. * Fix beachball to exclude internal packages * Fix react-native-macos-init * Fix react-native run-macos * Fix react-native-xcode.sh to work in repo and out of repo. * Fix RedBox * Synchronize android sources under ReactAndroid & ReactCommon with RNv0.61.5 .. This builds a clean base upon which all the patches will be rebased .. * Patches for some of the basic build customizations. Includes (1) Nuget step configuration files (2) build param to support excluding all SOs from library archives * Exclude package from beachball * Fixing the nuget configuration patches.. which was badly created last time * V8Integration patches * Changing patching command in pipeline definitions to only apply rebased patches * Consuming downloaded third party packages for folly, glog, double-conv and boost * Fixing the pipeline hacky step to update the POM file Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Eli White <eliwhite@fb.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Thibault Malbranche <thibault.malbranche@epitech.eu> Co-authored-by: Michał Osadnik <osdnk@fb.com> Co-authored-by: Florian Cargoët <florian.cargoet@gmail.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: sunnylqm <sunnylqm@qq.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Rodinei Fagundes <rodinei.jf@gmail.com> Co-authored-by: Kid Commit <26439946+ferdicus@users.noreply.github.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: Brian Vaughn <bvaughn@fb.com> Co-authored-by: Logan Daniels <logand@fb.com> Co-authored-by: David Aurelio <davidaurelio@fb.com> Co-authored-by: Adlai Holler <adlai@google.com> Co-authored-by: Onti Vals <ontiv@microsoft.com> Co-authored-by: Dan Abramov <gaearon@fb.com> Co-authored-by: Sidharth Guglani <sidharthguglani@fb.com> Co-authored-by: Bruno Lemos <brunohplemos@gmail.com> Co-authored-by: Kant <quent92100@gmail.com> Co-authored-by: Scott Rice <srice@fb.com> Co-authored-by: Avik Chaudhuri <avik@fb.com> Co-authored-by: justin ross <ross.justin.t@gmail.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Vojtech Novak <vonovak@gmail.com> Co-authored-by: Oleksandr Melnykov <omelnykov@fb.com> Co-authored-by: iyegoroff <iegoroff@gmail.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Ram N <axe@fb.com> Co-authored-by: Spencer Ahrens <sahrens@fb.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: empyrical <empyrical@outlook.com> Co-authored-by: Adam Ernst <adamjernst@fb.com> Co-authored-by: jsfu <sen870825@qq.com> Co-authored-by: Rodrigo Salazar <rodrigos@fb.com> Co-authored-by: Pascal Hartig <phartig@rdrei.net> Co-authored-by: Peter Argany <petetheheat@fb.com> Co-authored-by: Marc Horowitz <mhorowitz@fb.com> Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Mehdi Mulani <mehdi@fb.com> Co-authored-by: SachinTotale <sachin.totale@servicemax.com> Co-authored-by: James Treanor <jtreanor3@gmail.com> Co-authored-by: Max Thirouin <git@moox.io> Co-authored-by: Gabriel Furini <gabrielfurini@gmail.com> Co-authored-by: REDMOND\acoates <acoates@microsoft.com> Co-authored-by: Alexander Kawrykow <akawry@fb.com> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Frieder Bluemle <frieder.bluemle@gmail.com> Co-authored-by: Krzysztof Magiera <krzys@swmansion.com> Co-authored-by: Tom Targosz <tom.targosz@yahoo.com> Co-authored-by: Pavlos Vinieratos <pvinis@gmail.com> Co-authored-by: Miguel Alatzar <this.migbot@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: gaodeng <gaodengming@gmail.com> Co-authored-by: Alaa Ben El Ahmar <alaa.benelahmar@qucit.com> Co-authored-by: Martin Sherburn <mns@oculus.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: Ilia Burdukovski <ilia.burdukovski@ya.ru> Co-authored-by: Radek Czemerys <radko93@gmail.com> Co-authored-by: Kacper Wiszczuk <kacperwiszczuk@gmail.com> Co-authored-by: Vincent Cheung <vincent.cheung@rea-group.com> Co-authored-by: Anand Rajeswaran <anand.rajeswaran@outlook.com> Co-authored-by: Anandraj Govindan <anandrag@microsoft.com>
2020-04-28 21:49:15 +03:00
* @format
*/
import type {TurboModule} from '../TurboModule/RCTExport';
import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry';
export interface Spec extends TurboModule {
+getConstants: () => {|
ERROR_CODE_EXCEPTION: number,
ERROR_CODE_VIEW_NOT_FOUND: number,
|};
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
+onSuccess: (data: string) => void;
Merge react-native 0.61-stable (#323) * Expose JS Responder handler in Scheduler API Summary: This diff implements the JSResponderHandler methods in the core of RN (scheduler API and friends) Reviewed By: ejanzer Differential Revision: D16543437 fbshipit-source-id: dac03e30c4330d182ecf134f3174ba942dbf7289 * Implement JS Responder Handler in Fabric Android Summary: This diff implements the JSResponderHandler in Fabric Android code Reviewed By: JoshuaGross Differential Revision: D16543438 fbshipit-source-id: 13680f77a5368e8ba1180383a5f9fb7d7330b90a * Implement JNI code to invoke Android JSResponder methods from C++ Summary: This diff implements the JNI code required for Android to receive JSResponderHandler calls Reviewed By: JoshuaGross, makovkastar Differential Revision: D16543431 fbshipit-source-id: 38cff16a05633fccefa201b189d761d503a9b839 * Change AndroidDrawerLayoutNativeComponent to use JS codegen for commands Summary: `codegenNativeCommands` returns an object with functions for each command that has the previous behavior inside the React Renderer, and the new Fabric logic inside of the Fabric React Native Renderer. Changelog: [Internal] - Change AndroidDrawerLayoutNativeComponent to use JS codegen for commands Reviewed By: rickhanlonii Differential Revision: D16529887 fbshipit-source-id: 24a5307944a7f62e18482d60d26052fea3be2051 * Update commands transform to use helper Summary: This uses a new helper called `dispatchCommand` that now exists on the renderer. This was added to the renderer here: https://github.com/facebook/react/pull/16085 In Paper it calls UIManager.dispatchViewManagerCommand and in Fabric it calls the c++ Fabric UIManager Reviewed By: rickhanlonii Differential Revision: D16578708 fbshipit-source-id: 30f9468a7fd48afb506c0ee49a460b949bc863a1 * Delete jsi::Functions before jsi::Runtime gets deleted Summary: ## The Problem 1. `CatalystInstanceImpl` indirectly holds on to the `jsi::Runtime`. When you destroy `CatalystInstanceImpl`, you destroy the `jsi::Runtime`. As a part of reloading React Native, we destroy and re-create `CatalystInstanceImpl`, which destroys and re-creates the `jsi::Runtime`. 2. When JS passes in a callback to a TurboModule method, we take that callback (a `jsi::Function`) and wrap it in a Java `Callback` (implemented by `JCxxCallbackImpl`). This Java `Callback`, when executed, schedules the `jsi::Function` to be invoked on a Java thread at a later point in time. **Note:** The Java NativeModule can hold on to the Java `Callback` (and, by transitivity, the `jsi::Function`) for potentially forever. 3. It is a requirement of `jsi::Runtime` that all objects associated with the Runtime (ex: `jsi::Function`) must be destroyed before the Runtime itself is destroyed. See: https://fburl.com/m3mqk6wt ### jsi.h ``` /// .................................................... In addition, to /// make shutdown safe, destruction of objects associated with the Runtime /// must be destroyed before the Runtime is destroyed, or from the /// destructor of a managed HostObject or HostFunction. Informally, this /// means that the main source of unsafe behavior is to hold a jsi object /// in a non-Runtime-managed object, and not clean it up before the Runtime /// is shut down. If your lifecycle is such that avoiding this is hard, /// you will probably need to do use your own locks. class Runtime { public: virtual ~Runtime(); ``` Therefore, when you delete `CatalystInstanceImpl`, you could end up with a situation where the `jsi::Runtime` is destroyed before all `jsi::Function`s are destroyed. In dev, this leads the program to crash when you reload the app after having used a TurboModule method that uses callbacks. ## The Solution If the only reference to a `HostObject` or a `HostFunction` is in the JS Heap, then the `HostObject` and `HostFunction` destructors can destroy JSI objects. The TurboModule cache is the only thing, aside from the JS Heap, that holds a reference to all C++ TurboModules. But that cache (and the entire native side of `TurboModuleManager`) is destroyed when we call `mHybridData.resetNative()` in `TurboModuleManager.onCatalystInstanceDestroy()` in D16552730. (I verified this by commenting out `mHybridData.resetNative()` and placing a breakpoint in the destructor of `JavaTurboModule`). So, when we're cleaning up `TurboModuleManager`, the only reference to a Java TurboModule is the JS Heap. Therefore, it's safe and correct for us to destroy all `jsi::Function`s created by the Java TurboModule in `~JavaTurboModule`. So, in this diff, I keep a set of all `CallbackWrappers`, and explicitly call `destroy()` on them in the `JavaTurboModule` destructor. Note that since `~JavaTurboModule` accesses `callbackWrappers_`, it must be executed on the JS Thread, since `createJavaCallbackFromJSIFunction` also accesses `callbackWrappers_` on the JS Thread. For additional safety, I also eagerly destroyed the `jsi::Function` after it's been invoked once. I'm not yet sure if we only want JS callbacks to only ever be invoked once. So, I've created a Task to document this work: T48128233. Reviewed By: mdvacca Differential Revision: D16623340 fbshipit-source-id: 3a4c3efc70b9b3c8d329f19fdf4b4423c489695b * Fix missing rotateZ to useAnimatedDriver Whitelist (#25938) Summary: Added missing property to whitelist ## Changelog [General] [Fixed] - Fixed rotateZ native animation Pull Request resolved: https://github.com/facebook/react-native/pull/25938 Differential Revision: D16645798 Pulled By: cpojer fbshipit-source-id: ef74d7230fa80068dcceaaff841af27365df92e9 * Back out "[react-native][PR] Allow Animation EndResult callback to return Promise" Summary: Original commit changeset: 420d29d262b6 Reverts https://github.com/facebook/react-native/pull/25793 / D16515465 Union type property is not supported by codegen. We don't want to support unions yet and because the improvement is not that big and not yet published as stable for OSS (neither used anywhere internally) we can safely revert it. Reviewed By: RSNara Differential Revision: D16621228 fbshipit-source-id: 2fa416eef1ae353990860026ca97d2b0b429a852 * Switch Platform Constansts to use typedConstants structs Summary: It's actually the first module in OSS which is typed with taking advantages of codegen. Reviewed By: RSNara Differential Revision: D16620334 fbshipit-source-id: 65d6656506f2a4c68d493939ecfa65ba975abead * Fixed android bounding box (#25836) Summary: This PR fixes https://github.com/facebook/react-native/issues/19637. Summary of the issue: on Android, transformed touchables have press issues because the touchable's measurements are incorrect in the release phase. `UIManager.measure()` returns an incorrect size and position as explained [here](https://github.com/facebook/react-native/issues/19637#issuecomment-396065914) This is easily seen with the inspector : **Screenshot of a { scale: 2 } transform** The real view (scaled) is in pink, the incorrect touchable area is in blue. <img src="https://user-images.githubusercontent.com/110431/41190133-8d07ad02-6bd9-11e8-873d-93776a007309.png" width="200"/> **Screenshot of a { rotateZ: "-45deg" } transform** The real view (rotated) is in pink, the incorrect touchable area is in blue. <img src="https://user-images.githubusercontent.com/110431/41190136-a1a079a6-6bd9-11e8-906d-729015bcab6b.png" width="200"/> ## Changelog [Android] [Fixed] - Fix UIManager.measure() Pull Request resolved: https://github.com/facebook/react-native/pull/25836 Test Plan: Android now produces the same results as iOS as seen on these screenshots | Android without fix | Android with fix | iOS | | --- | --- | --- | | ![Screenshot_1564133103](https://user-images.githubusercontent.com/110431/61941632-28729b00-af98-11e9-9706-b13968b79df5.png) | ![Screenshot_1564130198](https://user-images.githubusercontent.com/110431/61941631-28729b00-af98-11e9-9ff3-5f2748077dbe.png) | ![Simulator Screen Shot - iPhone X - 2019-07-26 at 11 19 34](https://user-images.githubusercontent.com/110431/61941633-28729b00-af98-11e9-8dc4-22b61178242e.png) | Reviewed By: cpojer Differential Revision: D16598914 Pulled By: makovkastar fbshipit-source-id: d56b008b717ea17731fb09001cbd395aa1b044fe * Fix crash when tapping full screen button on video ad Summary: Fragment was assigned incorrect `tag` and `surfaceID` (`surfaceID` is the important one). Wrong `surfaceID` means that `navigationCoordinator` is never resolved. As a result of navigationCoordinator not being assigned, tapping a video ad on Marketplace results in showing video ad overlay rather than showing full screen video. Reviewed By: JoshuaGross Differential Revision: D16646492 fbshipit-source-id: 0da5c56ecb7c81e9f4a9469a3626ccd430a01558 * Pop frames correctly in console.error handler Reviewed By: cpojer Differential Revision: D16648992 fbshipit-source-id: 4581e2cd6859f27bc384fc3ab328ab5b9414c704 * Fix up NativeDialogManagerAndroid PR Summary: This diff has three changes: 1. Remove all references to `Stringish` from `NativeDialogManagerAndroid`. (All Fbt objects expose a `.toString` method we could call). 2. Make sure that we only access `DialogManagerAndroid` through `NativeDialogManagerAndroid`. 3. Removed a bunch of `$FlowFixMes` in the files I touched. Probably not the best idea to bite into this cleanup on this diff, but what's done is done. Since this diff is fairly large, I've commented on parts of it I thought were note-worthy. I've also commented on the changes I had to make to fix flow after removing the `$FlowFixMe`s. Reviewed By: PeteTheHeat Differential Revision: D16428855 fbshipit-source-id: 0e6daf2957f4b086ebb1e78e0a59930668c65576 * Bump hermes to v0.1.1 (#25908) Summary: Hermes has been updated to [v0.1.1](https://github.com/facebook/hermes/releases/tag/v0.1.1) and [renamed from 'hermesvm' to 'hermes-engine'](https://github.com/facebook/hermes/commit/c74842ee5c4d11dc9fe3bf012f97a0e3fde6d54f) ## Changelog [Android] [Changed] - Bump hermes to v0.1.1 Pull Request resolved: https://github.com/facebook/react-native/pull/25908 Test Plan: RNTester builds and runs as expected Differential Revision: D16645811 Pulled By: cpojer fbshipit-source-id: 4fb6a3160df2c6d08140dd1fee51acf9ff8baffc * Fabric PerfLogger: prevent ConcurrentModificationException Summary: Some surfaces throw ConcurrentModificationException when logging detailed perf for Fabric. I've refactored the ReactMarker class to use a threadsafe ArrayList and removed synchronization, which is safer and should improve perf everywhere the markers are used, even if there are zero listeners. Reviewed By: mdvacca Differential Revision: D16656139 fbshipit-source-id: 34572f9ad19028a273e0837b0b895c5e8a47976a * iOS fixed up inconsistent boolean convertion logic in RCTPlatform Summary: For some reason the conversion from a BOOL object to `bool` (C++ style) may lead to incorrect boolean value. This fixes the value provided to the builder to be of `bool` type instead. Reviewed By: JoshuaGross Differential Revision: D16657766 fbshipit-source-id: b66922aceadd20d16226a07f73b24ee0a3b825dc * Add ErrorUtils to global variables (#25947) Summary: ErrorUtils is giving an error by eslint. ('ErrorUtils is not defined'). ## Changelog [General] [Fixed] - Add ErrorUtils to eslint globals Pull Request resolved: https://github.com/facebook/react-native/pull/25947 Test Plan: Run eslint on a react native project using ErrorUtils. Eslint verification should pass. Differential Revision: D16666163 Pulled By: cpojer fbshipit-source-id: c20c4e21fe06c6863dcfc167d6d03c6217ae1235 * Update App.js (#25905) Summary: use "shorthand" of `Fragment` No need to import `Fragment` as it can be used via `<></>` vs `<Fragment><Fragment />` ## Changelog Use shorthand for Fragment in App.js [General] [Changed] - Use shorthand for Fragment in App.js Pull Request resolved: https://github.com/facebook/react-native/pull/25905 Test Plan: Ci Tests should be sufficient Differential Revision: D16666166 Pulled By: cpojer fbshipit-source-id: 70e2c9793087bf8f5e0a5477c75f178134cbd6a1 * Fix error string in codegenNativeComponent Summary: This diff fixes the error message in the codegenNativeComponent fallback Reviewed By: TheSavior Differential Revision: D16579775 fbshipit-source-id: 176f81ea91e11f671407a5e5e5b000c4b83f93b2 * Remove outdated React async component check Summary: I added this check [a couple of years ago](https://github.com/facebook/react-native/commit/1b22d49ae8945680dee4fd01e3fbb78b1e443e01) to mimic how [React used to check for async roots](https://github.com/facebook/react/blob/acabf112454e5545205da013266d8529599a2a82/packages/react-reconciler/src/ReactFiberReconciler.js#L321-L330). This code doesn't make sense anymore since there's neither an async base class or an `unstable_ConcurrentMode` export, so I'm just cleaning it up. Reviewed By: threepointone, sebmarkbage Differential Revision: D16668567 fbshipit-source-id: 5ccf5feccc4b65ffb3aeb0a09891d8be7490df26 * Add tests for codegenNativeComponent Summary: Adds tests for codegenNativeComponent Reviewed By: TheSavior Differential Revision: D16582627 fbshipit-source-id: 3527126c7838f3e2c0c56b19956c618f0a7fb9f9 * Update loading pre-bundled message Summary: Updated the message from > Loading from pre-bundled file to > Connect to Metro to develop JavaScript I also added a new RCT_PACKAGER_NAME so other packagers can override "Metro" Reviewed By: yungsters, cpojer Differential Revision: D16427501 fbshipit-source-id: 1b7f9e261f7521ba930c6248087fe6f3c3659cb7 * Add $FlowFixMeEmpty to suppressions in RN's .github.flowconfig Summary: The types-first codemod adds a few of these, so need to sync the suppressions here with the ones in xplat/js/.flowconfig Reviewed By: jbrown215 Differential Revision: D16690168 fbshipit-source-id: 49d3f80a4ab24badf11a9ac54abfe49670989a91 * Add portable bit field implementation Summary: @public Our usage of C++ bit fields has lead to quite some problems with different compiler setups. Problems include sign bits, alignment, etc. Here we introduce a portable implementation as a variadic template, allowing the user to store a number of booleans and enums (defined with `YG_ENUM_SEQ_DECL`) in an unsigned integer type of their choice. This will replace all usages of bit fields across the Yoga code base. Differential Revision: D16647801 fbshipit-source-id: 230ffab500885a3ad662ea8f19e35a5e9357a563 * Remove style property bitmask Summary: @public Removes the style properties bitmask. We have used this for experimentation, and it's no longer necessary. This simplifyies the code, and allows us to cut over to `Bitfield.h` more easily. Reviewed By: astreet Differential Revision: D16648862 fbshipit-source-id: 17c0899807af976f4ba34db54f8f0f6a3cd92519 * Use `Bitfield` in `YGNode` and `YGStyle` Summary: @public Replaces the usage of C++ bitfields with our portable `Bitfield` class. Reviewed By: SidharthGuglani Differential Revision: D16649875 fbshipit-source-id: 539f016d5e1c9a8c48cc9bacbbf6ed985e385e69 * Use `Bitfield` in `YGLayout` Summary: Replaces the usage of C++ bitfields with our portable `Bitfield` class. Reviewed By: SidharthGuglani Differential Revision: D16656361 fbshipit-source-id: 05f679e2e994e109b2bd1090c879d6850fabdc40 * Back out "[Yoga] Experiment: double invocations of measure callbacks" Summary: Removes the double measure callbacks experiment Original commit changesets: c6cf9c01a173, b157d8137c72 Reviewed By: SidharthGuglani Differential Revision: D16687367 fbshipit-source-id: 9649f8731bd1b27f4d291cee4fa30153165cea02 * Don't copy children in YGNodeComputeFlexBasisForChildren (#919) Summary: No need for a copy here. Pull Request resolved: https://github.com/facebook/yoga/pull/919 Differential Revision: D16701461 Pulled By: davidaurelio fbshipit-source-id: 3a90adbb2b5c43d5aefe693a8525aa3a37e53b3d * React edit text changes (#25964) Summary: Changing showSoftKeyboard and hideSoftKeyboard to be protected, as we need this change for an internal control that extends ReactEditText. ## Changelog [Android] [Changed] - part of our react native platform, we have a control that extends ReactEditText and we need to be able to override these 2 methods. Pull Request resolved: https://github.com/facebook/react-native/pull/25964 Test Plan: The change has been in Microsoft's branch of RN for almost 2 years, and since it's a relatively small change we've done a quick sanity check in RNTester prior to this PR, making sure the TextInput page loads fine and it's functional. Differential Revision: D16686878 Pulled By: cpojer fbshipit-source-id: 63035ee9c58e93bc0fa40e5bec318df05322c6c5 * Fix Fast Refresh on Fabric Summary: Brings in https://github.com/facebook/react/pull/16302. We were passing roots to a wrong renderer, hence a confusing Fabric-only crash. Reviewed By: JoshuaGross Differential Revision: D16672454 fbshipit-source-id: 115894eb375b50da09d145c57f15c7d5668b926d * iOS: Revert RCT->RN prefix renaming to avoid confusion Summary: The previous rename from RCT->RN prefix ended up causing some confusions on which prefix to use for which files and under what circumstances. To avoid further confusion before we're done with the re-architecture project, let's keep them as RCT. Reviewed By: mdvacca Differential Revision: D16705566 fbshipit-source-id: 395bff771c84e5ded6b2261a84c7549df1e6c5e5 * use array for passing measure callback reasons count Summary: Use an array for counting measure callbacks due to each reason. and this is now added as qpl metadata in Layout Calculation qpl event Reviewed By: davidaurelio Differential Revision: D16666786 fbshipit-source-id: ff85fba835148f06b9c5d90c4604e552a813777a * Commands codegen: added RCT prefix for protocols, extern C functions, and file names Summary: This will provide consistency with the rest of ObjC/ObjC++ files throughout RN codebase, which is also part of the iOS engineering practice to have a prefix. Highlights: * This only affects the `protocol` and extern C functions, and the .h output file name * Other C++ only file/classes are not affected * The assumption is that the RCT prefix is only for iOS specific files/names. The JS component name should **NOT** have any prefix in the long term (some of them still have RCT prefix in the name, which was an artifact of legacy inconsistency). * The RCT prefix is not relevant to Java/JNI code, since they have their own convention Reviewed By: TheSavior, mdvacca Differential Revision: D16661286 fbshipit-source-id: b8dd75fa7f176d6658183f225b27db017b4b55e7 * Add support for casting codegenNativeComponent Summary: Adds support for casting the codegenNativeComponent export Reviewed By: TheSavior Differential Revision: D16676207 fbshipit-source-id: 5e874bd5a72eb7e67e05b0f671856ae3319a335e * Format code in ReactCommon/turbomodule/core Summary: Just ran `arc f ReactCommon/turbomodule/core/**/*`. Reviewed By: ejanzer Differential Revision: D16691807 fbshipit-source-id: 3f499ffeffaae47bda550c0071c93cd7f48e2a23 * Refactor TextInput.js passes strings to Java for autoCapitalize Summary: We are working to remove constants from the view configs. On June 21st I modified native to support both numbers and strings. D15911323 Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D16697916 fbshipit-source-id: f346f37b2e664c2dd49e2a1308a0517f50284e4d * Minor improvements in native modules codegens Summary: Add handling of `$ReadOnly`, $ReadOnlyArray`. Drop handling of params for callback (does not impact native generated node) and promises' types (does not impact native generated node). Remove typo from native codegen. Reviewed By: RSNara Differential Revision: D16686886 fbshipit-source-id: 26345978bbbba0cee14d00e7b5b9e5017c89a46c * Add handling of nullable return value Summary: Retuned value can be nullable and it need to be handled Reviewed By: RSNara Differential Revision: D16687359 fbshipit-source-id: 7869c4e2b1da69b680b6eade3c88e0558077b705 * fallback not understandable types from methods to object Summary: We don't want to make our codegen breaking if type is not existing. In order to it we can always fallback to Object. That's how it currently works in old codegen #Facebook Thare're few places in our internal code where we use `Map` or tuple in these cases Reviewed By: RSNara Differential Revision: D16687360 fbshipit-source-id: bf8aafd3254fc7e18ad0d58ad1a29e2beeb15bf0 * change name convention for modules Summary: Following our internal discussion we want to change previously used name convention. Now it looks like: ``` #import <FBReactNativeTestSpec/FBReactNativeTestSpec.h> ``` Name is a param of `rn_codegen` and `rn_library`. Also, I found it the easiest to move replacing `::_IMPORT_::` into buck rule Reviewed By: fkgozali Differential Revision: D16646616 fbshipit-source-id: 2c33c5b4d1c42b0e6f5a42d9a318bd8bda9745f4 * Add pointer to generated id<NSObject> Summary: It should always be a pointer, sorry! Reviewed By: RSNara Differential Revision: D16689608 fbshipit-source-id: f67d2606b5bdc169d312c1c75748c390ee5e56ed * Fix veryfying exports in module codegen Summary: If was breaking in cases like ``` export { x as default } ``` Reviewed By: RSNara Differential Revision: D16689606 fbshipit-source-id: 2583c73c5ac06ea0fa8666d219e739e68fc75b12 * DrawerLayoutAndroid drawerPosition now expects a string, number is deprecated Summary: The native change to support strings was made in D15912607 on June 21st. Migrating the JS callsites now to start passing strings instead of the constants. Reviewed By: zackargyle, mdvacca Differential Revision: D16703569 fbshipit-source-id: cb1d8698df55d2961cde1e2b1fbfcba086a03bb2 * Introduce NativeBugReporting Summary: This diff introduces `NativeBugReporting` and eliminates all uses of `NativeModules.BugReporting` from our codebase. Reviewed By: ejanzer Differential Revision: D16717540 fbshipit-source-id: 67b8620ba9dd4b41557ae042c30bdc521e927d30 * Introduce NativeFrameRateLogger Summary: This diff introduces `NativeFrameRateLogger` and eliminates all usages of `NativeModules.FrameRateLogger` from our codebase. Reviewed By: ejanzer Differential Revision: D16718105 fbshipit-source-id: caf903162bab978ee1b3faef56aedef6ada75b89 * Fix forceUpdate method on useWindowDimensions (#25990) Summary: useState won't trigger re-renders if the value passed is the same. ## Changelog [Internal] [Fixed] - Fix forceUpdate method on useWindowDimensions Pull Request resolved: https://github.com/facebook/react-native/pull/25990 Test Plan: Codesandbox: https://codesandbox.io/embed/elegant-cori-0ixbx Differential Revision: D16723962 Pulled By: sahrens fbshipit-source-id: 8a46152908a90553151e0353bbfd8c2e64cfd2af * Update regex used to check for codegenNativeComponent Summary: Updates regex to allow for type casts Reviewed By: TheSavior Differential Revision: D16717249 fbshipit-source-id: f22561d5cd33ab129fc0af4490692344726d7d71 * Use eslint-plugin-prettier recommended config (#25674) Summary: I created a new test project today using RN 0.60.3 and saw that prettier is now used with eslint. After looking at the `react-native-community` eslint config, I notice that it wasn't using the [recommended configuration](https://github.com/prettier/eslint-plugin-prettier#recommended-configuration) of `eslint-plugin-prettier` This PR adds the `eslint-config-prettier` to avoid conflicts between eslint and prettier, it also adds the `prettier/react` config to avoid problems with the `eslint-plugin-react`. ## Changelog [General] [Changed] - Use eslint-plugin-prettier recommended config Pull Request resolved: https://github.com/facebook/react-native/pull/25674 Test Plan: - ✅ Ensure there is no difference on this repo (no ESLint errors, same number of warnings, and no changes when running prettier). Differential Revision: D16666178 Pulled By: cpojer fbshipit-source-id: 70f81db793866acc88388b7b00a496aab5e0b156 * Codemod fbandroid// => //fbandroid/ in xplat/js/ Reviewed By: zertosh Differential Revision: D16710441 fbshipit-source-id: 610e0330c486e716a61b31a8198c05aa50a261cf * Manual fixes for xplat/js/react-native-github Summary: Need to add explicit type annotations in these areas to unblock types-first architecture for Flow. These are locations the codemod could not automatically handle. I'll call out areas I need a close eye on in the comments. Reviewed By: panagosg7 Differential Revision: D16659053 fbshipit-source-id: 167dd2abe093019b128676426374c1c62cf71e7f * xplat/js/react-native-github Reviewed By: panagosg7 Differential Revision: D16657770 fbshipit-source-id: 4e260842c838a35317515044c54ccf55a083da33 * Remove usage of NativeModules.AccessibilityManager Summary: We introduced NativeAccessibilityManager a while back. This diff makes sure that there are no usages of NativeModules.AccessibilityManager in our codebase. Reviewed By: ejanzer Differential Revision: D16714424 fbshipit-source-id: edebf0f7a0fab615aa1722406f9d538696bd65a0 * React sync for revisions 55bc393...85d05b3 Summary: This sync includes the following changes: - **[85d05b3a4](https://github.com/facebook/react/commit/85d05b3a4 )**: Bump package.json versions //<Andrew Clark>// - **[d9fdec6cf](https://github.com/facebook/react/commit/d9fdec6cf )**: [Flare] Remove contextmenu logic from Press (#16322) //<Dominic Gannaway>// - **[12be8938a](https://github.com/facebook/react/commit/12be8938a )**: [Fresh] Support multiple renderers at the same time (#16302) //<Dan Abramov>// - **[6f3c8332d](https://github.com/facebook/react/commit/6f3c8332d )**: Reset hydration state after reentering (#16306) //<Sebastian Markbåge>// - **[028c07f89](https://github.com/facebook/react/commit/028c07f89 )**: Ensure Fundamental flags are added to more locations (#16311) //<Dominic Gannaway>// - **[9dfe973b5](https://github.com/facebook/react/commit/9dfe973b5 )**: Nit: fix inconsistent spacing in a warning (#16310) //<Dan Abramov>// - **[c4f0b9370](https://github.com/facebook/react/commit/c4f0b9370 )**: Warn when Using String Refs (#16217) //<lunaruan>// - **[7c838a645](https://github.com/facebook/react/commit/7c838a645 )**: [Flare] Adds support for hydrating host components with listeners (#16304) //<Dominic Gannaway>// - **[ed4970079](https://github.com/facebook/react/commit/ed4970079 )**: [react-events] Separate the Focus/FocusWithin unit tests (#16298) //<Nicolas Gallagher>// - **[23405c9c4](https://github.com/facebook/react/commit/23405c9c4 )**: [react-events] Add ContextMenu responder (#16296) //<Nicolas Gallagher>// - **[606f76b6e](https://github.com/facebook/react/commit/606f76b6e )**: Fix hydration bug with nested suspense boundaries (#16288) //<Sebastian Markbåge>// - **[a1dbb852c](https://github.com/facebook/react/commit/a1dbb852c )**: warn if you try to use act() in prod (#16282) //<Sunil Pai>// - **[dc232e677](https://github.com/facebook/react/commit/dc232e677 )**: chore: remove outdated comment about gcc (#16232) //<Ashwin Ramaswami>// - **[6b565ce73](https://github.com/facebook/react/commit/6b565ce73 )**: Rendering tasks should not jump the queue (#16284) //<Andrew Clark>// - **[c4c9f086e](https://github.com/facebook/react/commit/c4c9f086e )**: BugFix: Suspense priority warning firing when not supposed to (#16256) //<lunaruan>// - **[05dce7598](https://github.com/facebook/react/commit/05dce7598 )**: Fix priority of clean-up function on deletion (#16277) //<Andrew Clark>// - **[a53f5cc22](https://github.com/facebook/react/commit/a53f5cc22 )**: [SuspenseList] Bug fix: Reset renderState when bailing out (#16278) //<Sebastian Markbåge>// - **[0c1ec049f](https://github.com/facebook/react/commit/0c1ec049f )**: Add a feature flag to disable legacy context (#16269) //<Dan Abramov>// - **[42794557c](https://github.com/facebook/react/commit/42794557c )**: [Flare] Tweaks to Flare system design and API (#16264) //<Dominic Gannaway>// - **[b5af4fe3c](https://github.com/facebook/react/commit/b5af4fe3c )**: Remove FocusScope (#16267) //<Dominic Gannaway>// - **[375616788](https://github.com/facebook/react/commit/375616788 )**: Add missing check to unmocked Scheduler warning (#16261) //<Andrew Clark>// - **[f939df402](https://github.com/facebook/react/commit/f939df402 )**: [act] Wrap IsThisRendererActing in DEV check (#16259) //<Andrew Clark>// - **[f440bfd55](https://github.com/facebook/react/commit/f440bfd55 )**: Bugfix: Effects should never have higher than normal priority (#16257) //<Andrew Clark>// - **[db3ae32b8](https://github.com/facebook/react/commit/db3ae32b8 )**: flush fallbacks in tests (#16240) //<Sunil Pai>// - **[e6a0473c3](https://github.com/facebook/react/commit/e6a0473c3 )**: Warn when rendering tests in concurrent/batched mode without a mocked scheduler (#16207) //<Sunil Pai>// - **[e276a5e85](https://github.com/facebook/react/commit/e276a5e85 )**: [Flare] Remove delay props from Hover (#16248) //<Nicolas Gallagher>// - **[1912b4a0f](https://github.com/facebook/react/commit/1912b4a0f )**: [Flare] Remove delay props from Press (#16247) //<Nicolas Gallagher>// Changelog: [General][Changed] - React sync for revisions 55bc393...85d05b3 Reviewed By: zackargyle, rickhanlonii Differential Revision: D16720468 fbshipit-source-id: 1884ef67f404623697f516cd77ad952d1fbb4737 * @allow-large-files flow 0.105 xplat deploy Summary: bypass-lint allow_many_files Reviewed By: jbrown215 Differential Revision: D16753543 fbshipit-source-id: 1db37b56c1bb84b547e302dfe13ea0c9787deace * chore: Link to CLA wiki and CLA form. (#26016) Summary: After reading [Contributing Guidelines](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#contributing-code), I found myself googling "react native cla", and figured it makes sense to include a link to the CLA alongside the guidelines. ## Changelog [Internal] [Changed] - Link to CLA Pull Request resolved: https://github.com/facebook/react-native/pull/26016 Test Plan: N/A Differential Revision: D16761411 Pulled By: cpojer fbshipit-source-id: 49912c9e32464725d9970f1a7a8bc483ee9f68ce * Fix indentation in Gradle files (#26012) Summary: Fixes indentation in `*.gradle` files by using four-space indents [as specified in `.editorconfig`](https://github.com/facebook/react-native/blob/0ccedf3964b1ebff43e4631d1e60b3e733096e56/.editorconfig#L13-L14). ## Changelog [Internal] [Fixed] - Fix indentation in Gradle files Pull Request resolved: https://github.com/facebook/react-native/pull/26012 Test Plan: Considering [the diff consists of whitespace changes only](https://github.com/facebook/react-native/compare/master...sonicdoe:gradle-indentation?w=1), I think this is safe to merge if the test suite passes. Differential Revision: D16761514 Pulled By: cpojer fbshipit-source-id: 9b035b5c6b35a70b2b54fe35416840fb90a0c6b1 * improve VirtualizedList error message (#25973) Summary: Motivation: when you receive error like `scrollToIndex out of range: 5 vs -1` it's not immediately clear if I requested 5 or -1. This will make the error a little easier to understand. ## Changelog not needed Pull Request resolved: https://github.com/facebook/react-native/pull/25973 Test Plan: not needed, tests must pass Differential Revision: D16708522 Pulled By: osdnk fbshipit-source-id: 8dfcbd95ff0f42805dbe32cd57969a93aea55add * Use ViewManagerDelegate if provided instead of $$PropsSetter to update view props Summary: This diff introduces an interface `ViewManagerDelegate` and its base implementation `BaseViewManagerDelegate`, which is used as a parent class for all view manager delegates generated by the JS codegen. Before the changes in this diff, generated delegates didn't support setting the base view properties such as background color, rotation, opacity, etc. Now it's possible to do by using `BaseViewManagerDelegate.setProperty(...)`, and since all generated delegates extend BaseViewManagerDelegate, they can just call `super.setProperty(...)` for properties they don't want to handle. This diff also introduced a new method `ViewManager.getDelegate()`. This will allow view managers to return an instance of the delegate generated by JS and ensure that the view properties are set in a type-safe manner. If this method returns null (it does by default), we fall back to the default implementation of setting view properties using Java-generated `$$PropsSetter` classes. This is an example of an interface class generated by JS: ``` public interface RCTAxialGradientViewViewManagerInterface<T extends View> { void setColors(T view, Nullable ReadableArray value); void setLocations(T view, Nullable ReadableArray value); void setEndX(T view, Float value); void setEndY(T view, Float value); void setStartX(T view, Float value); void setStartY(T view, Float value); } ``` This is an example of a delegate class generated by JS: ``` public class RCTAxialGradientViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & RCTAxialGradientViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> { public RCTAxialGradientViewManagerDelegate(U viewManager) { super(viewManager); } Override public void setProperty(T view, String propName, Nullable Object value) { switch (propName) { case "colors": mViewManager.setColors(view, (ReadableArray) value); break; case "locations": mViewManager.setLocations(view, (ReadableArray) value); break; case "endX": mViewManager.setEndX(view, value == null ? Float.NaN : ((Double) value).floatValue()); break; case "endY": mViewManager.setEndY(view, value == null ? Float.NaN : ((Double) value).floatValue()); break; case "startX": mViewManager.setStartX(view, value == null ? Float.NaN : ((Double) value).floatValue()); break; case "startY": mViewManager.setStartY(view, value == null ? Float.NaN : ((Double) value).floatValue()); break; default: super.setProperty(view, propName, value); } } } ``` NOTE: What if a view manager, for instance ReactAxialGradientManager, wanted to add support for the borderRadius prop? In the old Java codegen, it would just need to create a method and annotate it with ReactProp (name = ViewProps.BORDER_RADIUS) and $$PropsSetter would call this method when a property with this name must be set. With the new JS codegen, borderRadius is a part of the basic view props, so setBorderRadius is not generated as a part of the ViewManagerInterface, so it’s not possible to set this value. I see two options: 1) add a method boolean setProperty (String propName, Object value) and let the view manager handle it in a non-type safe way (return true if it’s been handled). 2) Generate BaseViewManagerInterface which will include all basic view props and make BaseViewManager implement this interface, leaving all methods empty so that it stays compatible with the current implementation. Override these methods in a view manager that needs to handle a specific property in a custom way (so we would override setBorderRadius in ReactAxialGradientManager). Reviewed By: mdvacca Differential Revision: D16667686 fbshipit-source-id: 06a15a92f8af55640b7a53c5a34f40366d1be2a8 * Added jitpack repository to template (#25987) Summary: This PR will eliminate additional manual installation step for third-party RN libraries that include jitpack-published dependencies. ## Changelog [Android] [Added] - Added jitpack repository to template Pull Request resolved: https://github.com/facebook/react-native/pull/25987 Test Plan: No testing required. Differential Revision: D16763401 Pulled By: cpojer fbshipit-source-id: 72ff0146bd20c61a27b244f2dc7fea50781a4d1a * - Bump CLI to ^3.0.0-alpha.1 (#26028) Summary: Bumps the CLI to v3 alpha which includes Metro 0.56 ## Changelog [Internal] [Changed] - Bump CLI to ^3.0.0-alpha.1 Pull Request resolved: https://github.com/facebook/react-native/pull/26028 Test Plan: None Differential Revision: D16763732 Pulled By: cpojer fbshipit-source-id: 8f35fb80913f623cb44d37208f49040d4a33b07b * Fix handling of failed image downloads Summary: If you have following scenario 1. Have <Image> component with valid URL 2. Due to user action set <Image> to incorrect URL (something that 404s) Currently 1st image stay visible to the user. This is the case for both Fabric and Paper. Paper is being fixed -> https://github.com/facebook/react-native/pull/25919 Reviewed By: fkgozali Differential Revision: D16708532 fbshipit-source-id: ffdea5421faead4730e7b117a3b9f6e21869da70 * Fix crash during reload on Marketplace Home Summary: # What's the problem? `RCTSurfacePresenter._scheduler` is deallocated in `RCTSurfacePresenter.handleBridgeWillReloadNotification`. It shouldn't be used before `RCTSurfacePresenter.handleJavaScriptDidLoadNotification` is called because that's when new `RCTSurfacePresenter._batchedBridge` is created, scheduler depends on this new `RCTSurfacePresenter._batchedBridge`. But it is, it means that it is created with the old bridge, this means that it gets deallocated right away. First access point of old bridge is in `RCTSurfacePresenter.setMinimumSize`. # What's the fix? Make sure surface has correct stage before calling layout methods. The other idea was to return early in `RCTSurfacePresenter.setMinimumSize` in case bridge isn't setup. # Problems? 1. Following error still appears after reload {F176556210} 2. There is a white space for a while. By white space a mean the screen stays white for a short period of time before displaying content. Reviewed By: fkgozali, JoshuaGross Differential Revision: D16762443 fbshipit-source-id: 5a2a880b0f5345f268291c86811264f42f6058b3 * Add Object type to schema Summary: This diff adds ObjectTypeAnnotation to the codegen schema, throwing for the missing implementation sites added in the next diffs for easier review-ability. Also adds a schema fixture that is flow checked for review, but does not export it because the tests would fail Reviewed By: TheSavior Differential Revision: D16759109 fbshipit-source-id: 75c93623e8c1ae2003c7cc638e8e3447f0e7aa38 * Add object prop tests for unchanged fixtures Summary: This diff adds snapshot updates for the new object props test fixtures whose implementation does not need to change (e.g. event emitter files will not change when object props are implemented). This is for easier reviewability in later diffs. Notes that in the files that will change, we're temporarily filtering the OBJECT_PROPS test fixture Reviewed By: TheSavior Differential Revision: D16759124 fbshipit-source-id: 8aae063614f762c8bd7bf092b0d274804c38dd14 * Add view config support for Object props Summary: This diff adds handling for object prop types in the view config codegen Reviewed By: TheSavior Differential Revision: D16759136 fbshipit-source-id: ff4020f9cffe30f14a1356ac95afd7c9a1062c05 * Add Object props support for Java Summary: This diff adds Java handling for object props Reviewed By: TheSavior Differential Revision: D16759139 fbshipit-source-id: e47956dc43cd1eb4abd58636bf111dde8d7244cc * Move generateStructName to CppHelpers Summary: We'll need this helper in the prop files now so let's move it over to the generic cpp helpers Reviewed By: TheSavior Differential Revision: D16759164 fbshipit-source-id: 8765ffee3bd8219b5f0dc8677362ec45f0a8e2c5 * Add support for parsing object props Summary: This diff adds support to the flow parser to parse object props to the codegen schema This handles required and optional props, as well as required and optional object properties, WithDefault, enums, etc. Basically everything is supported that is supported at the top level Reviewed By: TheSavior, osdnk Differential Revision: D16759198 fbshipit-source-id: 6f501f4738f84f20a940235ba74f7bae93e64eef * Better error message for invalid type annotation Summary: Just a minor error message improvement Reviewed By: TheSavior, osdnk Differential Revision: D16759233 fbshipit-source-id: c53c54535eca683353085a8d2272c60596b52b54 * Add Flipper to React Native OSS by default Reviewed By: passy Differential Revision: D6723578 fbshipit-source-id: f34442689f99cd94220335a171010224a12132a8 * Improve ModuleRegistryBuilder assertion Summary: ModuleRegistryBuilder does as assertion to verify that all `cxxModules` are instances of `CxxModuleWrapperBase::javaStaticClass()`. This assertion is causing the crash in T48554656. Since we don't know which NativeModule is causing this problem, it's difficult to get to the bottom of this. So, for now, I'm improving the assertion message in the hopes that it helps us get to the bottom of this issue. Reviewed By: mdvacca Differential Revision: D16774711 fbshipit-source-id: 82318b8ff5ab735ae642da81777c1b5588e8a483 * Move HermesSamplingProfiler to OSS Reviewed By: willholen Differential Revision: D16069575 fbshipit-source-id: a67d19be8790a27e6b3fbd2da0d5c9fdd1e9d53a * Fix jest test crashes with animated components Summary: In the jest test renderer, host components have null refs by default. `createAnimatedComponent` tries to access the ref in componentDidMount, which then crashes. This is particularly problematic when trying to update test data: https://fb.workplace.com/groups/mpen00bs/permalink/494236684721027/?comment_id=510656413079054 Just checking for null fixes the issue and shouldn't affect anything else. Reviewed By: TheSavior, yungsters Differential Revision: D16777137 fbshipit-source-id: 0b9f7c5734c849f36318512ceffcc42dd44c58bb * Add RNTester and UITestBed as dev routes in main apps Summary: It's nice to have everything in one place, especially when touching native code where it's a pain to arc focus or buck build another target just to test some other JS. Reviewed By: yungsters Differential Revision: D14957052 fbshipit-source-id: fd3c388ab5b193b0fe9cebdc0c81ddbff9a714d4 * URL: Do not prepend baseUrl if the URL is not a relative URL (#26009) Summary: Fix for bug https://github.com/facebook/react-native/issues/26006 URL with base is always used, even when absolute URL is provided ## Changelog [Javascript] [Fixed] - `URL`: Base url value is ignored when the input url is not a relative url. Pull Request resolved: https://github.com/facebook/react-native/pull/26009 Test Plan: `new URL('http://github.com', 'http://google.com')` now returns `http://github.com/` Added a test case to `URL-test.js` to verify the same. Differential Revision: D16781921 Pulled By: cpojer fbshipit-source-id: 038aca3610e34f513f603e8993f9a925b7d28626 * Move TextInput PropTypes to Deprecated PropTypes (#26042) Summary: This pull request moves `TextInput`'s proptypes to `DeprecatedTextInputPropTypes`. This is in line with what is happening with other components. ## Changelog [General] [Deprecated] - Moved `TextInput`'s proptypes to `DeprecatedTextInputPropTypes` Pull Request resolved: https://github.com/facebook/react-native/pull/26042 Test Plan: Flow checks pass. Differential Revision: D16782322 Pulled By: cpojer fbshipit-source-id: c5f9caa402c0c5cd878e7fff502d380c7b468cbd * fix SectionList scrollToLocation and prevent regressions (#25997) Summary: Recently there were quite a few changes to this functionality, and they caused breakages https://github.com/facebook/react-native/issues/21577 https://github.com/facebook/react-native/issues/24034 https://github.com/facebook/react-native/issues/24734 https://github.com/facebook/react-native/issues/24735 Currently, whichever `viewOffset` I pass, it will be overridden (either by 0 or something computed in the if body). This fixes the issue and also adds tests to make sure there is no regression. ## Changelog [Javascript] [Fixed] - VirtualizedSectionList scrollToLocation viewOffset param ignored Pull Request resolved: https://github.com/facebook/react-native/pull/25997 Test Plan: tests pass Differential Revision: D16784036 Pulled By: cpojer fbshipit-source-id: 46421250993785176634b30a2629a6e12f0c2278 * Add reexport_all_header_dependencies to (yet more) misc rules Summary: Currently this is the default, but I plan to toggle the default to False shortly. False is better for build speed, as it forces you to separate deps and exported_deps. Reviewed By: williamtwilson Differential Revision: D16785991 fbshipit-source-id: 8cb73b87f1dfa50f21c0c12df1579054cdc99e6e * Commands: support Float arguments Summary: Support codegen'ing commands with Float arguments. Reviewed By: mdvacca Differential Revision: D16785534 fbshipit-source-id: 8174ae40762c1114b87a023cb2b69b2515dc6e23 * Use feature flag to enable view manager delegates for setting props Summary: This diff adds a feature flag which must be enabled if view managers should be allowed to use a delegate for setting their properties. Reviewed By: mdvacca Differential Revision: D16762876 fbshipit-source-id: ae3466d7f02ed02f203dbb79f5e0843e6d9fdd45 * fix display problems when image fails to load (#25969) Summary: This problem was also affecting Fabric and was fixed in D16708532. When the image resource is changed and the new image resource fails to load, we expect the display image to fail to load, but the image still shows the image that was successfully loaded last time. ## Changelog [iOS] [Fixed] - fix display problems when image fails to load Pull Request resolved: https://github.com/facebook/react-native/pull/25969 Test Plan: This is catalyst playground with following code P78264143. TLDR of the code, it sets URL <Image> that is 404. {F175486515} Reviewed By: makovkastar Differential Revision: D16783330 Pulled By: sammy-SC fbshipit-source-id: 1cb488590ce15d957357f32a73ebf8df6cccf4cd * Migrate RCTAxialGradientView to JS codegen Summary: This diff migrates `RCTAxialGradientView` to use generated `RCTAxialGradientViewManagerDelegate` for setting its props. The following base properties have been added to `BaseViewManager`: ``` protected void setBorderRadius(T view, float borderRadius) {} protected void setBorderBottomLeftRadius(T view, float borderRadius) {} protected void setBorderBottomRightRadius(T view, float borderRadius) {} protected void setBorderTopLeftRadius(T view, float borderRadius) {} protected void setBorderTopRightRadius(T view, float borderRadius) {} ``` Reviewed By: JoshuaGross, mdvacca Differential Revision: D16784173 fbshipit-source-id: f3971985efee2b6e0a5fb248b89c4809305e670c * hadle nullable params in generated objcpp Summary: Param of function can be optional and it should have impact on native code. Inspired by old codegen Reviewed By: RSNara Differential Revision: D16763884 fbshipit-source-id: dab50275f902dbe4af25824bb6128d3b37fc43cd * Remove multiple RTCConvert import Summary: RTCConvert was previously imported on each protocol. It was redundant. It's enough to import it once per file Reviewed By: RSNara Differential Revision: D16764834 fbshipit-source-id: 9e5dcd52e38dfefa675e3e2c9f2a8f414da1a02c * fix optional key in structs in new codegen Summary: Property should be marked as optional not only when value is optional, but also key. Reviewed By: RSNara Differential Revision: D16764332 fbshipit-source-id: d56944ef263da3aa1fce3482151c761574a83be6 * Change type of params in methods' protocols to nongeneric Summary: It was mistake which I fix here. Type of param in protocols should be generated struct. See generated struct in snap. It's exactly how it was in previous codegen Reviewed By: RSNara Differential Revision: D16770579 fbshipit-source-id: dac9c15c5d91a41ab2d06aea416f64bd7deb4476 * Fix name of key obtaining from dictionary in inline method in generated objcpp Summary: It was a mistake. We should obtain value by proper key always. Previously by a mistake I hardcoded 'a'. I wasn't break anything because it wasn't used in Internationalization. However, it was a bug Reviewed By: RSNara Differential Revision: D16782132 fbshipit-source-id: 59f7910f2be7753c07f16f00a201de856d57e29e * Add setMethodArgConversionSelector Summary: `setMethodArgConversionSelector` is method for provinding generated structs for methods' params. It was exactly how in old codegen. Reviewed By: RSNara Differential Revision: D16784403 fbshipit-source-id: d35bc8160be62385527299a6b8e68c1159002853 * Omit getConstants for codegening if object is empty Summary: Old codegen was omitting `getConstants` if it was empty. So do our. There's no point in providing this getter in this case. Reviewed By: RSNara Differential Revision: D16762230 fbshipit-source-id: 721df13a00848d23108329b152115c0f0aee8eb9 * Add documentation to TextInput's Flow types (#26054) Summary: The documentation from the Flow types' respective proptypes have been copied over to `TextInput`. ## Changelog [Internal] [Changed] - Added documentation to TextInput's Flow types Pull Request resolved: https://github.com/facebook/react-native/pull/26054 Test Plan: `yarn flow-check-ios` and `yarn flow-check-android` both pass. Differential Revision: D16801435 Pulled By: TheSavior fbshipit-source-id: 7f3d75ba149259d5bbf719375320e2e325188826 * Delete ensureComponentIsNative.js Summary: This function was used by Touchable*. It was removed from the Touchables in D6494579 in 2017. The only remaining callsite was ImageBackground which is attaching a ref directly to the View so we know it is a native component. This is needed for some setNativeProps cleanup Reviewed By: sahrens Differential Revision: D16796973 fbshipit-source-id: 19379094b3b91920efac4bf1969fc22d4b80bcc6 * Use SoundManager in Pressability and Touchable Summary: This diff replaces the usage of UIManagerModule.playTouchSound() in Pressability and Touchable for the SoundManager.playTouchSound() Reviewed By: yungsters Differential Revision: D16543433 fbshipit-source-id: a2ba060bc480889c1e08c5c87086361e06974684 * Revert D16543433: [Fabric][JS] Use SoundManager in Pressability and Touchable Differential Revision: D16543433 Original commit changeset: a2ba060bc480 fbshipit-source-id: 0ba31019fb7a9e77577e495782a3b10029575d22 * Migrate RCTImage NativeModules to CoreModules Summary: This diff moves RCTImageLoader, RCTImageEditingManager, and RCTImageStoreManager to CoreModules. This is necessary for us to convert all these NativeModules to TurboModules. **Note:** As a part of this diff, I had to break apart `RCTImageLoader.h`. All the protocols that were in `RCTImageLoader` are now in their own headers. Furthermore, `RCTImageLoader`'s methods are defined in `RCTImageLoaderProtocol`, so that we can call them from classes like `RCTImageViewManager` in `RCTImage`. Reviewed By: PeteTheHeat Differential Revision: D16805827 fbshipit-source-id: 89f6728b0766c30b74e25f7af1be8e6b8a7e6397 * Add support for `Double` prop type Summary: Support a prop-type `Double`, in addition to `Float`, for flow typing and codegen of components. Reviewed By: TheSavior Differential Revision: D16812812 fbshipit-source-id: b5588b3218636283a4e9c5d17212dd0b92986eb9 * Support spreading locally defined types Summary: We want to be able to spread types that are defined in the same file. Reviewed By: JoshuaGross Differential Revision: D16812171 fbshipit-source-id: 7cda9869ea25f0357b3f8a3b28443407b219f04b * Support spreading locally defined types deeply Summary: We want to be able to spread props at any level, not just the top level Reviewed By: JoshuaGross Differential Revision: D16812884 fbshipit-source-id: 2e710141f833a7cc7ea25a91a1523a5c43b4e02c * Support deeply nested spreads Summary: Apparently I missed one more edge case. Thanks Josh for flagging! Reviewed By: JoshuaGross Differential Revision: D16813354 fbshipit-source-id: 6b59bc7b18184e3aa437c3b038ffd22b0fc0ba6a * Add failure tests for duplicate props with the same name Summary: There are a couple of cases where props can conflict which would cause undefined behavior. We'll throw to protect against that. Now that we support type spread this is more possible without someone realizing. Reviewed By: JoshuaGross Differential Revision: D16813884 fbshipit-source-id: 1a8fce365ab315198abdff0de6006cfe34e84fb9 * Deprecate Text proptypes (#26055) Summary: This pull request moves `Text`'s prop types to the `DeprecatedPropTypes` folder. This was already partly in progress - there were redundant `TextPropTypes` and `DeprecatedTextPropTypes` files so I removed one, and made sure the version with the doc strings was the one used. ## Changelog [General] [Deprecated] - Move `Text` component's proptypes to DeprecatedPropTypes Pull Request resolved: https://github.com/facebook/react-native/pull/26055 Test Plan: Flow checks pass for iOS and Android Differential Revision: D16801078 Pulled By: TheSavior fbshipit-source-id: ef19300945d48d0a4a83d728ee32cdf7d1c0f0cc * add the jni initializer to the build for sampling profiler Summary: The OnLoad.cpp file is needed since it actually registers the jni functions, it wasn't included in the build so it wasn't working correctly. Reviewed By: jbower-fb Differential Revision: D16826230 fbshipit-source-id: 0243e456c4015879d17650737a6a27a58a3d0d9a * Generate super call to BaseViewManagerDelegate if delegate has no props Summary: This diff adds a super call to `BaseViewManagerDelegate` if the current delegate doesn't have any props. We still want to set base view props, so we need `BaseViewManagerDelegate` to take care of this. Reviewed By: rickhanlonii Differential Revision: D16806648 fbshipit-source-id: 61963f2211cc7b2e7f5822c48bb0a7f50d909221 * Remove vendored proguard annotation (#26069) Summary: There have been multiple complaints about combining RN with various other FB libraries, including Litho and Flipper, because of bundled dependencies that can't be deduplicated by Gradle. This is one of three current conflicts: 1) Proguard annotations (this PR) 2) Yoga 3) fbjni While the Yoga group name doesn't make a massive amount of sense it was the easiest existing package to use and since we don't have a better namespace for this, we might as well use this. A similar change to Litho is landing right now. ## Changelog [Android] [Changed] - Use centralized package for DoNotStrip annotation Pull Request resolved: https://github.com/facebook/react-native/pull/26069 Test Plan: ``` yarn ./gradlew :RNTester:android:app:assembleDebug ``` Reviewed By: cpojer Differential Revision: D16827430 Pulled By: passy fbshipit-source-id: 87542b5422fee598d8e635651441f0ecd42eb9d7 * Add Object props support for cxx Summary: Adds ability to codegen object props to cxx by generating the cxx structs and conversion functions | Reviewed By: JoshuaGross Differential Revision: D16759170 fbshipit-source-id: 7437421e59f4be42fbcd4cddc2e0ed513ae71d08 * Add e2e test for object props Summary: Adds e2e tests for cxx and java object props Reviewed By: JoshuaGross Differential Revision: D16759242 fbshipit-source-id: 2307dc4b3ba26222de510cf5876c582d35fc665c * Add array<object> props to schema Summary: Adds arrays of objects to the codegen schema Reviewed By: motiz88 Differential Revision: D16814117 fbshipit-source-id: 10b20446f7aac5dccc3d2cb148891a134d136d3f * Generate array<object> props Summary: Adds the cxx generators for arrays of object props Reviewed By: JoshuaGross, TheSavior Differential Revision: D16814136 fbshipit-source-id: fa4600f60c063bfb460033f5fde43e26c04b5a3b * Parse $ReadOnlyArray<$ReadOnly{}> props Summary: Add flow type parsing for `$ReadOnlyArray<$ReadOnly<{}>>` Reviewed By: TheSavior Differential Revision: D16814261 fbshipit-source-id: 9442916f5d31f6d27f560332aee311b3ad8f0864 * Add e2e tests for array object props Summary: Adds e2e tests for the array of object prop types in the codegen Reviewed By: rubennorte, motiz88 Differential Revision: D16814301 fbshipit-source-id: 613f32a888451c0c1b7359133b7bf88878e36916 * Add error message for paring unnamed params Summary: We're currently not supporting this kind of params ``` +sample(string):void ```` and here's special exception for it. Reviewed By: RSNara Differential Revision: D16708583 fbshipit-source-id: 809f9808b77108857c8363536b896089e9cb957f * Split buck rules for component and modules Summary: Split buck rules for component and modules for our further convenience Reviewed By: rickhanlonii Differential Revision: D16803703 fbshipit-source-id: c01fb97875b43be4020edd054cad538ec8ed6861 * Support Double in when generating props for .h files, in parsing component props, and for commands and events Summary: I realized my previous diff was incomplete. Adding parsing and generation code for Double for props, commands, and events. Reviewed By: rickhanlonii Differential Revision: D16823540 fbshipit-source-id: fbed9897bb84b789c502cf4153e81060590152b8 * Add support for spread with ReadOnlyArray Summary: The new support for ReadOnlyArray needs to call this new function for spreads too. Reviewed By: JoshuaGross Differential Revision: D16823796 fbshipit-source-id: 9de94b41cdead7ce5238c77a9e39b5daf760dfe2 * Convert RCTImageLoader to TurboModules [4/N] Summary: This diff adds a JS spec for RCTImageLoader, and conforms to it in ObjC++. Since RCTImageLoader isn't called from JS, the js spec is empty. Since `/CoreModules/` is the only dir in OSS which supports TM, move the ObjC++ impl there. The change in `NativeExceptionsManager.js` fixes a weird bug I was hitting in codegen, where the codegen cpp file wouldn't compile due to unused variable. Reviewed By: JoshuaGross Differential Revision: D16495674 fbshipit-source-id: 191897b87730a6b0b96022eedc6412551fae04a6 * Pass RCTImageLoader into RCTSurfacePresenter [5/N] Summary: Instead of grabbing `imageManager` from the bridge, pass it from above. Right now, still use bridge to pass from above, but this gives us flexibility to not use bridge in the future. Reviewed By: shergin Differential Revision: D16504270 fbshipit-source-id: 7977a7957b659375f8348d26cd57b648e9d5959f * Pass RuntimeExecutor into RCTSurfacePresenter Summary: Instead of getting `RuntimeExecutor` from the bridge, pass it from above. Right now pass through `null`, but eventually this will work :) Reviewed By: RSNara Differential Revision: D16626288 fbshipit-source-id: bce527f85c0a79cfe6cf240a3633bbbe357f75c4 * Fix BUCK-related React Native CI failures Reviewed By: cpojer Differential Revision: D16812633 fbshipit-source-id: 50de7603fbb514ff1c3bb6c5fa6afd579d8a20b8 * Move RCTExceptionsManager to CoreModules and make it conform to spec Summary: `NativeExceptionsManager.js` contains the JS spec for this native module. This diff moves the objc code to CoreModules (since it's the only directory that supports TM at the moment) and makes it conform to the spec. NOTE: I will update podfiles after this diff is reviewed, before I land. Adding those generated changes makes it really hard to review. Reviewed By: RSNara Differential Revision: D16812212 fbshipit-source-id: 38b6e9a20ce15e7e9995df34493b37ed7adb2911 * Bump test version for cache issues * Tweak script to work with no global CLI * Revert "Remove vendored proguard annotation (#26069)" This reverts commit 35fc0add2d3a278bf90257284fe23e03898008de. * Revert "Remove 's.static_framework = true' requirement for podspec (#25816)" This reverts commit ca9e108110e4a3cc39044805f879d9a9cb637c41. * [0.61.0-rc.0] Bump version numbers * Revert "[0.61.0-rc.0] Bump version numbers" This reverts commit 9296ab1a615f0eb322e22cb85a61aa5b5acdb76e. * [0.61.0-rc.0] Bump version numbers * Revert "[0.61.0-rc.0] Bump version numbers" This reverts commit 2575eb318f01c8d1e680e3e3aaf07c14e159daaf. * Add RCTWeakProxy to properly deallocate RCTUIImageViewAnimated Summary: @public CADisplayLink strongly holds onto its target, so you have to use a weak proxy object to pass the target into the CADisplayLink. Previously we passed a weak-self point (i.e. weakSelf) but this did not have the intended effect, since the pointer to self would still be passed to CADisplayLink, and thus it would hold onto the RCTUIImageViewAnimated strongly. So is weakSelf doing anything other than using self? It is but it's very minor and not useful. In the case that the object got de-allocated between assigning self to weakSelf and creating the CADisplayLink, then we would pass a nil target. This is actually impossible though because we are running an instance method, so self is implicitly retained! So semantically it is something different but in practice it is the same as passing self through. Notes: * This system was added originally in https://github.com/facebook/react-native/pull/24822 * https://github.com/facebook/react-native/pull/25636 then "enabled" this system by deprecating existing approach Reviewed By: fkgozali Differential Revision: D16939869 fbshipit-source-id: 7a0e947896f23aa30ad074d1dcb4d4db7543e00a * Remove RCTUIImageViewAnimated WeakProxy gating Summary: To help determine how severe this issue is, put the fix behind a MC. We will only pick the parent diff to the RC branch so that the fix immediately goes to master and we don't have to worry about fixing this any further. Reviewed By: fkgozali Differential Revision: D16940181 fbshipit-source-id: 91eb08181f82f51aea6a20b3fd489a33bdc0e424 * [0.61.0-rc.0] Bump version numbers * Revert "[0.61.0-rc.0] Bump version numbers" This reverts commit bc28eee87f777b19106d4df7f2ac775cb357a12b. * Update CircleCI config as per support request * [0.61.0-rc.0] Bump version numbers * Memory Leak due to JSStringRelease not called in multiple places in JSCRuntime.cpp (#25884) Summary: Memory Leak due to JSStringRelease not called in multiple places in JSCRuntime.cpp Issue: https://github.com/facebook/react-native/issues/25664 Reproducible repo: https://github.com/bhandarijiwan/memory_issue_repro ## Changelog [JSC] [JSCRuntime.cpp] - Added missing JSStringRelease calls in missing places Pull Request resolved: https://github.com/facebook/react-native/pull/25884 Test Plan: Tested that is no memory leak with various NativeModule to JS call flows Reviewed By: JoshuaGross Differential Revision: D16928985 Pulled By: TheSavior fbshipit-source-id: 65ce15ae32482d0db39bad7e22a2fed9ee04f230 * Fix Redbox on iOS Summary: Looks like we broke iOS redbox in D16812212. It stopped showing up because the feature detection stopped working, and we started calling noops. The fix is an explicit platform check. Fixes #26260 Reviewed By: motiz88 Differential Revision: D17139310 fbshipit-source-id: 829eec23cbb49151ac250889c34ab28d36b05e6a * Partial RN sync Summary: This cherry-picks one commit: https://github.com/facebook/react/commit/01fb68b9bf680ab8bbf96e86501e0fc540b3cc97 It fixes a bug in Fast Refresh. Reviewed By: threepointone Differential Revision: D17140543 fbshipit-source-id: a7654152d1cc7c27e7c4024380349b44ac496b22 * Change podspec name of yoga to Yoga Summary: Needed to capitalize the name, since this is the convention used elsewhere too [iOS] [Changed] - Renamed yoga podspec to Yoga Reviewed By: shergin Differential Revision: D17127104 fbshipit-source-id: 14047bf452edda000037701f4ba7f4a02a0e717b * Update the version of yoga podspec to match the actual version of Yoga published Summary: Yoga is currently published in cocoapods. While we don't use the Yoga from Cocoapods in React Native, we should atleast try to follow that version, so that other integrations with Yoga are possible Reviewed By: shergin Differential Revision: D17127625 fbshipit-source-id: bca2e1e33ad775e2a0d7a6f1e4177c3b480c023a * Sync Podfile * Update release script * [0.61.0-rc.2] Bump version numbers * TM iOS: Disable in test environment Summary: For now, disable TM completely in test environment, like RNTester integration/unit tests. See details in T53341772 This also fixes the failure discussed in https://github.com/facebook/react-native/pull/26151 Reviewed By: PeteTheHeat Differential Revision: D17147915 fbshipit-source-id: 1c48ebb9c3b81fc08bc33606dcc38c29297d6010 * Revert "Revert "Remove 's.static_framework = true' requirement for podspec (#25816)"" This reverts commit 612c033918e6f61713966a24fa024048fc520fca. * Add missing dependencies to React-CoreModules.podspec * Fix incorrect `module.name_mapper` in template .flowconfig (#26330) Summary: Has explained in https://github.com/facebook/react-native/issues/26233, current template is incorrect & can create error, like having require() of png that are considered as `string` instead of `number. This can probably hide tons of similar mistakes. The change in this PR should resolve the previous behavior (& for example, some places in previous version of the flowconfig have the full path like here https://github.com/facebook/react-native/blob/35300147ca66677f42e8544264be72ac0e9d1b45/template/_flowconfig#L61) Closes https://github.com/facebook/react-native/issues/26233 ## Changelog ``` [General] [Fixed] Fix incorrect `module.name_mapper` in template .flowconfig ``` Alternatively, message could be ``` [General] [Internal] Fix incorrect `module.name_mapper` in template .flowconfig ``` As it hasn't this "bug" hasn't been released in a public stable release. You decide Pull Request resolved: https://github.com/facebook/react-native/pull/26330 Test Plan: I just tested this in my project, thymikee might be able to confirm & approve this PR. Differential Revision: D17258891 Pulled By: cpojer fbshipit-source-id: 3904ffbc6f076ee0e435311249d694b8604fc7b8 * Rename Yoga * [0.61.0-rc.3] Bump version numbers * Fixing Yoga imports and includes on case-sensitive machines (#26416) Summary: In addition of the issue resolved by https://github.com/facebook/react-native/pull/26360 (already merged), machines with case-sensitive disks are still not able to build a project on Xcode due not found `<yoga/...` imports: ``` 'yoga/Yoga.h' file not found ``` ![Screen Shot 2019-09-12 at 11 15 54](https://user-images.githubusercontent.com/1728387/64791885-c58c9180-d54e-11e9-95cb-40befaab7acc.png) ## Changelog [iOS] [Fixed] - Fix Yoga imports and includes Pull Request resolved: https://github.com/facebook/react-native/pull/26416 Test Plan: `Build` command on Xcode now runs successfully in a Mac with disk in case-sensitive mode Differential Revision: D17370392 Pulled By: PeteTheHeat fbshipit-source-id: 2a225f47046113267adb154a4c6a9ef4664a12c3 * Fix build break in MSVC (#26462) Summary: Merging react-native-windows to 0.60 - the visual studio compiler seems to take issue with the existing code ## Changelog [Internal] [Fixed] - Build fix for react-native-windows (MSVC) Pull Request resolved: https://github.com/facebook/react-native/pull/26462 Test Plan: No real change, just making compilers happy. ### Side Note We'll want this change cherry-pickered to RN 0.60 and RN 0.61 so users of react-native-windows dont have to use our fork of react-native. Reviewed By: mhorowitz Differential Revision: D17406081 Pulled By: TheSavior fbshipit-source-id: bc056e1a545c6478fdcbd5645f3a8dea657162c8 * Revert "Fix onDismiss in Modal" This reverts commit bd2b7d6c0366b5f19de56b71cb706a0af4b0be43. * Bump hermes to v0.2.1 (#26451) Summary: Bump hermes to v0.2.1 allow-large-files ## Changelog See https://github.com/facebook/hermes/releases/tag/v0.2.1 [Android] [Changed] - Bump hermes to v0.2.1 Pull Request resolved: https://github.com/facebook/react-native/pull/26451 Test Plan: RNTester builds and runs as expected Differential Revision: D17394921 Pulled By: cpojer fbshipit-source-id: 07ce5da3517b7aa24bfb5e1f6eefed6cdc9f5cb5 * React Partial Sync Summary: Base: 85d05b3a4d439c504ee43652d586ee253a01faf6 Author: Dan Abramov <dan.abramov@gmail.com> Date: Wed Sep 18 16:32:11 2019 +0100 [Fresh] Always remount classes (#16823) commit acfdc9760b4dc55d192b08de42b2c45e5e5bb531 Author: Ricky <rickhanlonii@gmail.com> Date: Wed Sep 18 15:31:00 2019 +0100 [React Native] Fix for view config registrations (#16821) commit dbe593d96c35b33fcc1f1bec70af86c24779392b Author: Dominic Gannaway <trueadm@users.noreply.github.com> Date: Wed Sep 18 14:18:32 2019 +0200 [react-core] Do not null fiber.sibling in detachFiber (#16820) commit 30fa2f5ea3313b4b7932783d8ac71b5d59b8a8c7 Author: Dominic Gannaway <trueadm@users.noreply.github.com> Date: Tue Sep 17 17:30:22 2019 +0200 [react-core] Clear more properties in detachFiber (#16807) commit ea374e751b164ed029b35063b84c825305024a0a Author: Dan Abramov <dan.abramov@gmail.com> Date: Wed Aug 28 16:55:56 2019 +0100 Don't ignore dependencies for render phase update (#16574) Reviewed By: gaearon Differential Revision: D17456249 fbshipit-source-id: 87bad63fed4a571f65592ee904606828e3aa39af * bump android gradle plugin to 3.5.0 (#26129) Summary: Android Gradle Plugin 3.5.0 released with a lot of improvements and bug fixes. It's important to have this change merged before 0.61 release. See https://developer.android.com/studio/releases/gradle-plugin ## Changelog [Android] [Changed] - bump android gradle plugin to 3.5.0 Pull Request resolved: https://github.com/facebook/react-native/pull/26129 Test Plan: RNTester builds and runs as expected Reviewed By: mdvacca Differential Revision: D17091520 Pulled By: osdnk fbshipit-source-id: 232b9209526e62a7344d74422fd8471a03dec7f4 * Update Gradle wrapper to 5.6 (#26079) Summary: ``` Welcome to Gradle 5.6! Here are the highlights of this release: - Incremental Groovy compilation - Groovy compile avoidance - Test fixtures for Java projects - Manage plugin versions via settings script For more details see https://docs.gradle.org/5.6/release-notes.html ``` ## Changelog [Android] [Changed] - Gradle wrapper 5.6 Pull Request resolved: https://github.com/facebook/react-native/pull/26079 Test Plan: Ran build and tests locally. Differential Revision: D17054310 Pulled By: mdvacca fbshipit-source-id: de7ba3a6d04058e51b8bc6a21d5a3f828ef8bc25 * Revert "bump android gradle plugin to 3.5.0 (#26129)" This reverts commit 8d4e8a377528895c5ea3928e9c209eafa467f46b. * Revert "Update Gradle wrapper to 5.6 (#26079)" This reverts commit afd35296f2bd0a04e3406c03ff9c023e7192161f. * [0.61.0] Bump version numbers * Allow again for injecting custom root view via ReactActivityDelegate (#26495) Summary: This change restores the possibility of injecting custom root views via ReactAcitivtyDelegate. It has been used by react-native-gesture-handler library in order to replace default root view with a one that'd route touch events to gesture-handler internal pipeline. The regression happened in d0792d4b8ac42711dfd9fccb782f16e72ce3e335 where new `ReactDelegate` was introduced to provide support for rendering react native views in both Android fragments and activities. As a part of that change the logic responsible for creating root view has been moved from `ReactActivityDelegate` to `ReactDelegate` rendering `ReactActivityDelegate.createRootView` unused – that is there is no code path that leads to this method being called. Instead `ReactDelegate.createRootView` method has been added which now plays the same role. The custom root view injection was relying on overwriting that method and hence the method is no longer referenced overwriting it has no effect. Following the logic migration out of `ReactActivityDelegate` into `ReactDelegate` we could potentially now start overwriting methods of `ReactDelegate`. However when working with Android's activities in React Native we can only provide an instance of `ReactActivityDelegate` and in my opinion it does not make too much sense to expose also a way to provide own instance of `ReactDelegate`. The proposed fix was to route `ReactDelegate.createRootView` to call `ReactActivityDelegate.createRootView` and this way regaining control over root view creation to `ReactActivityDelgate`. The change of the behavior has been implemented by subclassing `ReactDelegate` directly from `ReactActivityDelegate` and hooking the aforementioned methods together. Thanks to this approach, the change has no effect on `ReactDelegate` being used directly from fragments or in other scenarios where it is not being instantiated from `ReactActivityDelegate`. This fixes an issue reported in https://github.com/kmagiera/react-native-gesture-handler/issues/745 and discussed on 0.61 release thread: https://github.com/react-native-community/releases/issues/140#issuecomment-532235945 ## Changelog [Internal] [Fixed] - Allow for custom root view to be injected via ReactActivityDelegate Pull Request resolved: https://github.com/facebook/react-native/pull/26495 Test Plan: 1. Run RNTester, take layout snapshot, see the react root view being on the top of view hierarchy. 2. Run gesture-handler Example app (or some other app that overwrites ReactActivityDelegate.createRootView method), on layout snapshot see custom root view being used. Differential Revision: D17482966 Pulled By: mdvacca fbshipit-source-id: 866f551b8b077bafe1eb9e34e5dccb1240fa935e * Fix ShareSheet crash on iOS 13 (#26429) Summary: Currently on iOS 13 the app will crash if you: - Open the share sheet - Tap something like messages or photos - Cancel the dialog - Perform any other action This is because `shareController.completionWithItemsHandler` is called when the dialog box is canceled and currently `failureCallback` or `successCallback` will always be called. In the situation above, `activityError` is `nil` so `successCallback` will be called even though `completed` is false. This leaves us in a state where the callback has been invoked but the ShareSheet is still active, meaning the success or error callback will be invoked again, leading to the crash. This PR adds a check to make sure `completed` is true before calling `successCallback`. This way `successCallback` will only be called when the user has successfully completed an action and the ShareSheet is closed. ## Changelog [iOS] [Fixed] - Fix crash in RCTActionSheetManager.m on iOS 13 Pull Request resolved: https://github.com/facebook/react-native/pull/26429 Test Plan: - Saved an image successfully - Opened and dismissed the `Photos` dialog multiple times without crashing Differential Revision: D17369712 Pulled By: PeteTheHeat fbshipit-source-id: 228b696243cd39fad1fa134f4412d95d845b1bc5 * [0.61.1] Bump version numbers * Revert "[0.61.1] Bump version numbers" This reverts commit 2577ca534008e362a977ce7c83eb4b51e14a0b52. * Revert "Add generated `xcshareddata` folder to gitignore (#25451)" This reverts commit d57cdac62b814d38d2d03cdbb1cb3da60a09c948. * [0.61.1] Bump version numbers * Bring back RNTester manual step * Removing the workspace (#26566) The workspace file is file to be added to git. Consider it as a lockfile for native ios :) * Revert "Set rounded rectangle mask on TouchableNativeFeedback's ripples (#25342)" This reverts commit 14b455f69a30d128db384749347f41b03b9a6000. * Include transform in OUTER_PROPS (#26611) Summary: Without `transform` in `OUTER_PROPS`, the refresh control component would not include `transform: {scaleY: -1}` in its style and so pulling down, rather than up, on a scroll view would trigger a refresh. Fixes https://github.com/facebook/react-native/issues/26181 ## Changelog [Android] [Fixed] - Fixed issue with refresh control not working properly on an inverted ScrollView Pull Request resolved: https://github.com/facebook/react-native/pull/26611 Test Plan: Updated unit test in splitLayoutProps-test.js. Differential Revision: D17661079 Pulled By: cpojer fbshipit-source-id: 747da27b11c3ca59b7f639f393ae5ac137f5490a * Use `warnOnce` for excessive number of callbacks error (#26508) Summary: I happened to hit this error a couple times and the issue is that if there are let's say 1000 pending callbacks the error would be triggered 500 times and pretty much crash the app. I think it is reasonable to use warn once here so it only happens once. ## Changelog [General] [Fixed] - Use `warnOnce` for excessive number of callbacks error Pull Request resolved: https://github.com/facebook/react-native/pull/26508 Test Plan: Tested by reducing the number of pending callbacks required to trigger the error. Reviewed By: TheSavior Differential Revision: D17512917 Pulled By: JoshuaGross fbshipit-source-id: 5ce8e2a0a166805cc6f3fe6d78e2716d6792a80e * improve error message in NativeModuleRegistryBuilder.java (#26467) Summary: ## Motivation I have seen a spike in users reporting this error. Unfortunately I did not receive any repros that would confirm this, but my hypothesis is that they ran into situation when `new XYZPackage()` was present in `getPackages()` method and then the CLI kicked in with autolinking and they were left with this incomplete error. someone more knowledgeable of autolinking should review this. Pull Request resolved: https://github.com/facebook/react-native/pull/26467 Differential Revision: D17661242 Pulled By: cpojer fbshipit-source-id: 63dfcd85a0d41d85a0dd52f84ab16cb7ceb64ba2 * iOS13 status bar has now 3 styles (#26294) Summary: iOS13 status bar has now 3 styles UIStatusBarStyleDefault, UIStatusBarStyleLightContent, UIStatusBarStyleDarkContent UIStatusBarStyleDefault now acts as an automatic style which will set it’s value dynamically based on the the userinterfacestyle(One of the traits) of the viewcontroller that controls the status bar appearance. ## Changelog [iOS] [Fixed] - iOS13 new status bar style UIStatusBarStyleDarkContent Pull Request resolved: https://github.com/facebook/react-native/pull/26294 Differential Revision: D17314054 Pulled By: cpojer fbshipit-source-id: ea109e729bb551dff314bc00a056860a8febb0e9 * [0.61.2] Bump version numbers * Release underlying resources when JS instance is GC'ed on Android try 2 (#26155) Summary: Reland https://github.com/facebook/react-native/pull/24767 The commit had to be reverted because it caused a crash when using remote debugging in chrome. This is normal since jsi is not available in that environment. The crash was caused by `jsContext.get()` being 0, then being dereferenced later in c++. We can simply skip initializing the blob collector in this case. This also includes the fix from https://github.com/facebook/react-native/issues/25720 to fix a crash when using hermes. ## Changelog [Android] [Fixed] - Release underlying resources when JS instance is GC'ed on Android Pull Request resolved: https://github.com/facebook/react-native/pull/26155 Test Plan: Test using RN tester with jsc and hermes Test remote debugging Reviewed By: mdvacca, fred2028 Differential Revision: D17072644 Pulled By: makovkastar fbshipit-source-id: 079d1d43501e854297fbbe586ba229920c892584 * Bump SoLoader to 0.8.0 (#26759) Summary: This PR bumps bumps Soloader to 0.8.0. This fixes white screen/ crash issues when downloading from Google Play. Related to: https://github.com/facebook/react-native/issues/25927 #26400 ## Changelog [Android] [Changed] - Bump Soloader to 0.8.0 Pull Request resolved: https://github.com/facebook/react-native/pull/26759 Test Plan: A few CI tests fail, but I don't see the link with what I changed, especially the ios tests. It's working locally though, and for people on github who tried this solution as well. Differential Revision: D17828891 Pulled By: mdvacca fbshipit-source-id: 1c7809aa681b41b8ed9a4da96d041d52f3cfbb76 * Revert "Bump SoLoader to 0.8.0 (#26759)" This reverts commit 66ae1caccd2c1142c519ce1913a6ac15d6f335fa. * Improve Flow Type for ScrollResponder Summary: FlatList and VirtualizedList were typing this value as any instead of using the actual type from ScrollView. I started with that change and then fixed the type to solve the other callsites in the codebase. Reviewed By: zackargyle Differential Revision: D17089934 fbshipit-source-id: bfc22cec9993904d779cad37b1de7cb3c0484d2c * Migrate scrollResponderScrollNativeHandleToKeyboard function to take nativeRef Summary: We need to get rid of findNodeHandle calls so migrating scrollResponderScrollNativeHandleToKeyboard to take a ref to a host component. I made this change with Flow, and tested by rendering UserJobApplicationForm Reviewed By: mdvacca Differential Revision: D17099280 fbshipit-source-id: 96af692006aace2c206f268f5416984b00f8a438 * Fix exception in scrollResponderScrollNativeHandleToKeyboard when ref is null Summary: We are seeing these errors in prod: ``` TypeError: Cannot read property '_nativeTag' of null at ReactNativeFiberHostComponent.prototype.measureLayout(ReactNativeRenderer-prod.fb.js:1594) ScrollResponderMixin.scrollResponderScrollNativeHandleToKeyboard(ScrollResponder.js:557) ``` This error is coming from these lines: https://github.com/facebook/react-native/blob/69c38e5a639f34620038ae5724426c92c355e509/Libraries/Components/ScrollResponder.js#L563-L567 Either `nodeHandle` is null or `this.getInnerViewRef()`. If `nodeHandle` was null, we'd get an error that we can't call `measureLayout` on null. So `this.getInnerViewRef()` must be null. In the React Native Renderer this error of `_nativeTag of null` is coming from this line: https://github.com/facebook/react/blob/db8afe4f6318dba422177a2054204ef089570ad8/packages/react-native-renderer/src/ReactNativeFiberHostComponent.js#L84 Which means indeed `this.getInnerViewRef()` is null. So adding a null check here which is what we do at all the other product callsites of `measureLayout`. Flow should have caught this, but because ScrollView is one of the only components left using mixins (ScrollResponder), `this.getInnerViewRef` is typed as `any` instead of what it should be: ``` ?React.ElementRef<Class<ReactNative.NativeComponent<mixed>>> ``` If `scrollResponder` was typed correctly then Flow would have caught this. Changelog: [Fixed] Exception in scrollResponderScrollNativeHandleToKeyboard when ref is null Reviewed By: mmmulani Differential Revision: D17717150 fbshipit-source-id: d7bc4c897ad259fb588e8100f37ccfb8a5d07874 * Fix bug where ScrollView contentInset top set to undefined wouldn't default to 0 Summary: If you passed ``` contentInset: { bottom: 10 } ``` then it wouldn't go into the if case and it could try to call `setOffset` with `undefined`. `setOffset` requires a number. Changelog: [Fix][ScrollView] ScrollView contentInset top now defaults to 0 in expected situations Reviewed By: JoshuaGross Differential Revision: D17796155 fbshipit-source-id: 951dbbb0de1052f64a6835963e8bbc564990c120 * Fix TimingAnimation rounding error issue (Take 2) Summary: This fixes a bug where the frames array can contain a duplicate entry at the end. For example, suppose the duration is 1000.0 then it would create an array with the following: ``` [ 0, 0.0010119824303159884, 0.00391003997863186, 0.00851330482578147, 0.01466951184383165, 0.022249135687575607, 0.03114100006836614, 0.041248932923769244, 0.05248918022066495, 0.06478838042267626, 0.07808196049642172, 0.09231285402599128, 0.1074304693764467, 0.12338985513375342, 0.14015102395653428, 0.15767840628626964, 0.17594041329987542, 0.1949090949486824, 0.21455988464815853, 0.23487142789035506, 0.25582549864491233, 0.27740701626433145, 0.2996041891505173, 0.3224088345090182, 0.34581696665965683, 0.36982983491413496, 0.394455794287552, 0.4197139228812336, 0.44564199741037275, 0.4723190090623474, 0.5000000572130084, 0.5276809909376533, 0.5543580025896278, 0.5802860771187669, 0.6055442057124484, 0.6301701650858652, 0.6541830333403433, 0.6775911654909819, 0.7003958108494828, 0.7225929837356684, 0.7441745013550876, 0.7651285721096447, 0.785440115351841, 0.8050909050513173, 0.8240595867001241, 0.84232159371373, 0.8598489760434653, 0.876610144866246, 0.8925695306235529, 0.9076871459740083, 0.9219180395035779, 0.9352116195773232, 0.9475108197793346, 0.9587510670762303, 0.9688589999316335, 0.9777508643124241, 0.9853304881561681, 0.9914866951742183, 0.996089960021368, 0.9989880175696839, 1, 1 ] ``` With this change, it now generates the following array: ``` [ 0, 0.0010119824303159884, 0.00391003997863186, 0.00851330482578147, 0.01466951184383165, 0.022249135687575607, 0.03114100006836614, 0.041248932923769244, 0.05248918022066495, 0.06478838042267626, 0.07808196049642172, 0.09231285402599128, 0.1074304693764467, 0.12338985513375342, 0.14015102395653428, 0.15767840628626964, 0.17594041329987542, 0.1949090949486824, 0.21455988464815853, 0.23487142789035506, 0.25582549864491233, 0.27740701626433145, 0.2996041891505173, 0.3224088345090182, 0.34581696665965683, 0.36982983491413496, 0.394455794287552, 0.4197139228812336, 0.44564199741037275, 0.4723190090623474, 0.5000000572130084, 0.5276809909376533, 0.5543580025896278, 0.5802860771187669, 0.6055442057124484, 0.6301701650858652, 0.6541830333403433, 0.6775911654909819, 0.7003958108494828, 0.7225929837356684, 0.7441745013550876, 0.7651285721096447, 0.785440115351841, 0.8050909050513173, 0.8240595867001241, 0.84232159371373, 0.8598489760434653, 0.876610144866246, 0.8925695306235529, 0.9076871459740083, 0.9219180395035779, 0.9352116195773232, 0.9475108197793346, 0.9587510670762303, 0.9688589999316335, 0.9777508643124241, 0.9853304881561681, 0.9914866951742183, 0.996089960021368, 0.9989880175696839, 1 ] ``` Note that the duplicate 1 at the end is now gone. This is because previously when it accumulated dt for 60 frames. dt wasn't quite exactly 1000, it was instead 999.9999999999999 and so didn't break out of the loop when it should have. This adds a tolerance so that it does break out of the loop. Reviewed By: dimach1977 Differential Revision: D17828204 fbshipit-source-id: 4483303de852071436cf9a82e50296baf3392329 * Fix ref type for Native Scroll View Summary: These types were wrong, this is a HostComponent, not a ReactNative.NativeComponent Reviewed By: lunaleaps Differential Revision: D17862305 fbshipit-source-id: e1e7acc7a5892f124b07cdc39d73d6ce7d414063 * Fix selecting videos from library in iOS 13 Summary: In iOS 13, Apple made a change that results in video URLs returned by UIImagePickerController becoming invalidated as soon as the info object from the delegate callback is released. This commit works around this issue by retaining these info objects by default and giving the application a way to release them once it is done processing the video. See also https://stackoverflow.com/questions/57798968/didfinishpickingmediawithinfo-returns-different-url-in-ios-13 Reviewed By: olegbl, mmmulani Differential Revision: D17845889 fbshipit-source-id: 12d0e496508dafa2581ef12730f7537ef98c60e2 * Fix bug in iOS13 nested text rendering Summary: This fixes a bug reported by Oculus and OSS. https://github.com/facebook/react-native/issues/26577 When rendering images nested in a `<Text/>` node, on the native side, `RCTTextShadowView` adds an empty NSTextAttachment to the attributed string to add some extra space. The image is then overlaid in the empty space . This all works fine and dandy on iOS12 and below. Starting in iOS13, an empty NSTextAttachment doesn't render as blank space. It renders as the "missing image" white page. When the real image is overlaid on the white page, it looks super broken. See github issue and test plan for examples. This fix is to assign an empty image to `NSTextAttachment`. I tried seeing if there was any other attribute we could use to just add white space to an attributed string, but this seems like the best one. Changelog: [iOS][Fixed] Fixed bug rendering nested text on iOS13 Reviewed By: xyin96 Differential Revision: D18048277 fbshipit-source-id: 711cee96934fc1937d694621a4417c152dde3a31 * Revert "Fix ref type for Native Scroll View" This reverts commit db662af5b28d0ad42abd1da67c32f2c38ff04900. * Invalidate cache * [0.61.3] Bump version numbers * Revert release and remove extraneous commits This reverts commit 7fa3eef2a11b094a59a43fb7db4ba5edb9ccdff5. * Revert "Fix exception in scrollResponderScrollNativeHandleToKeyboard when ref is null" This reverts commit 0da6a9bb45dc085db701de06ac354538e6814c64. * Revert "Migrate scrollResponderScrollNativeHandleToKeyboard function to take nativeRef" This reverts commit 09c4e7caf053d593d897f80ccd9df8f5bf96252b. * Revert "Improve Flow Type for ScrollResponder" This reverts commit 54bf3ae1cfaf49562d60ebf06386c157fc27131e. * [0.61.3] Bump version numbers * Bump react to 16.9.0 (#27060) * Bump react to 16.9.0 * Update package.json * might as well do everything * Update package.json * fix build with hermes on windows (#26556) Summary: On the Windows platform, with hermes-engine enabled, the assembly crashes with an error: ![image](https://user-images.githubusercontent.com/8634793/65568495-ab11d980-df8c-11e9-83a0-2a2d26447860.png) The problem lies in calling hermes command without the leading arguments `"cmd", "/c"` ([react.gradle, line: 152](https://github.com/facebook/react-native/blob/e028ac7af2d5b48860f01055f3bbacf91f6b6956/react.gradle#L152) ) ## Changelog [General] [Fixed] - Added a platform check and running commandLine with the corresponding arguments Pull Request resolved: https://github.com/facebook/react-native/pull/26556 Test Plan: Under Windows, enable hermes-engine in _build.gradle_ and run the `gradlew assembleRelease` or `gradlew bundleRelease` command Also check assembly on other available platforms Differential Revision: D17587023 Pulled By: cpojer fbshipit-source-id: bab10213b23fac5ab6a46ac4929759dcd43e39c2 * Don't wrap console methods for metro logging in Chrome debugger (#26883) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/26883 This diff fixes an issue reported in https://github.com/facebook/react-native/issues/26788 where logs in the Chrome console were showing a different location than previous versions. In the change here, we stop wrapping the console functions to attach the metro websocket in any environment that isn't a native app environment. We do this by checking `global.nativeLoggingHook` which is bound only by native apps and not environments like the Chrome DevTools. Changelog: [General][Fixed] - Fix wrong lines logging in Chrome debugger Reviewed By: cpojer, gaearon Differential Revision: D17951707 fbshipit-source-id: f045ea9abaa8aecc6afb8eca7db9842146a3d872 * Reverts "Timing: Fixes timer when app get into background (#24649)" (#27065) This reverts commit 338298417f8077dee177057c57b38671b4ec8c75 * [0.61.4] Bump version numbers * fix: Bundle assets in monorepo (#26940) Summary: In monorepo environment, `metro` isn't able to resolve `react-native` because the path to it is hardcoded. I've also added `packagingOptions` to RNTester to make Android builds work for me. Let me know if this is something that is only specific to my setup, and shouldn't be added. ## Changelog [Android] [Fixed] - Fix `bundleReleaseJsAndAssets` in monorepo env Pull Request resolved: https://github.com/facebook/react-native/pull/26940 Test Plan: - [x] - Works in monorepo setup on MacOS - [x] - Works with RNTester app Differential Revision: D18323703 Pulled By: cpojer fbshipit-source-id: b8eb15dfd8a32ae11fd862fc725af9cffea2cf96 * Fix multiple `set-cookie` not aggregated correctly in response headers (#27066) Summary: Multiple `set-cookie` headers should be aggregated as one `set-cookie` with values in a comma separated list. It is working as expected on iOS but not on Android. On Android, only the last one is preserved The problem arises because `NetworkingModule.translateHeaders()` uses `WritableNativeMap` as the translated headers but uses both native and non-native methods. The mixup causes out of sync data that both sets of methods do no agree. A simple fix is to use `Bundle` as the storage and only convert it to `WritableMap` at the end in one go Related issues: https://github.com/facebook/react-native/issues/26280, https://github.com/facebook/react-native/issues/21795, https://github.com/facebook/react-native/issues/23185 ## Changelog [Android] [Fixed] - Fix multiple headers of the same name (e.g. `set-cookie`) not aggregated correctly Pull Request resolved: https://github.com/facebook/react-native/pull/27066 Test Plan: A mock api, https://demo6524373.mockable.io/, will return 2 `set-cookie` as follows: ``` set-cookie: cookie1=value1 set-cookie: cookie2=value2 ``` Verify the following will print the `set-cookie` with a value `cookie1=value1, cookie2=value2` ```javascript fetch('https://demo6524373.mockable.io/') .then(response => { console.log(response.headers); }); ``` On iOS, `set-cookie` will have `cookie1=value1, cookie2=value2` while on Android it will have `cookie2=value2` (preserving only the last one) Differential Revision: D18298933 Pulled By: cpojer fbshipit-source-id: ce53cd41d7c6de0469700617900f30a7d0914c26 * - Bump CLI to ^3.0.0 (#27235) Summary: Upgrading CLI to latest. It's likely not yet compatible with master, because we depend on Metro 0.56, and master is on 0.57. This diff is intended to be cherry-picked to 0.61 and 0.62. cc grabbou ## Changelog [Internal] [Changed] - Bump CLI to ^3.0.0 Pull Request resolved: https://github.com/facebook/react-native/pull/27235 Test Plan: None Differential Revision: D18527709 Pulled By: cpojer fbshipit-source-id: 44448058c48a66d22a1d71abdc908f532f5aa547 * [0.61.5] Bump version numbers * Create and checkout branch for 0.61 merge: fb61merge * Fix up some basic merge issues with config files * Mostly fixing bad merges and podfile moves. Gets iOS building and some progress to getting macOS built * JS is not lint free. * iOS RNTester booting * Update test snapshot files * Get macOS building. Mostly image-related fixup with high probability of regression. Also take the opportunity to remove some stuff from RCTUIKit to help de-monolithize it * Fix iOS build breaks from last commit * Fix minor yarn lint issues to bring yarn lint parity with facebook's 0.61-stable branch * RNTester booting, but UIView is now being rejected because generated view config doesn't match native. * Fix a few yarn flow-check-ios issues * Make iOS flow clean * RNTester mac booting * Fix all yarn flow-check-macos issues * Add macOS equivalents for new iOS bundles * Make Android pass flow check * Fixed merge conflict errors, updated upstream diff comments. * Fixed more merge comments * Fixed PaperUIManager.js to add 'ios' || 'macos' case. Enabled building of RCTSurface for macos. * Fix macOS unit tests. * All macOS tests passing * Updated build scripts to build and test via Pods. * Fix lint and flow errors * Fix pod install * Change files * Fix build script to specify RNTesterPods.xcworkspace * Fix Release * Change files * Remove beachball change files. * Fix beachball to exclude internal packages * Fix react-native-macos-init * Fix react-native run-macos * Fix react-native-xcode.sh to work in repo and out of repo. * Fix RedBox * Synchronize android sources under ReactAndroid & ReactCommon with RNv0.61.5 .. This builds a clean base upon which all the patches will be rebased .. * Patches for some of the basic build customizations. Includes (1) Nuget step configuration files (2) build param to support excluding all SOs from library archives * Exclude package from beachball * Fixing the nuget configuration patches.. which was badly created last time * V8Integration patches * Changing patching command in pipeline definitions to only apply rebased patches * Consuming downloaded third party packages for folly, glog, double-conv and boost * Fixing the pipeline hacky step to update the POM file Co-authored-by: David Vacca <dvacca@fb.com> Co-authored-by: Eli White <eliwhite@fb.com> Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com> Co-authored-by: Thibault Malbranche <thibault.malbranche@epitech.eu> Co-authored-by: Michał Osadnik <osdnk@fb.com> Co-authored-by: Florian Cargoët <florian.cargoet@gmail.com> Co-authored-by: Samuel Susla <samuelsusla@fb.com> Co-authored-by: Moti Zilberman <moti@fb.com> Co-authored-by: sunnylqm <sunnylqm@qq.com> Co-authored-by: Joshua Gross <joshuagross@fb.com> Co-authored-by: Kevin Gozali <fkg@fb.com> Co-authored-by: Rodinei Fagundes <rodinei.jf@gmail.com> Co-authored-by: Kid Commit <26439946+ferdicus@users.noreply.github.com> Co-authored-by: Rick Hanlon <rickhanlonii@fb.com> Co-authored-by: Brian Vaughn <bvaughn@fb.com> Co-authored-by: Logan Daniels <logand@fb.com> Co-authored-by: David Aurelio <davidaurelio@fb.com> Co-authored-by: Adlai Holler <adlai@google.com> Co-authored-by: Onti Vals <ontiv@microsoft.com> Co-authored-by: Dan Abramov <gaearon@fb.com> Co-authored-by: Sidharth Guglani <sidharthguglani@fb.com> Co-authored-by: Bruno Lemos <brunohplemos@gmail.com> Co-authored-by: Kant <quent92100@gmail.com> Co-authored-by: Scott Rice <srice@fb.com> Co-authored-by: Avik Chaudhuri <avik@fb.com> Co-authored-by: justin ross <ross.justin.t@gmail.com> Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com> Co-authored-by: Vojtech Novak <vonovak@gmail.com> Co-authored-by: Oleksandr Melnykov <omelnykov@fb.com> Co-authored-by: iyegoroff <iegoroff@gmail.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com> Co-authored-by: Ram N <axe@fb.com> Co-authored-by: Spencer Ahrens <sahrens@fb.com> Co-authored-by: jeswinsimon <jeswinsimon@gmail.com> Co-authored-by: empyrical <empyrical@outlook.com> Co-authored-by: Adam Ernst <adamjernst@fb.com> Co-authored-by: jsfu <sen870825@qq.com> Co-authored-by: Rodrigo Salazar <rodrigos@fb.com> Co-authored-by: Pascal Hartig <phartig@rdrei.net> Co-authored-by: Peter Argany <petetheheat@fb.com> Co-authored-by: Marc Horowitz <mhorowitz@fb.com> Co-authored-by: Mike Grabowski <grabbou@gmail.com> Co-authored-by: Mehdi Mulani <mehdi@fb.com> Co-authored-by: SachinTotale <sachin.totale@servicemax.com> Co-authored-by: James Treanor <jtreanor3@gmail.com> Co-authored-by: Max Thirouin <git@moox.io> Co-authored-by: Gabriel Furini <gabrielfurini@gmail.com> Co-authored-by: REDMOND\acoates <acoates@microsoft.com> Co-authored-by: Alexander Kawrykow <akawry@fb.com> Co-authored-by: Dulmandakh <dulmandakh@gmail.com> Co-authored-by: Frieder Bluemle <frieder.bluemle@gmail.com> Co-authored-by: Krzysztof Magiera <krzys@swmansion.com> Co-authored-by: Tom Targosz <tom.targosz@yahoo.com> Co-authored-by: Pavlos Vinieratos <pvinis@gmail.com> Co-authored-by: Miguel Alatzar <this.migbot@gmail.com> Co-authored-by: Janic Duplessis <janicduplessis@gmail.com> Co-authored-by: gaodeng <gaodengming@gmail.com> Co-authored-by: Alaa Ben El Ahmar <alaa.benelahmar@qucit.com> Co-authored-by: Martin Sherburn <mns@oculus.com> Co-authored-by: Albert Sun <fatalsun@fb.com> Co-authored-by: Ilia Burdukovski <ilia.burdukovski@ya.ru> Co-authored-by: Radek Czemerys <radko93@gmail.com> Co-authored-by: Kacper Wiszczuk <kacperwiszczuk@gmail.com> Co-authored-by: Vincent Cheung <vincent.cheung@rea-group.com> Co-authored-by: Anand Rajeswaran <anand.rajeswaran@outlook.com> Co-authored-by: Anandraj Govindan <anandrag@microsoft.com>
2020-04-28 21:49:15 +03:00
+onFailure: (errorCode: number, error: string) => void;
}
export default (TurboModuleRegistry.get<Spec>('JSDevSupport'): ?Spec);