Commit Graph

20336 Commits

Author SHA1 Message Date
Peter Argany 62aa84a325 Deprecate calculateChildFrames from RCTScrollView
Summary:
This function is unused. (Followup to D21941946)

Changelog: [iOS] Deprecate calculateChildFrames from RCTScrollView

Reviewed By: sammy-SC

Differential Revision: D22071415

fbshipit-source-id: 0c996ab02df1431ee9cfa082bc99681a2ec7118c
2020-06-16 12:50:16 -07:00
Samuel Susla 3ff671c704 Do not retain paper view inside legacy interop after it has been recycled
Summary:
Changelog: [Internal]

Paper views are not designed to be recycled, that's why a new view is created each time legacy interop layer is used.
However paper view was not deallocated immediately after it was used, it was still being strongly referenced by `self.contentView`.
This doesn't cause an immediate issue because eventually when legacy interop layer does get reused, it will create a new paper view and replace the old one inside `self.contentView`, triggering deallocation of the old one. But we were retaining the paper view beyond what was necessary.

Reviewed By: mdvacca

Differential Revision: D22066022

fbshipit-source-id: 17c3b81468f50ebcc05f1a7cdf4d4b9b00965fc3
2020-06-16 09:59:44 -07:00
Christoph Nakazawa 56689e9e28 Remove legacy bytecode handling
Summary:
Changelog: [Internal]

A long time ago we experimented with JSC bytecode. We are not experimenting with JSC bytecode any more. This code can be removed.

Reviewed By: mhorowitz

Differential Revision: D22017374

fbshipit-source-id: 6fe3fb7ad7966f92a5cd103605ac5c0bd1f17a8e
2020-06-16 02:12:09 -07:00
Joshua Gross b69041f086 Feature-flag gate stopSurface on root view unmount
Summary:
Gate stopSurface behind a feature flag.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22054480

fbshipit-source-id: 3ea48ab46aeb3532fc7a3dd83659d7c32891ec06
2020-06-15 18:43:30 -07:00
Joshua Gross 33ed358330 Bust surfaceActiveForExecution cache after executing a batch of items
Summary:
Since we were not busting the `surfaceActiveForExecution` cache, it is very possible (likely, even!) that a surfaceId is invalidated in between UI ticks but we keep executing items for that surface at the next tick.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22055303

fbshipit-source-id: 351c13535e85b30e00684fe35fc4aa79ccb5961c
2020-06-15 18:05:19 -07:00
Joshua Gross e0294aff68 LayoutAnimations: fix crashes
Summary:
Fix crashes in LayoutAnimations:

1) It is valid to omit create, update, delete configs
2) When extracting SRT from a matrix, ignoring skew properties
3) Provide valid telemetry from LayoutAnimations transactions

Unrelated to crashes: to help debugging and until onSuccess/onError callbacks are working, log any configuration parsing errors.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22050736

fbshipit-source-id: e59418ecad0f9bfd20a2b4976557e39020c2d101
2020-06-15 17:33:07 -07:00
Christoph Nakazawa 382f0898cf Bytecode client for iOS
Summary: Changelog: [Internal]

Reviewed By: javache

Differential Revision: D21206851

fbshipit-source-id: 67ab59688c19870ef419711fdfd489bf0442bb54
2020-06-15 06:52:53 -07:00
David Vacca 6d6268e903 Fix padding flickering visible during initial render of text input
Summary:
This diff fixes a race condition that caused a flicker during initial rendering of TextInput in Fabric

The root cause is that the TextInput's State is sometimes initialized with no information from the Theme, this causes text input to be rendered with 0 padding. Later ReactTextInput manager updates TextInput state with theme data and the TextInput is re-rendered with the correct padding information.

changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D22034849

fbshipit-source-id: a2fa91f34a8340878f2ec8d231ef6c86cee08f05
2020-06-13 22:20:04 -07:00
David Vacca 1e453860d0 Ensure that layout events contain the correct padding information
Summary:
This diff changes the order of execution for the "updatePadding" mount item
Padding mountItems must be executed before layout props are updated in the view. This is necessary to ensure that events (resulting from layout changes) are dispatched with the correct padding information.

This fixes a 'flickering' bug in Marketplace Vehicles (see test plan)

changelog:[internal]

Reviewed By: JoshuaGross, sammy-SC

Differential Revision: D22034850

fbshipit-source-id: 222fa9412dd01f65a1a034f53e1eb0e7b774ec1f
2020-06-13 22:20:04 -07:00
Joshua Gross 86c38739a7 Avoid using ViewManager childCount to detect errors, since it's not reliable
Summary:
Similar to D21756178, we cannot rely on childCount since it can return zero when there are actually valid children. This both causes more exceptions than necessary when the operation would work, and pollutes error messages since the information is not strictly reliable.

Instead, we just try to get a View and thrown an exception when it's null, or in loops, loop until we hit a null child. `getChildAt` doesn't throw exceptions, it just returns null when we're out-of-bounds.

This can impact custom ViewGroups like BottomSheets, and other ViewGroups that might do interesting/weird things with children, including ReactClippingViewManager.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22035569

fbshipit-source-id: 43e98d81178faaf720face98fc84e78743f292c3
2020-06-13 18:31:41 -07:00
Samuel Susla ccf5c86bd7 Implement autoFocus in TextInput
Summary:
Changelog: [Internal]

Prop autoFocus was not implemented in Fabric's TextInput.

Reviewed By: mdvacca

Differential Revision: D22019333

fbshipit-source-id: 03f043b93e1079a5d0bff55b08ebc9d2f973c55b
2020-06-13 11:04:40 -07:00
Eddie Dugan 078e386024 fix setNativeSelectedPosition native command
Summary:
telling native that `selected` is the new selection is basically ignoring the most recent user input and resetting it back to the previous value. the reason it flips back and forth is that by the next time `onSelect` is called, the above code has updated the value of `selected` (line 63)

Changelog:
[Android] [Fixed] Picker - fix usage of setNativeSelectedPosition in onSelect

Reviewed By: mdvacca

Differential Revision: D22022456

fbshipit-source-id: fe51f9cbd712b5578e9fd9ea2992bd12d48f4ec4
2020-06-12 13:02:32 -07:00
Samuel Susla 8dce59cee8 Add incomplete support for accessibility state prop
Summary:
Changelog: [internal]

Minimal implementation of `accessibilityState` that supports `disabled` and `selected` props.

Complete implementation will need to support following props
```
export type AccessibilityState = {
  disabled?: boolean,
  selected?: boolean,
  checked?: ?boolean | 'mixed',
  busy?: boolean,
  expanded?: boolean,
  ...
};
```

Reviewed By: mdvacca

Differential Revision: D22016743

fbshipit-source-id: 1748acc4279f60ec8a92c93d5d13b136f57eb8d3
2020-06-12 11:19:49 -07:00
empyrical fb2a7765ac Update podspecs for latest Fabric changes (#28584)
Summary:
This pull request updates the Podspecs to reflect recent changes to Fabric, so they build with Fabric enabled again.

In `React-Fabric.podspec`, subspecs for the views `legacyviewmanagerinterop`, `safeareaview`, `textinput`, and `unimplementedview` are added. A minor tweak to the subspec for `rncore` was added blacklisting two codegen-generated files that have issues building, but are not actually needed yet and are empty.

In `React-graphics.podspec`, the header paths for Boost were added.

This is partially a retread of https://github.com/facebook/react-native/issues/26805, which had to be backed out due to issues with the changes to the Yoga podspec.

## Changelog

[Internal] [Fixed] - Fixed building Fabric with the Cocoapods
Pull Request resolved: https://github.com/facebook/react-native/pull/28584

Test Plan: RNTester can now compile.

Reviewed By: shergin

Differential Revision: D20966065

Pulled By: hramos

fbshipit-source-id: 73931be63b72fcb52705643f81c0f787e571eb76
2020-06-12 10:51:33 -07:00
Joshua Gross 40b36a040f For lifecycle correctness, call scheduleMountItems even with empty BatchMountItem
Summary:
In particular, NativeAnimatedModule relies on having some signal of when there's a commit from ReactJS. In Fabric, this is the only reliable signal. Failing to call scheduleMountItems even when there's no changes to the tree will result in certain animation operations being delayed way longer than necessary.

I pass nullptr instead of empty arrays in some cases to hopefully improve perf.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22008981

fbshipit-source-id: 6bdeb46e03b5138dbfa5b077952ec0fa3dfe1eb3
2020-06-11 20:46:49 -07:00
Joshua Gross 0d073013a5 Fix typos in Native Animated error messages
Summary:
see title

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22008982

fbshipit-source-id: 056b0d99e8e81a1b11cd054e6c813002ae0b7014
2020-06-11 20:46:49 -07:00
Joshua Gross 23f2ec7e8c AnimatedDivision: pass zero instead of Inf/NaN in case of division by zero
Summary:
Fabric will crash if Inf/NaN values are passed to the native side, so just pass zero to native in those cases. It's an equally (in)valid value and we're already logging the error.

Also, debounce the error so we don't spam the LogBox/console.

This should potentially be changed to a warning.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22008980

fbshipit-source-id: 1aef33a13febed04311557718f05ef79bbbcca93
2020-06-11 20:46:48 -07:00
Joshua Gross 472cf3f4ad NativeAnimatedDriver: synchronize animation lifecycle closer to Fabric or Paper lifecycle
Summary:
Switch between "Fabric" and "Non-Fabric" modes based on which types of native Views are being attached to animations. Don't allow non-Fabric to drive Fabric animations and vice-versa.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D21985411

fbshipit-source-id: fb9bef1e38375b384430b4e0275e7b6d62eda7a4
2020-06-11 20:46:48 -07:00
Mark Verlingieri 3346ac7f96 Don't scroll to initial item if ContentOffset is provided
Summary:
The initialScrollIndex in VirtualizedList contains a performance optimization to start rendering the list at the index provided.

ContentOffset does not contain this optimization and there is currently no way to specify the first item in the list to start rendering without contentOffset being ignored.

This change makes it so that if both initialScrollIndex and ContentOffset are provided, the list will start rendering at the initialScrollIndex but ContentOffset will still be used to set the scroll position.

initialScrollIndex functionality will remain the same if ContentOffset is not provided.

Changelog: [Changed] VirtualizedList will use contentOffset for scroll position instead of initialScrollIndex if both are provided

Reviewed By: sahrens

Differential Revision: D21980172

fbshipit-source-id: 36d2d2bc360845ef02329d2b95a2cf14b91c2b0b
2020-06-11 15:44:02 -07:00
Peter Argany 952c03b99a Small refactor to make RCTView more readable
Summary:
Fixes some comment typos, moves hit testing and accessibility code so it's beside each other.

No functionality changes.

Changelog:[Internal]

Reviewed By: RSNara

Differential Revision: D22003047

fbshipit-source-id: 0e785364d7e1a080034d24c9676a56acb45686bb
2020-06-11 13:23:27 -07:00
Samuel Susla fb8411d4df Round text size to closest larger pixel size
Summary:
Changelog: [Internal]

Round calculated text size to closest larger pixel size.
In Paper we do this as well in https://fburl.com/diffusion/w2pj6ea0

Why do we need this?
For example, we calculate height of the text to be 16.707235, yoga takes this value and assigns text to have height 17 anyway.
I assume Yoga uses this extra 0.3 points of height to move other things around a little bit because Yoga doesn't deal with exact values.

Reviewed By: shergin

Differential Revision: D21999032

fbshipit-source-id: 73923dc3e27fa110adb3f76cfa635e0bfdc672d4
2020-06-11 12:36:13 -07:00
Valentin Shergin 03443d77f5 Fabic: Opening up fields of ShadowNodeFamilyFragment::Value and ShadowNodeFragment::Value
Summary:
There is no good reason why they are `const` and `private`, in the future diffs we will need to mutate them.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D21992197

fbshipit-source-id: f8aee8db9ea1ff8282b38fbe3a966911678ee2c4
2020-06-11 09:48:38 -07:00
Samuel Susla 4feb5b7ffd Remove unnecessary deallocator in RCTSliderComponentView
Summary:
Changelog: [Internal]

There is no need for custom dealloc, let's get rid of it.
We also prefer east const over west const.

Reviewed By: shergin

Differential Revision: D21997545

fbshipit-source-id: aa017f99aa26421fc59b353d0012687cb38fac08
2020-06-11 09:44:21 -07:00
Samuel Susla 2290751ac9 Explicitly set default white value on Slider component
Summary:
Changelog: [Internal]

Here is what I believe happens.

We have an instance of `RCTSliderComponentView` which has green thumb tint color.

It gets reused, in prepareForRecycle we call `setThumbTintImage:nil` on its UISlider which internally sets an ivar to `nil`.
Next time `RCTSliderComponentView` gets used without explicit thumb tint color, we assign nil to UISlider's thumb tint color.
Internally this nil gets compared to nil that it saved during `prepareForRecycle` and concludes that the value is already sets and exists early.

Since we don't have access to `UISlider` I can't prove this but here is a short video where I showcase this behavior

{F239923204}

The code in video is here P133083862.

Reviewed By: shergin

Differential Revision: D21997324

fbshipit-source-id: 28a11ed817cc863a313217c475042918ee726011
2020-06-11 09:44:20 -07:00
Samuel Susla 19dcb41a46 Reset slider value during recycling
Summary:
Changelog: [internal]

We were not reseting value of slider when recycling, this would result in wrong value being displayed once slider gets reused.

Reviewed By: shergin

Differential Revision: D21996786

fbshipit-source-id: 3beac4936d0719c4ac5ac0499209300a912f6986
2020-06-11 09:44:20 -07:00
Christoph Nakazawa b4c13929e2 Fix typo
Summary: Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D21996455

fbshipit-source-id: 8fc339f987957cf58b6ff56c1b4d28f8725d70c9
2020-06-11 07:35:31 -07:00
Christoph Nakazawa 1e61fa0931 Fix MultipartResponse to allow for binary data to be sent
Summary: Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D21995098

fbshipit-source-id: b387bd45b44fe93743d34d2a3435c165d15f054f
2020-06-11 07:23:59 -07:00
David Vacca f53267f703 Migrate ReactText view to use uiManager.receiveEvent instead of ReactEventEmitter
Summary:
This diff refactors ReactTextView to use uiManager.receiveEvent instead of ReactEventEmitter. ReactEventEmitter.class should be replaced for uiManager.receiveEvent.

changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D21982548

fbshipit-source-id: 4ed5825f62c761564aa533f4e8bb1155036df7e2
2020-06-10 22:56:02 -07:00
David Vacca 95154a6b8b Migrate usages of RCTEventEmitter.class to EventDispatcher
Summary:
This diff migrates usages of RCTEventEmitter.class to EventDispatcher.dispatchEvent.

RCTEventEmitter is not compatible with Fabric, now we need to use EventDispatcher.dispatchEvent instead.

changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D21982549

fbshipit-source-id: 9ea2d9a00f063a03c2e401fc1e328ce26bcf48df
2020-06-10 22:56:02 -07:00
David Vacca a0baba654e Expose receiveEvent as a high level API on UIManager
Summary:
This diff exposes receiveEvent on the UIManager class. This is necessary to support backward compatibility between Fabric and classic RN

changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D21979687

fbshipit-source-id: 1ec75896687d55e699f79c520e21f05fac368ee6
2020-06-10 22:56:01 -07:00
Emily Janzer 92630856c6 Move error handling with JSI into a separate helper function (#29090)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/29090

Moving the logic for calling into JS to handle errors into ErrorUtils, where it can be reused outside of the bridge.

Reviewed By: RSNara

Differential Revision: D21939254

fbshipit-source-id: 0d8f3bd2503720be7619ed8dc8b2389f544049f3
2020-06-10 10:31:46 -07:00
Joshua Gross 02b8e67da3 BatchMountItem debug info should log SurfaceId
Summary:
See title.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D21965838

fbshipit-source-id: a3bd9d48c1fadb19a12cccaab5713cf73566bd93
2020-06-09 23:23:11 -07:00
Joshua Gross 912dac24fc Ignore PreAllocateViewMountItem if it's associated with a stopped surface
Summary:
Because of the previous diffs there's an increased chance of race conditions between JS executing and queuing up PreAllocateViewMountItems for surfaces that are stopped. Make sure those are ignored if they're queued up and a surface has been stopped.

Currently stopSurface only happens on the UI thread; PreAllocateViewMountItems can be queued from any thread, but are only executed on the UI thread. So once a batch of items starts executing, there's no race between teardown and execution: we just need to make sure we check that the surface is still running initially.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D21965839

fbshipit-source-id: 0241dc171022cc923b7e38dcd110d664096dde79
2020-06-09 23:23:11 -07:00
Joshua Gross 03174f1cad Call stopSurface when ReactRootView is unregistered
Summary:
In the past, in Fabric (Android), we never called stopSurface. Ever! This is bad for memory and can cause other issues, so... let's not do that.

Instead, when the ReactRootView is being torn down, we check the View ID to see if it's a Fabric RootView, and if it is, we call Fabric's stopSurface method.

Fabric stopSurface only has impact on (1) Fabric mount instructions being executed after that point and (2) tells JS to stop running the surface, on the JS thread, asynchronously.

Anecdotally it looks like all the MountItems involved in deleting and removing views from the hierarchy are executed before stopSurface is called.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D21965837

fbshipit-source-id: 5169c5a1e339fd9e016ae1234d8389b2bd30be70
2020-06-09 23:23:10 -07:00
Héctor Ramos 1c92b1cff6 Handle mixed union types and arrays of objects
Summary:
Restore legacy support for mixed union types.
These are not type safe and modules should use a different type, but we have a precedent for supporting these in the existing Linking native module. The new codegen will generate native code for these, and show a warning to encourage use of a better type.

Generate native code for elements in arrays of objects.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D21848260

fbshipit-source-id: 0b8cbf25e7a02791b4d77e349227a2b0744854f4
2020-06-09 17:48:19 -07:00
Joshua Gross fa5d3fb6b8 ScrollViewStickyHeader: update position (translateY) in Fabric ShadowTree when scrolling stops
Summary:
In Fabric, some uses of the ScrollViewStickyHeader don't work after scrolling because even though the UI correctly reflects the translateY that the StickyHeader should be at, the underlying C++ Fabric ShadowTree doesn't have the updated parameters.

1. We add a mechanism to pass static props through to animated nodes; these get passed to the platform through the normal commit-diff process. This is to allow passing props to the platform that are also controlled by the animation. This mechanism could be reused elsewhere.
2. In ScrollViewStickyHeader, listen to updates for the translateY value and pass them to the platform when it stops changing - for Fabric only. This noops for non-Fabric since it's not necessary.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D21948830

fbshipit-source-id: b203ecde466732203dd12a86e2339e81f66b27e7
2020-06-09 16:35:36 -07:00
Spencer Ahrens 646605b90e update nested VList warning to error
Summary:
This has caused SEVs because the warning has gone unnoticed, so upgrading to error which should be much harder to miss or ignore.

https://fb.workplace.com/groups/rn.core/permalink/2680043542227367/

# Changelog
[Internal] update nested VList warning to error

Reviewed By: TheSavior

Differential Revision: D21945364

fbshipit-source-id: 88a9a9ab0b51e0afcf9b25be9854f65a61f419af
2020-06-09 16:31:28 -07:00
Jiayan Zhuang 345d0c1abb delete DEPRECATED_sendUpdatedChildFrames prop from ScrollView
Summary:
Changelog:
[iOS][Removed] - Removed DEPRECATED_sendUpdatedChildFrames prop to ScrollView component because there are no callsites of it anymore

Reviewed By: shergin

Differential Revision: D21941946

fbshipit-source-id: 0b7d6d0986ddff4b250e70e0450a6f7e166b41f4
2020-06-09 15:30:53 -07:00
Valentin Shergin a28a52dd64 Fabric: Using ManagedObjectWrapper in RCTTextLayoutManager
Summary:
While I was investigated the previous issue (T59430348) I found this place where we manipulate managed pointers manually. So, to make it error-prone this diff changes it to use `wrapManagedObject`.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D21943010

fbshipit-source-id: ecaeffb419ae8d4880187027ca7ec9563e0dfd46
2020-06-09 12:40:43 -07:00
Valentin Shergin 2a80579ea1 Fabric: Checking for nullptr before calling CFRelease in ManagedObjectWrapper
Summary:
ManagedObjectWrapper (`wrapManagedObject`) is used to pass pointers managed by Objective-C runtime object thought C++ parts of the framework. The wrapper consists of a shared pointer to an object with a custom deleter that calls `CFRelease`.
Apparently, there is a caveat here: shared ptr implementation always calls a deleter even if the object points to `nullptr`. It's usually fine because in C++ calling `delete` on a nullptr is a no-op, not an error. But it's an error from the `CFRelease` perspective, which checks the pointer and crashes if it's nullptr.

More info:
https://stackoverflow.com/questions/1135214/why-would-cfreleasenull-crash
https://stackoverflow.com/questions/50201967/why-unique-ptr-with-custom-deleter-wont-work-for-nullptr-while-shared-ptr-does

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D21943011

fbshipit-source-id: 442ad5e274a146de112e6bd8f3c2d20f0225bf77
2020-06-09 12:40:42 -07:00
Samuel Susla 485475ab3e Use CGColorRelease instead of CGRelease
Summary:
Changelog: [Internal]

`CFRelease` crashes app if `cf` is `NULL`, `CGColorRelease` doesn't.

From:
https://developer.apple.com/documentation/coregraphics/1586340-cgcolorrelease?language=objc#

Even though this hasn't happened yet, we had a similar crash in D21943011. Also `CGColorCreate` returns nullable so it could happen.
In order to prevent this in the future, let's switch to `CGColorRelease` which doesn't crash if `cf` is `NULL` and also is semantically correct.

Reviewed By: shergin

Differential Revision: D21953404

fbshipit-source-id: 8b969ee345c2507fcba2442fa20e3fdaf2235d8c
2020-06-09 12:20:58 -07:00
Samuel Susla 1fa3a8e475 Form stacking context if display style is none
Summary:
Changelog: [Internal]

View gets flattened even though it has `display: none` and therefore it and its children do not get hidden.

Reviewed By: shergin, mdvacca

Differential Revision: D21929033

fbshipit-source-id: 994a79fb64fbe66273a70218ebe8056d92cd3cd4
2020-06-09 02:31:00 -07:00
Samuel Susla 3bf3f63a4d Make scheduler into unique_ptr instead of shared_ptr
Summary:
Changelog: [Internal]

RCTScheduler was storing Scheduler as `shared_ptr`, but `RCTScheduler` is sole owner of it.
`unique_ptr` better expresses this ownership.

Reviewed By: JoshuaGross

Differential Revision: D21923573

fbshipit-source-id: e382f2d6e0a4875e1441b6063c1ad7056b338e29
2020-06-09 02:15:02 -07:00
Ryan Tremblay 9c32140068 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
2020-06-09 01:11:53 -07:00
Samuel Susla a5386ff4bf Delete animation driver when destructing scheduler
Summary:
Changelog: [Internal]

Clean up animationDriver_ in `Binding::uninstallFabricUIManager`.

Reviewed By: JoshuaGross

Differential Revision: D21923567

fbshipit-source-id: ecdc727ecbfd1d7052be0372b8d2a0ee7172f93f
2020-06-08 11:58:04 -07:00
Peter Argany 7e300db703 Remove NS_UNAVAILABLE constraint from RCTSurfaceHostingProxyRootView initializer
Summary:
From the header of `RCTSurfaceHostingProxyRootView`:

     This is a RCTRootView-compatible implementation of RCTSurfaceHostingView.
     Use this class to replace all usages of RCTRootView in the app for easier migration

I need to do exactly this, but for a bridgeless mode callsite. This proxy class only uses the bridge for some perf logging, which we're fine with not having right now.

Reviewed By: shergin

Differential Revision: D21893522

fbshipit-source-id: 3547cff6143f44714e39e4104d03336010081e2e
2020-06-08 10:30:14 -07:00
Christoph Nakazawa ad879e50bc Add RCTDevSplitBundleLoader native module
Reviewed By: ejanzer

Differential Revision: D21302418

fbshipit-source-id: a868f6dad3306190c7add26e8f9a976866c16aef
2020-06-08 09:07:42 -07:00
Sidharth Guglani fc2b538f0d use fmod and YGDoubleEquals for double operations instead of float
Summary: Changelog: [Internal][Yoga] Use double operations during rounding

Reviewed By: mdvacca

Differential Revision: D21840018

fbshipit-source-id: c5d17fcb8984b1da9832a15ccd4d628e8d742c6a
2020-06-08 08:10:21 -07:00
William Candillon 93019dc190 ⬆️ Upgrade eslint-config deps (#29048)
Summary:
This dependency upgrade ensures that this eslint config now supports the latest TypeScript syntaxes.

## Changelog

[General] [Fixed] - Upgrade dependencies.
Pull Request resolved: https://github.com/facebook/react-native/pull/29048

Test Plan: Try this new version of the plugin on your project.

Reviewed By: GijsWeterings

Differential Revision: D21879997

Pulled By: cpojer

fbshipit-source-id: cb54c2b56361f7c20994d981c61826f7f50350de
2020-06-08 05:28:27 -07:00
Emily Janzer a50fa552a7 Fix CircleCI by adding dependency on JSI to cxxreact (#29087)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/29087

D21908523 added an implicit dependency on `jsi.h` to use functions like `asObject`, etc. For some reason this doesn't break the build with BUCK (??) but it does with cocoapods. Adding the dep to the cxxreact podspec and regenerating offline mirrors to unbreak CircleCI. Also adding the BUCK dep and include statement for good measure.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D21924592

fbshipit-source-id: 295c0670c6499e1195ba3c3a3320c6aee13bc025
2020-06-07 17:55:16 -07:00