Граф коммитов

16153 Коммитов

Автор SHA1 Сообщение Дата
zhongwuzw fc3225d0f1 Remove null file reference in Xcode project (#23883)
Summary:
So strange we have some null reference in Xcode, let's remove them.
CC. cpojer .

[iOS] [Fixed] - Remove null file reference in Xcode project
Pull Request resolved: https://github.com/facebook/react-native/pull/23883

Differential Revision: D14436828

Pulled By: cpojer

fbshipit-source-id: da6eb3b6a0941a9f91991403d1eef53da94a543a
2019-03-13 01:01:19 -07:00
a-c-sreedhar-reddy 85e8b3e21d Fix PickerAndroid breaking when child is null. (#23884)
Summary:
On conditional rendering if child is null then the PickerAndroid breaks.

when conditional rendering is used then picker breaks when the child is null.

This conditional rendering inside Picker fails when a is 1, because child will be null in PickerAndroid.android.js.

```
{
   this.state.a === 2 && <Picker.Item label="value" value="value" />
}
```
[ANDROID] [FIXED] - Filter props.children.
Pull Request resolved: https://github.com/facebook/react-native/pull/23884

Differential Revision: D14436860

Pulled By: cpojer

fbshipit-source-id: 6a8fca604acf77c20729f26a53cd7f67e514deac
2019-03-13 00:38:52 -07:00
michalchudziak 3898ee3a01 Move `@react-native-community/eslint-config` devDependencies to dependencies (#23766)
Summary:
I moved `devDependencies` to `dependencies` section of `packages/eslint-config-react-native-community`, to avoid the need for installation of them in the main projects. Now the installation should match the guide, from https://github.com/facebook/react-native/tree/master/packages/eslint-config-react-native-community

[General] [Changed] - Moved `devDependencies` of eslint config to `dependencies` section.
Pull Request resolved: https://github.com/facebook/react-native/pull/23766

Differential Revision: D14436081

Pulled By: cpojer

fbshipit-source-id: 770110eb4b2b6dfbbb7456fd1b69e20a8473a4e2
2019-03-12 23:37:18 -07:00
Andrew Schenk 25d397651e adds type checking to Animated toValue and iterations key values to m… (#23812)
Summary:
…ake sure Android does not crash from bad params when using useNativeDriver

Android apps crash when using Animated useNativeDriver: true and the toValue is not a number.  See issue here with test case.  [Issue](https://github.com/facebook/react-native/issues/23810)

[Android] [fixed] - Fix crash when using Animated with useNativeDriver and a non Number toValue
Pull Request resolved: https://github.com/facebook/react-native/pull/23812

Differential Revision: D14436113

Pulled By: cpojer

fbshipit-source-id: 89fb3180c08cc5ffb817b3984dacda0a80b4f703
2019-03-12 22:54:22 -07:00
zhongwuzw e3a3231e2f Add SurfacePresenterStub header to project header for tvOS (#23855)
Summary:
We need to add SurfacePresenterStub header to project header for tvOS.
Related 544d9fb10b
CC. sahrens .

[iOS] [Fixed] - Add SurfacePresenterStub header to project header for tvOS
Pull Request resolved: https://github.com/facebook/react-native/pull/23855

Differential Revision: D14436185

Pulled By: cpojer

fbshipit-source-id: b59369541e78967346fc9e9fa6a9685725834f39
2019-03-12 22:46:49 -07:00
zhongwuzw 585d41b30a Add DerivedData to BLACKLISTED_PATTERNS for haste paths (#23807)
Summary:
Each time, when I run `iOS` tests like `RNTesterIntegrationTests`, Xcode will copy the bundle in `DerivedData` directory, and we added `RNTesterUnitTestsBundle.js` to bundle, so it leads `Haste module naming collision`, I think we can add `DerivedData` directory to blacklist.

<img width="752" alt="c7d7dcbd-6507-481a-a8ef-64f16fec3a6f" src="https://user-images.githubusercontent.com/5061845/53960917-6888cc80-4122-11e9-9d1d-faac97f73a26.png">

[iOS] [Fixed] - Add DerivedData to BLACKLISTED_PATTERNS for haste paths
Pull Request resolved: https://github.com/facebook/react-native/pull/23807

Differential Revision: D14436103

Pulled By: cpojer

fbshipit-source-id: fa4bbd87d429f70167253aa38ff20049c9df58b4
2019-03-12 22:32:18 -07:00
zhongwuzw 9df493dc94 Added placeholder attributes example to RNTester (#23769)
Summary:
After some works, we already support some attributes to text input's placeholder, so we can add example to show it in RNTester.

[iOS] [Added] - Added placeholder attributes example to RNTester
Pull Request resolved: https://github.com/facebook/react-native/pull/23769

Differential Revision: D14436086

Pulled By: cpojer

fbshipit-source-id: 8637dcb82a2e6aa51e351fd696b049aaee893997
2019-03-12 22:27:26 -07:00
ericlewis 01033d16ec Silence Xcode warning (#23880)
Summary:
Fixes a warning in React Xcode proj. Should be a trivial change.

[iOS] [Fixed] - uncaptured lambda warning
Pull Request resolved: https://github.com/facebook/react-native/pull/23880

Differential Revision: D14435848

Pulled By: cpojer

fbshipit-source-id: 83c126c7401ac32b769ff17172f4f4ae576bd771
2019-03-12 22:08:21 -07:00
ericlewis 48ccafccbf Enable inline requires for RNTester (#23881)
Summary:
Turns on inline requires feature for RNTester! 🏎

[General] [Added] - Inline requires for RNTester
Pull Request resolved: https://github.com/facebook/react-native/pull/23881

Differential Revision: D14435862

Pulled By: cpojer

fbshipit-source-id: b75541d359937326178129371b6db0305731fceb
2019-03-12 21:52:29 -07:00
Ramanpreet Nara b8f9932883 Make FBReactModule, RCTNetworking, and RCTImageLoader use new Plugin API
Summary: This diff wires up everything from the previous 8 diffs. After this, all codepaths that execute `modulesConformingToProtocol` in `RCTImageLoader.m` will instead use iOS plugins to retrieve the modules on FBiOS.

Reviewed By: fkgozali

Differential Revision: D14360252

fbshipit-source-id: 6f0cecfa8dffa1955ba2f9ed54bc1c130fb23341
2019-03-12 21:07:36 -07:00
Estevão Lucas 0090ab32c2 - Add support for "reduce motion" into AccessibilityInfo (#23839)
Summary:
This PR adds `isReduceMotionEnabled()` to `AccessibilityInfo` in other to add support for "reduce motion", exposing the Operational System's settings option. Additionally, it adds a new event, `reduceMotionChanged`, in order to listen for this flag's update.

With this feature, developers will be able to disable or reduce animations, _**something that will be required as soon as WCAG 2.1 draft got approved**._ See [WCAG 2.1 — 2.3.3 Animations from Interaction criteria](https://knowbility.org/blog/2018/WCAG21-233Animations/)

It's exposed by [`UIAccessibility`' isReduceMotionEnabled ](https://developer.apple.com/documentation/uikit/uiaccessibility/1615133-isreducemotionenabled
) on iOS and [Settings.Global.TRANSITION_ANIMATION_SCALE](https://developer.android.com/reference/android/provider/Settings.Global#TRANSITION_ANIMATION_SCALE) on Android.

Up until now, `AccessibilityInfo` only exposes screen reader flag. By adding this second accessibility option, it's a good opportunity to rename `fetch` method to an appropriate name, `isScreenReaderEnabled`, as well as rename `change` event to `screenReaderChanged`, which will make it clearer and more specific.

(In case it's approved, a follow-up PR could exposes [more iOS acessibility flags](https://developer.apple.com/documentation/uikit/uiaccessibility), such as `isShakeToUndoEnabled`, `isReduceTransparencyEnabled`, `isGrayscaleEnabled`, `isInvertColorsEnabled`)

(iOS code inspired by [phonegap-mobile-accessibility](https://github.com/phonegap/phonegap-mobile-accessibility). And Android by [Flutter](https://github.com/flutter/engine/blob/master/shell/platform/android/io/flutter/view/AccessibilityBridge.java
))
Pull Request resolved: https://github.com/facebook/react-native/pull/23839

Differential Revision: D14406227

Pulled By: hramos

fbshipit-source-id: adf43be84c488522bf1e29d862681220ad193883
2019-03-12 20:28:21 -07:00
ericlewis 8e490d4d87 Fabric: fix border memory leaks (#23815)
Summary:
This fixes a few memory leaks in fabrics handling of colors for borders, when using CGColorRef's we must be diligent about releasing the memory back.

[iOS] [Fixed] - Border style memory leaks
Pull Request resolved: https://github.com/facebook/react-native/pull/23815

Differential Revision: D14431250

Pulled By: shergin

fbshipit-source-id: dc663c633ae24809cb4841800d31a6ac6eeb8aa5
2019-03-12 20:13:28 -07:00
ericlewis 10d28421cf Fabric: fix startSurfaceWithSurfaceId typo (#23876)
Summary:
Fixes a trivial typo in `startSurfaceWithSurfaceId` method.

[iOS] [Fixed] - Typo in startSurfaceWithSurfaceId
Pull Request resolved: https://github.com/facebook/react-native/pull/23876

Differential Revision: D14435111

Pulled By: shergin

fbshipit-source-id: 252f60cc0eec6e355fcaf0f64cb987afd8d5ec72
2019-03-12 20:00:40 -07:00
Pavlos Vinieratos 629708beda Crash reporting heaven (#23691)
Summary:
<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->
I have used RN for a long time, and for all this time, crash reporting has been less great than native development crash reporting. At some point, companies like sentry, bugsnag and a bunch of others started supporting sourcemaps for js crashes in RN, which helped a lot.
But native crashes were (and still are) much harder to diagnose.

..Until now :D

I have make a repo of a sample RN app, included this PR in it, and some code and screenshots to help.
The repo is [here](https://github.com/pvinis/react-native-project-with-crash-heaven-pr).

I was trying to get good crash reports from native crashes in iOS for a looong time. I spoke with people in sentry, in bugsnag and more, and I could not get this solved. There was no clear way to get the **native** crashed to display correctly.
I made two repos here, one for [sentry](https://github.com/pvinis/SentryBadStack) and one for [bugsnag](https://github.com/pvinis/BugsnagBadStack), demonstrating the correct js handling and the bad native handling.

After all this, and talks with their support, twitter etc, I investigated further, on **why** this was happening. I thought there must be some reason that native crashes look bad in all the tools, and in the same way. Maybe it's not their fault, or up to them to fix it, or maybe they didn't have the experience to fix it.

In a test project I created, I checked what's up with the `RCTFatalException`, and I found out that the React Native code is catching the `NSException`s that come from any native modules of a RN app and converting it into an string and sending it to `RCTFatal` that created an `NSError` out of that string. Then it checks if the app has set a fatal error handler and if not, goes ahead and throws that `NSError`.

The problem here is that `NSException` has a bunch more info that the resulting `NSError` is missing or is altering. Turning the callstack into a string renders crash reporting tools useless as they are missing the original place the exception was thrown, symbols, return addresses etc. In both repos above it can be seen that both tools were thinking that the error happened somewhere in the `RCTFatal` function, and it did, since we create it there, losing all the previous useful info of the original exception. That leaves us with just a very long name including a callstack, but very hard to actually map this to the code and dsym.

I added a fatal exception handler, that mirrors the fatal error handler, as the error handler is used around React Native internal code.

Then I stopped making a string out of the original `NSException` and calling `RCTFatal`, and I simply throw the exception. This way no info is lost!

Finally, I added some code examples of native and js crashes and added a part in the `RNTester` app, so people can see how a js and a native error look like while debugging, as well as try to compile the app in release mode and see how the crash report would look like if they connect it to bugsnag or sentry or their tool of choice.

I have attached some images at the bottom of this PR, and you can find some in the 3 repos I linked above.

[iOS] [Fixed] - Changed the way iOS native module exceptions get handled. Instead of making them into an `NSError` and lose the context and callstack, we keep them as `NSException`s and propagate them.
[General] [Added] - Example code for native crashes in iOS and Android, with buttons on RNTester, so developers can see how these look when debugging, as well as the crash reports in release mode.
Pull Request resolved: https://github.com/facebook/react-native/pull/23691

Reviewed By: fkgozali

Differential Revision: D14276366

Pulled By: cpojer

fbshipit-source-id: b308d5608e1432d7676447347ae77c0721094e62
2019-03-12 19:41:51 -07:00
Sébastiaan Versteeg c991e1c4cc Add Image.getSizeWithHeaders (#18850)
Summary:
This adds new functionality to the `Image` component by allowing you to retrieve the width and height of an image just like you'd do with [`Image.getSize`](https://facebook.github.io/react-native/docs/image.html#getsize) but _with_ the ability to provide headers to your request.

Why would you need this you ask? Well, imagine that you have an image that you're loading into your `Image` component that is protected and you get access by using a token in a header (or something similar). That would work. However, getting the dimensions isn't possible since you can't provide those same headers.
This is something that is bothering me when using a third-party library (https://github.com/archriss/react-native-image-gallery) and instead of implementing this just for that single library I imagined that it would be useful for anyone else that needs to get the image dimensions before displaying it.

[Android] [Added] - Added Image.getSizeWithHeaders
[iOS] [Added] - Added Image.getSizeWithHeaders
Pull Request resolved: https://github.com/facebook/react-native/pull/18850

Differential Revision: D14434599

Pulled By: cpojer

fbshipit-source-id: 56d5e58889ddf7ddc12d5f6f7d9dc6921fa17884
2019-03-12 19:20:31 -07:00
Mike Grabowski 8270de9c2c Fix DatePickerIOS e2e tests (#23861)
Summary:
DatePickerIOS tests stopped working after US changed their time zone on CircleCI. I decided to update the tests to be more reliable, by:
- removing "timezoneoffset" from the examples - I don't think it's needed. We don't demonstrate other props and it was causing us some troubles when timezones actually changed
- changing "interval" example from "time-only" to "datetime" because there's a known bug that prevented the previous example from working https://github.com/facebook/react-native/issues/9566
- splitting the label to two: one for date and other one for time, so that we can match the date only when we test "date" mode only

[IOS] [FIXED] - Improved reliability of DatePickerIOS e2e tests
Pull Request resolved: https://github.com/facebook/react-native/pull/23861

Differential Revision: D14434324

Pulled By: cpojer

fbshipit-source-id: 0f82b7e94bb1cb6ce75b44badd0064d1754370b9
2019-03-12 18:35:02 -07:00
Héctor Ramos 3ceeeb7343 Use Backlog label to keep issues open (#23789)
Summary:
The Stale bot closes issues that have been inactive for 97 days (90 days until marked as stale, then 7 days of no activity before it is closed). This helps us focus on issues that affect new releases, and gets rid of drive-by issues where there has been no follow up. This process, however, does not acknowledge there's a type of issue that trascends releases and which the team might want to keep track of in order to fix in a future release.

The "Resolution: Backlog" label can be used to mark these types of issues, and keep the bot from closing them.

[General] [Added] - GitHub: Add Backlog label
Pull Request resolved: https://github.com/facebook/react-native/pull/23789

Differential Revision: D14429112

Pulled By: hramos

fbshipit-source-id: ddec7d994a40e46b43de45b79a812fd4dbd28e6a
2019-03-12 15:16:52 -07:00
Héctor Ramos 0f7a278bbe Add RCTSurfacePresenterStub to tvOS target
Summary:
Changelog:

[iOS][Added] - Add RCTSurfacePresenterStub to tvOS target

Reviewed By: fkgozali

Differential Revision: D13498458

fbshipit-source-id: abad840ca1a087e1d2671549108cb05164b65200
2019-03-12 15:03:04 -07:00
David Aurelio 015b5ddc2e Remove configuration for avoiding JNI refs
Summary:
@public

Removes the configuration field to avoid weak JNI refs. It is no longer used.

Reviewed By: marco-cova

Differential Revision: D14424594

fbshipit-source-id: f0877022615a11ac5079354e0977c6893b7d58d7
2019-03-12 13:15:18 -07:00
David Aurelio 85b3454678 No more weak JNI refs!
Summary:
@public

Completely removes the usage of weak JNI refs.

This is great, because node allocation and deallocation no longer go through a VM-global lock to access the weak reference table.
This is also great, because we can no longer overflow that ref table.
Performance is comparable to weak refs.

Reviewed By: marco-cova

Differential Revision: D14423068

fbshipit-source-id: 62003d2d6fd971e91460a26fb3477046f26e2ba5
2019-03-12 13:15:18 -07:00
zhongwuzw 17415938c7 Fix TextInput maxLength when insert characters at begin (#23472)
Summary:
Fixes #21639 , seems we tried to fix this before, please see related `PR` like [D10392176](36507e4a3c), #18627, but they don't solve it totally.

[iOS] [Fixed] - Fix TextInput maxLength when insert characters at begin
Pull Request resolved: https://github.com/facebook/react-native/pull/23472

Reviewed By: mmmulani

Differential Revision: D14366406

Pulled By: ejanzer

fbshipit-source-id: fc983810703997b48824f84f2f9198984afba9cd
2019-03-12 11:16:44 -07:00
Emily Janzer 0b266458ea Change EventBeatManager and AsyncEventBeat to use RuntimeExecutor
Summary:
Right now we have a raw pointer to the js runtime in Java and we pass that to EventBeatManager's constructor; this diff adds a setter for the runtime ptr and removes it from the member initializer list, so that you can set it later from cpp instead.

Q: Should I just rewrite this to use RuntimeExecutor instead?

Reviewed By: shergin

Differential Revision: D14318893

fbshipit-source-id: 1221dd5959927967bad870f15c901c15e5455874
2019-03-12 11:06:52 -07:00
Joshua Gross 34b7087515 Remove folly::futures targets
Summary: Remove unused BUCK targets.

Reviewed By: fkgozali

Differential Revision: D14416459

fbshipit-source-id: f9ee07c6e30dc825627cda9bdf8128ada5ef5166
2019-03-12 10:56:51 -07:00
David Vacca 726d001210 Cleanup TextLayoutManager
Summary: Easy cleanup of commented code in TextLayoutManager, I kept the TODOs to complete the code in the future

Reviewed By: shergin

Differential Revision: D14372356

fbshipit-source-id: ff87f9b09e9f40ed021256f463e39299467b3e0e
2019-03-11 19:24:06 -07:00
David Vacca 36957dcedd Disable ImportantForAutofill when using Android API level < 26
Summary: Disable ImportantForAutofill when using Android API level < 26

Reviewed By: wcheng86

Differential Revision: D14400085

fbshipit-source-id: db8f94d38ed6b3f6559a13abb8752f08a3d0dab2
2019-03-11 18:49:07 -07:00
Marco Zandonadi 756dc2f3ed Fix #import/include in SliderShadowNode
Summary: This diff is a part of an effort to resolve build errors that appear when compiling with the latest version of clang.

Reviewed By: shergin

Differential Revision: D14369797

fbshipit-source-id: e4c6f53e293f336efad18597f9d2705c025e1051
2019-03-11 12:36:28 -07:00
Evan Bacon 05d5eeb818 Removed `Platform.web` (#23830)
Summary:
Initially if a `react-native-web` project were to use a library that required internals `expo/webpack-config` would polyfill those internals. This `Platform.web` was used for cases where `react-native` modules needed other internal `react-native` modules, ex: `Animated/src/AnimatedEvent -> Renderer/shims/ReactNative -> Renderer/oss/ReactNativeRenderer-dev -> Core/InitializeCore -> Devtools/setupDevtools -> WebSocket/WebSocket -> Utilities/Platform`

The consensus is that if any `react-native` library references a `react-native` internal (ex: `react-native/*`), it should continue to throw errors. We've removed the use of internals from all of the Unimodules, `react-navigation`, and `react-native-gesture-handler`. This covers a wide enough area for a lot of projects to get web support.

* Add emitters for libs referencing internals necolas/react-native-web#1275
* Remove monkey patch that bundles RN, libs that use internals will crash instead expo/expo-cli#409
* Remove all unsupported internals and polyfills from the Expo suite expo/expo#3676
* Remove internals from react-native-gesture-handler kmagiera/react-native-gesture-handler#406

* Related #23387

[GENERAL] [REMOVED] - Platform.web.js
Pull Request resolved: https://github.com/facebook/react-native/pull/23830

Differential Revision: D14406145

Pulled By: hramos

fbshipit-source-id: bdda99a334d33f5543fdb954eb80e2e7186f985a
2019-03-11 11:38:22 -07:00
Tom Duncalf cecd307708 Remove duplicated Yoga compile sources to prevent "duplicate symbols" errors when linking using -force_load (#23823)
Summary:
This change fixes https://github.com/facebook/react-native/issues/23645.

The issue is that the `YGMarker.cpp`, `YGValue.cpp`, `YGConfig.cpp` and `log.cpp` files are already included in the Yoga compilation unit, so including these files in React's compile sources too results in "duplicate symbols" errors when loading React Native with `-force_load` (which behaves slightly differently to `-ObjC` - according to a colleague, "ObjC will scan through each object file in each library and force linking of any object file that contains Objective C code, while force_load will link every object file in a particular staticlib (regardless of whether or not the object file contains Objective C code)").

These changes seemed to be introduced by a few commits:
- D13819111 -> 43601f1a17
- D13439602 -> b5c66a3fbe
- D14123390-> e8f95dc7a1
- D7530369 -> 95f625e151

Perhaps we need to check with the original authors/any C++ experts to confirm if this fix is correct - it compiles for me but I'm not sure what the original intention of these changes was.

[iOS] [Fixed] - Remove duplicated Yoga compile sources to prevent "duplicate symbols" errors when linking using -force_load
Pull Request resolved: https://github.com/facebook/react-native/pull/23823

Reviewed By: davidaurelio

Differential Revision: D14387657

Pulled By: hramos

fbshipit-source-id: d85221b6dc1a0377662624f4201b27222aed8219
2019-03-11 10:05:52 -07:00
Ramanpreet Nara f741d33840 Fix internal breakages
Summary: D13103990 updated the flow types for ScrollView. This diff just updates our internal callsites to address the flow errors.

Reviewed By: TheSavior

Differential Revision: D14305453

fbshipit-source-id: 58fe28da06a6c83a81ba29bebe96e74c2f3ed5e5
2019-03-08 11:39:41 -08:00
Michał Pierzchała fe533a482d Flow strict ScrollView; get rid of InternalScrollViewType (#22301)
Summary:
Relates to #22100.

I left 2 `$FlowFixMe`s as I was not sure how to handle generic `React.Element<>` and which native props can I pass to ScrollView (would be cool to document it once we got proper types there).

I also got rid of `InternalScrollViewType` because we have better typings in original `ScrollView` now.
Pull Request resolved: https://github.com/facebook/react-native/pull/22301

Reviewed By: TheSavior

Differential Revision: D13103990

Pulled By: RSNara

fbshipit-source-id: 9664ee9d7f570b00992215e10901e5317f24fe5c
2019-03-08 11:39:41 -08:00
Valentin Shergin 205171cab0 Fabric: Simpler view preallocation on iOS
Summary:
I measured the performance of UIMananger methods and found that `create` method spends a significant amount of time on preallocating views (around 10 ms on my device). Interestingly, this time was actually spent on dispatching operations on the main thread, not on performing those operations. That makes me think about think about the preallocation problem one more time.
(Here and later I discuss preemptive optimistic preallocation views on iOS, but the issues are more-less applicable for all platforms.)

BTW, what's view preallocation? – In React Native we believe that we can get significant TTI wins instantiating platform views ahead of time while JavaScript thread is busy doing reconciliation and the main one is idle.

So, seems the current approach has those downsides:
 * We spend too much time on dispatching only (jumping threads, creation Objective-C blocks, managing them in GCD, incrementing atomic refcountes inside `ShadowView` and so on). That's wasteful.
 * We don't have much information during preallocations that can help prepare something to save time in the future. We don't know the future size of the component, so we cannot e.g. pre-draw a border or even allocate memory for a future drawing.
 * We pre-allocate to much. At the moment of component creation, we don't know will this component be filtered out by view-flattening infra or not, so we always allocate a view for it. That's ~30% more views that we actually need.
 * We don't stop allocating (or dispatching instructions for that) after the recycle pool is already filled in. That's also wasteful.

Why is this so bad and how can we fix it properly?..

I thought about this problem for months. And I think the answer is trivial: We don't know the exact shape of the interface until we finish creating it, and there is no way to overcome this problem on the client side. In the ideal world, the server size (or hardcoded manifest somewhere) tells the renderer (at the moment where we started navigating to it) how many views of which type will some surface use.

And until our world is not so perfect, I think we can get a significant performance improvement doing simple preallocation of 100 regular views, 30 text views, and 30 image views during rendering the first React Native surface. So I hardcoded that.

Reviewed By: JoshuaGross

Differential Revision: D14333606

fbshipit-source-id: 96beeb58b546258de1b8fd58550e0ae412b78aa9
2019-03-08 10:27:05 -08:00
Eli White e3b2818581 Add test for -0.0 float
Summary:
This was an idea to check by Joshua Gross

Changelog:
[General][Internal] Codegen: Adding test for negative zero floats

Reviewed By: JoshuaGross

Differential Revision: D14378418

fbshipit-source-id: 4d18eea18143c501d3f2e7ba334f35ec1dd140e6
2019-03-07 18:21:27 -08:00
Spencer Ahrens 544d9fb10b Use surface observer for Animated
Summary:
Right now we rely on the Paper UIManager to update animated node graphs - this hooks us into `RCTSurfacePresenter` in the same way so we are no longer reliant on Paper. Should also help with complex ordering corner cases with pre vs. post operations and restoring defaults when nodes are removed. More info:

https://github.com/facebook/react-native/pull/11819/files

Note that we don't have a way to differentiate animation nodes related to fabric views vs. paper views, so if paper and fabric are both rendering updates simultaneously it's possible they could get processed by the wrong callback. That should be very rare, rarely cause problems even if it does happen, and won't be a problem at all in a post-Paper world.

Reviewed By: shergin

Differential Revision: D14336760

fbshipit-source-id: 1c6a72fa67d5fedbaefb21cd4d7e5d75484f4fae
2019-03-07 17:39:00 -08:00
Spencer Ahrens 3e40837a85 Fix animation delay
Summary:
We currently rely on the Paper UIManager calling `uiManagerWillPerformMounting` to flush the animated operations queue, which includes starting and stopping animations. This mostly works right now because Fabric always starts after Paper, but sometimes Paper doesn't fire `uiManagerWillPerformMounting` for a while, which can delay an animation starting.

To fix this, I force a flush of the queues on the UIThread whenever start or stop is called. This should be safe because the order of animation operations is still preserved, and start/stop are (almost?) always called in dedicated event handler loops, so any other updates like changing the way nodes are attached should already have been processed from a previous JS execution loop.

Reviewed By: JoshuaGross

Differential Revision: D14313502

fbshipit-source-id: 2a2b0c614fd1a591bd04b6b3fafcc09ff6c9d6e7
2019-03-07 17:39:00 -08:00
Valentin Shergin 2862ef3a47 Fabric: Using `small_vector` instead of regular `vector` in some hot code paths
Summary: The hope is that it will remove many unnececery allocations improving overal perfromance.

Reviewed By: mdvacca

Differential Revision: D14249198

fbshipit-source-id: f0442b3919ccead0582a3190dea0e33d517d85f6
2019-03-07 13:41:20 -08:00
Valentin Shergin c3ecae0db4 Fabric: Using small_vector for SharedShadowNodeList
Summary:
SharedShadowNodeList is one of the core collections in Fabric. Every ShadowNode has one, it's used intensivly during diffing and so on.
Usually, nodes have a very few children, so using `small_vector` instead of regular `vector` should save us a lot of memory allocations.

Reviewed By: JoshuaGross

Differential Revision: D14249201

fbshipit-source-id: 53297caa027a74099d0a1ed4a3cce78f8feb651b
2019-03-07 13:41:20 -08:00
Alexander Zhang efd28bdc84 Revert D14186694: [RN] Use global or scoped performance loggers everywhere
Differential Revision:
D14186694

Original commit changeset: 062c76eea8fc

fbshipit-source-id: 6d99b94d21da6df4375e342fdecceeebf05959d5
2019-03-07 13:12:12 -08:00
Valentin Shergin 136666e2e7 Fabric: Using stored inside ShadowNode pointer to Descriptor instead of table lookup
Summary:
Nowadays, every ShadowNode has a reference to a ComponentDescriptor, so now there is no need to do registry lookup for that.
That should save us 0.5-1.0 ms in my non-scientific measurements.

Reviewed By: mdvacca

Differential Revision: D14348369

fbshipit-source-id: 57f6a6f2f8bf0b7e58d89a414fec20b2db8876f7
2019-03-06 20:06:08 -08:00
Mack Browne 903d52551c Fix broken links in table of contents Readme (#23795)
Summary:
I noticed the links under `## Contents` weren't clickable in the README.md file. This PR makes the links in table of contents clickable again.

[General] [Fixed] - Fix broken links for the table of contents in `README.md`
Pull Request resolved: https://github.com/facebook/react-native/pull/23795

Differential Revision: D14350857

Pulled By: hramos

fbshipit-source-id: ddc02e7905b653cf65ad6ad631bccdbbca936a7f
2019-03-06 17:13:35 -08:00
George Zahariev 35d2dfcabf Deploy 0.94 to xplat
Summary:
Update Flow version in xplat (https://our.intern.facebook.com/intern/wiki/Flow/Flow_Release_Process/#update-xplat-js)

allow-large-files
bypass-lint

Reviewed By: nmote

Differential Revision: D14317820

fbshipit-source-id: 07ec22c0745321db036f4e10a502009a4b640652
2019-03-06 14:57:30 -08:00
Maxiee bc0bb2c88e Fix small typo in InteractionManager-test.js (#23782)
Summary:
Fix small typo in InteractionManager-test.js

[General] [Fixed] - Fix small typo in InteractionManager-test.js
Pull Request resolved: https://github.com/facebook/react-native/pull/23782

Differential Revision: D14349443

Pulled By: hramos

fbshipit-source-id: aefa6ec2ed861d23dbc77af7b4918ddff9078ccd
2019-03-06 12:14:32 -08:00
Héctor Ramos c53d918c4e Use Markdown extension in SUPPORT file (#23791)
Summary:
Followup to fe80a0c01d. Use a Markdown extension to let GitHub know this can be rendered as a Preview, otherwise GitHub will display the plaintext version.

[General] [Fixed] - Use Markdown in SUPPORT file
Pull Request resolved: https://github.com/facebook/react-native/pull/23791

Differential Revision: D14349422

Pulled By: hramos

fbshipit-source-id: 836746f35c6e962f3ca64a138bbf764529a6e043
2019-03-06 12:09:13 -08:00
Héctor Ramos 2715898cb9 Trivial: Fix typo in README link (#23792)
Summary:
Link to docs repo is broken in markdown.
Pull Request resolved: https://github.com/facebook/react-native/pull/23792

Differential Revision: D14348403

Pulled By: hramos

fbshipit-source-id: 76cfd620ec87250df77e535b3c215d682b19c8f7
2019-03-06 11:38:28 -08:00
Alexey Lang a9b3ca7fa7 Use global or scoped performance loggers everywhere
Summary:
I'm changing all callsites to use either global or scoped perf logger explicitly in one diff.
`GlobalPerformanceLogger` is basically a singleton
`scopedPerformanceLogger` is scoped to the React tree by using a React Context

Reviewed By: sahrens

Differential Revision: D14186694

fbshipit-source-id: 062c76eea8fce9d9b531f0eddf153bb79d52f68d
2019-03-06 09:51:56 -08:00
Héctor Ramos ea8571b0eb Update README (#23779)
Summary:
Clean up and make the README look a bit nicer. Inspired by https://github.com/gatsbyjs/gatsby/blob/master/README.md.

This PR brings back an introduction to React Native that focuses on our strengths. I'm happy to punt updates to the marketing copy for later, if we want to focus on updating the README layout first.

![readme](https://user-images.githubusercontent.com/165856/53846592-59f3b700-3f62-11e9-95cf-4391c74460f4.png)

[General][Changed] - Nicer README.
Pull Request resolved: https://github.com/facebook/react-native/pull/23779

Differential Revision: D14341562

Pulled By: hramos

fbshipit-source-id: 87dba4fe4e3598f638fdc499347a2c9aedde8f8d
2019-03-06 06:20:06 -08:00
Héctor Ramos fe80a0c01d Add SUPPORT document, update other GitHub templates (#23778)
Summary:
See https://help.github.com/en/articles/adding-support-resources-to-your-project. The SUPPORT file is surfaced by GitHub in several useful places. The goal is to increase discoverability of all support resources, giving the reader an opportunity to find the help they need before they open an issue in the              repository. A secondary goal is to use a friendlier tone when communicating our processes.

The issue templates have been standardized to follow the format used by GitHub's template tool. A bug in the "Regressions" template, due to its use of multiple labels, is fixed as well.
The bot will explain how a changelog can be fixed when it nags a PR.

[General][Added] - Added SUPPORT resources, friendlier messaging.
Pull Request resolved: https://github.com/facebook/react-native/pull/23778

Differential Revision: D14333911

Pulled By: hramos

fbshipit-source-id: d4b3e75194ea7d5c932dd8df2393d5b189f30f35
2019-03-05 17:08:24 -08:00
Héctor Ramos 427b94b56b Docker: Use the new community image, and update instructions. (#23723)
Summary:
The `Dockerfile.android` had fallen out of date. We now point to the new community image being used in the Circle CI `test_android` workflow. After spending an hour or two working with these Docker images, I saw some opportunities to clean up the docs as well.

[ANDROID] [Fixed] - Use new React Native Community Android base image for local Docker tests.
Pull Request resolved: https://github.com/facebook/react-native/pull/23723

Differential Revision: D14331737

Pulled By: hramos

fbshipit-source-id: cf42820021c997c3c06cc8b3671f67c9d2650ee5
2019-03-05 15:37:13 -08:00
Luna Wei cba75cf12d EditText turn off hardware acc. for Oreo
Summary:
Research into this error led us to this: https://issuetracker.google.com/issues/67102093

which refers to a very similar stack trace as our error:
* Both errors have a bad access in `android.text.DynamicLayout.getBlockIndex` due to a negative array index
* The report mentions it only affecting Oreo devices, this aligns with our [LogView](https://our.intern.facebook.com/intern/logview/details/facebook_android_crashes/80ce327664e6696ef03f951a9268ac29/?trace_key=cc916846a500b6efb5c68ae1a2e6b5c3) where ~99% of affected device os versions are Oreo.

As a workaround mentioned in discussion, this diff turns off hardware acceleration for Oreo devices in `ReactEditText`

Reviewed By: mdvacca

Differential Revision: D14291369

fbshipit-source-id: 797d3123bcb240abd2401ca0d7d3a5a3ef8e22e3
2019-03-05 14:39:34 -08:00
Rick Ratmansky f43f48fce1 Fixing robolectric tests by not skipping androidx instrumentation
Summary:
androidx files were not being instrumented properly which meant we would have exceptions thrown by powermock

Robolectric Instrumentation config was changed by hand, the remainder is a codemod using abgs + xargs + sed

Differential Revision: D14323745

fbshipit-source-id: 56aa97dad5d7197f4eb0ba1fdd80b1583bcad6ac
2019-03-05 14:33:42 -08:00
Valentin Shergin 393bf8aaad Fabric: Fixed a bug in ShadowViewMutation constructor
Summary:
Clowntown.
This fixes a recent regression happened becasuse wrong order of parameters in ShadowViewMutation constructor.

Reviewed By: JoshuaGross

Differential Revision: D14329164

fbshipit-source-id: 5a0dc04b889fb3357050b951d56c3e436dbeefb1
2019-03-05 14:07:20 -08:00