Commit Graph

38536 Commits

Author SHA1 Message Date
Omer Peleg 37e8cd0b46 Move powermock config target to xplat and make fb_java_library non-fbandroid-specific
Summary: Changelog: [Internal]

Reviewed By: brianduff

Differential Revision: D22207494

fbshipit-source-id: c3a87662cb6330a4ab0801c9ee48c0d5723d324a
2020-06-25 07:07:27 -07:00
Joshua Gross 6342e6e3f1 LayoutAnimations: attempt to work around potential crashes when animation is racing with setup or teardown
Summary:
Attempt to fix T68951888 where (1) ComponentHandle is zero, and/or (2) ComponentHandle is missing in the registry. Either will cause a crash and both should be trivial to work around. I was able to repro once accidentally in about 1/200 sessions, so I am not 100% sure if this fixes the root cause.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D22216030

fbshipit-source-id: b6986adee6fe739ce58579a2b031a2d252e73e35
2020-06-24 16:36:28 -07:00
Joshua Gross 2e27fb6a97 LayoutAnimations: for all Transform matrices, store decomposed matrix and use that for interpolation
Summary:
Previously, we tried to take a Transform matrix, decompose it into parts, and then interpolate between those parts. This will always be risky at best, and in some cases ambiguous or unsolvable. For example, a scale of -1 is identical to a rotation of 180 degrees.

Another issue is that when decomposing a matrix, it is impossible to tell the sign of scaleX, scaleY, scaleZ. This is a problem - flipping a View over an axis via scale then becomes a non-animatable operation.

This caused a number of issues.

To resolve it, we accumulate the "operations" resulting in a particular transform. This allows us to easily interpolate between two Transform matrices without actually decomposing the matrix, since we have the "path" that resulted in each particular matrix.

This will make LayoutAnimations over transforms, including Skew transforms, look and work much better, and more reliably.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D22204559

fbshipit-source-id: 0d88ae77e4399a7ea333afbf6062beea977b854a
2020-06-24 16:36:28 -07:00
Héctor Ramos b1e12fb0d5 codegen: Move getSafePropertyName to utils
Summary:
Move to Utils for reuse, and change parameter to take a property object.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D22146669

fbshipit-source-id: e028821cdb11361a45226de0247aa4551b5ade1d
2020-06-24 12:38:38 -07:00
Vitaly Potlov 208e4d2dcd Fix static method in file header (#29118)
Summary:
I have looked into recent commits and found a typical mistake when static is used in .h file.
Here static is not necessary. See link: https://stackoverflow.com/questions/780730/c-c-static-function-in-header-file-what-does-it-mean

## Changelog
Changelog: [Internal] Fabric-specific internal change.
Pull Request resolved: https://github.com/facebook/react-native/pull/29118

Reviewed By: sammy-SC

Differential Revision: D22039305

Pulled By: shergin

fbshipit-source-id: 7078e716166067dd1e94cbb84200a1235283c978
2020-06-24 12:30:45 -07:00
Lulu Wu 6f99beff7e Fix for Unsupported top level event type "onAssetDidLoad"
Summary:
Fix for Unsupported top level event type "onAssetDidLoad"

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D22184964

fbshipit-source-id: d1ce920311fb380923ed9a2ef8aa5a49fc9f8dc2
2020-06-24 06:02:47 -07:00
Samuel Susla 30054645c7 Set clipped to YES when loading an image
Summary:
Changelog: [Internal]

When Paper loads images. it calls with with `clipped` being set to NO.
https://github.com/facebook/react-native/blob/master/Libraries/Image/RCTImageView.mm#L346

We should do the same in Fabric as it can result in different images being loaded.

Reviewed By: JoshuaGross, shergin

Differential Revision: D22185286

fbshipit-source-id: 04afafee67fdfac53e9d17f5edeaf9b9317c7a22
2020-06-23 15:02:19 -07:00
Tim Yung 2933b887cd EventEmitter: Prefix Private Modules with _
Summary:
Renames `EventSubscription.js`, `EmitterSubscription.js`, and `EventSubscriptionVendor.js` to `_EventSubscription.js`, `_EmitterSubscription.js`, and `_EventSubscriptionVendor.js`, respectively.

This is to indicate that those files are implementation details and should not be directly referenced. Instead, the `EventSubscription` type exported from `EventEmitter.js` should be used.

The remaining stragglers that are importing `_EmitterSubscription.js` and `_EventSubscriptionVendor.js` after this commit will be cleaned up when `RCTDeviceEventEmitter` is refactored.

Changelog:
[Internal]

(Note: this ignores all push blocking failures!)

Reviewed By: cpojer

Differential Revision: D22182310

fbshipit-source-id: 82be685f231395bd7b8e9986141b5df1367bec71
2020-06-23 13:50:26 -07:00
Tim Yung 70a73ca461 EventEmitter: Import {Emitter => Event}Subscription
Summary:
Changes dependents of `EmitterSubscription` to instead import the `EventSubscription` type from `EventEmitter.js`.

Changelog:
[Internal]

(Note: this ignores all push blocking failures!)

Reviewed By: cpojer

Differential Revision: D22182309

fbshipit-source-id: 575f4c59248ef50182ddb33911f1e6f3ba88ec07
2020-06-23 13:50:26 -07:00
Tim Yung 331d3268e2 EventEmitter: Import EventSubscription from EventEmitter
Summary:
Changes dependents to import the `EventSubscription` interface type from `EventEmitter` instead of `EventSubscription.js`.

Changelog:
[Internal]

(Note: this ignores all push blocking failures!)

Reviewed By: cpojer

Differential Revision: D22182313

fbshipit-source-id: 31448ea5ee3038f806a417f23597da1edd4e4e9b
2020-06-23 13:50:26 -07:00
Tim Yung 15911acd83 EventEmitter: Export EventSubscription Interface
Summary:
Changes `EventEmitter.js` to be Flow-typed so that it can export an interface for `EventSubscription`. In order to retain the untyped-ness of `EventEmitter.js`, I moved the entire definition into an untyped `_EventEmitter.js` file (which I hope no one will try importing from).

This new interface will be used to replace all the current type imports of `EventSubscription` and `EmitterSubscription`.

Changelog:
[Internal]

(Note: this ignores all push blocking failures!)

Reviewed By: cpojer

Differential Revision: D22182311

fbshipit-source-id: c604a371a91963116621e89ca63f5a82167090b9
2020-06-23 13:50:26 -07:00
Tim Yung ab59e1819a EventEmitter: Upgrade from require to import
Summary:
Upgrades dependents of `EventEmitter`, `EventSubscription`, `EventSubscriptionVendor`, and `EmitterSubscription` to use `import` instead of `require`.

Changelog:
[Internal]

(Note: this ignores all push blocking failures!)

Reviewed By: cpojer

Differential Revision: D22182312

fbshipit-source-id: e9444aa2728d89d52f577725f688871f7dbfba8a
2020-06-23 13:50:25 -07:00
Lee Callender 0967e7b26d Move ImageEditor Android files to FB Internal.
Summary: Changelog: [Android] [Removed] - Migrated ImageEditingManager to FB internal.

Reviewed By: cpojer

Differential Revision: D22123807

fbshipit-source-id: 24c3b3554f5e6152b70750a6c8212b3d3b66678f
2020-06-22 19:20:24 -07:00
Samuel Susla 722a4ba561 Fix default value for shadow props
Summary:
Changelog: [Internal]

Our default values in ViewProps are incorrect for `shadowColor`, `shadowOffset` and `shadowRadius`.

The default value for shadowRadius isn't {0, 0} but {0, -3}.
Source: https://developer.apple.com/documentation/quartzcore/calayer/1410970-shadowoffset?language=objc

The default value for `shadowColor` is black opaque color.
Source: https://developer.apple.com/documentation/quartzcore/calayer/1410829-shadowcolor?language=objc

The default value for shadowRadius isn't 0 but 3.
Source: https://developer.apple.com/documentation/quartzcore/calayer/1410819-shadowradius?language=objc

Reviewed By: shergin

Differential Revision: D22091927

fbshipit-source-id: fc135fca6a487cd30f8183d88b0065e007a9eacb
2020-06-22 13:26:34 -07:00
David Vacca 75e6f7961f Fix measure of ReactSlider for Android API < 21
Summary:
This diff avoids calling to the method setStateListAnimator for users running in Android API < 21 (This method did not exist in Android API < 21)

changelog: [Android][Fix] Fix crash while measuring ReactSlider in Android API < 21

Reviewed By: lunaleaps

Differential Revision: D22164574

fbshipit-source-id: 8163f99eeb78302fc75e2c4938330c699ca8d363
2020-06-22 12:42:41 -07:00
Samuel Susla c3d4d2a3d2 Remove buck test declaration for Modal component
Summary:
Changelog: [Internal]

Remove redundant test target

Reviewed By: shergin

Differential Revision: D22115084

fbshipit-source-id: 6d7a9bade2217c7afb4f482590a35e3eb170d3d6
2020-06-22 09:02:42 -07:00
Joshua Gross e661a551cb Potential fix for, and more diagnostics for, NativeAnimatedModule crash
Summary:
Searching for details and maybe a fix for T68843308 crashing in disconnectFromView, "Attempting to disconnect view that has not been connected with the given animated node".

May be related to recent refactoring but it's not clear. Change logic slightly and add more diagnostic information.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D22153179

fbshipit-source-id: b95dbaf01ae8bca154c61442898b0f9d3aebb4de
2020-06-20 17:47:29 -07:00
Joshua Gross 9760a326c9 Fix MountingManager NPE
Summary:
Fix NullPointerException.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D22153157

fbshipit-source-id: 77be1456a2b7f6429d2dce6eac5d9d0bca362c27
2020-06-20 17:41:02 -07:00
David Vacca f8bcb1063e Cleanup updateState method on TextInputManager
Summary:
Quick refactor to cleanup the updateState method on TextInputManager

changelog:[internal]

Reviewed By: JoshuaGross

Differential Revision: D22149752

fbshipit-source-id: 0461b1769b9a7a3b25257bbf2039dc461a164c6f
2020-06-19 21:50:43 -07:00
David Vacca 85669d8c30 EZ fix typo
Summary:
Fix typo in TextInput classes

changelog:[internal]

Reviewed By: JoshuaGross

Differential Revision: D22149753

fbshipit-source-id: f5d1f5ee8bea82e049ead7ca2664e46cdcd961a0
2020-06-19 21:50:43 -07:00
David Vacca 8cbbd93c40 Refactor Text input state
Summary:
This diff refactors the theme management for text input in order to avoid extra state updates.

changelog:[Internal]

Reviewed By: JoshuaGross

Differential Revision: D22149754

fbshipit-source-id: 8a6dbe63c8d532986dbf785c7b16323e0a980669
2020-06-19 21:50:43 -07:00
Joshua Gross a7860b64d0 LayoutAnimations: iron out some additional index-adjustment bugs
Summary:
Index adjustment is complicated since we defer REMOVE operations. This diff solves some remaining (hopefully final!) bugs found when queueing several conflicting LayoutAnimations repeatedly (this is sort of an "extreme" case since we're continuously re-queueing additional LayoutAnimations instead of allowing any to complete, while reordering and deleting, so it exercises the most extreme LayoutAnimations use-cases).

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22150085

fbshipit-source-id: db1381bef3ba8bb5ec82dab791f69162d46d23f0
2020-06-19 20:28:05 -07:00
Joshua Gross 304c5d54ec MountingManager debug tool: show view hierarchies before and after remove/insert operations
Summary:
This is a useful debugging tool that will not be compiled by default, and we have some protection to only compile it in Debug builds so it's less likely to accidentally slip into production.

This has been useful for debugging C++ LayoutAnimations, since Remove/Insert mutations are delayed and fiddled around with a little.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22148853

fbshipit-source-id: 05609507cdf06b73fd3edf5cf7bc95e124ff1135
2020-06-19 20:28:05 -07:00
Ramanpreet Nara e6d7f4a153 Make RCTNativeAnimatedModule a regular NativeModule
Summary:
There's a race when RCTNativeAnimatedModule is a TurboModule that breaks animations. More details here: T68603674. Even though this is a bit edge-casey, I think it's best to make this NativeModule a non-TurboModule until this problem is resolved.

Changelog: [iOS][Fixed] - Make RCTNativeAnimatedModule a regular NativeModule to unbreak animations with TurboModules on

Reviewed By: yungsters

Differential Revision: D22149179

fbshipit-source-id: 6bf9f0d5eab7c99a82b21ec07e76359181dcedd2
2020-06-19 18:24:38 -07:00
Joshua Gross e5a4d9550e Replace direct ViewManager calls to old UIManager with Fabric/Venice-compatible calls
Summary:
Replace direct ViewManager calls to old UIManager with Fabric/Venice-compatible calls.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22111396

fbshipit-source-id: 2de9df5a4b494f82049dba62325ee3119c80d3c3
2020-06-19 11:15:57 -07:00
Joshua Gross 57fcf6c268 LayoutAnimations: when delaying a REMOVE operation, insert operation indices on the same level must also be adjusted
Summary:
This will prevent views from becoming out-of-order as view removals are delayed and there are inserts at the same level.

There is at least one additional issue that crops up if many animations are queued up at the same time, that will be resolved separately.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D22130185

fbshipit-source-id: d8041c6afdcd729939dd392c9e2c23fe8ec1b706
2020-06-19 11:13:35 -07:00
Joshua Gross d183fd327b Improve MountingManager diagnostics around View removal
Summary:
It is possible (most recently, if there are bugs in LayoutAnimations, but also in general) to issue a `removeViewAt` MountItem that removes the incorrect view if, for whatever reason, the View hierarchy has become "corrupt"
and Views are out of order. I added two heuristics to catch if that happens: check the tag of the View being removed if possible, and ensure that all deleted views do not have a parent. This will turn weird visual glitches into
hard crashes, which we want once the UI has become corrupt.

My only concern here is with perf; maybe we could put these behind a debug-only flag or something, but it's probably not a huge deal.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22130186

fbshipit-source-id: 0942b019c3449d68edfb9db1fe8130ea351d1d8f
2020-06-19 11:13:35 -07:00
Joshua Gross 11ed9c2573 Fix Android diagnostic-debugging builds
Summary: Fix compiler errors when RN_DEBUG_STRING_CONVERTIBLE is defined.

Reviewed By: mdvacca

Differential Revision: D22103936

fbshipit-source-id: 7a5278b1ef70a766467a03461c7bac69848e9fa5
2020-06-19 11:13:35 -07:00
Samuel Susla 1279a4c89d Fix order of events when dispatching unique event
Summary:
Changelog: [Internal]

Order of events dispatched to JS matter. If we remove duplicate events, we shouldn't change order of types.

So If we have order of events

A -> B -> C

and inserting a new event A for the same target, we shouldn't delete the first A, as there might be logic that depends on event B being preceded by A.

What we can do though, is delete previous event of the same type and target in queue if we would be adding subsequent event.

So when we have events

A -> B -> C

and we are about to add event C to the queue which goes to the same target, we can delete the first C before inserting the new one.

Reviewed By: shergin

Differential Revision: D22135931

fbshipit-source-id: 1dadd1688516330be07c4251f446f77ca08eaa87
2020-06-19 11:09:46 -07:00
simek ff690283e0 RNTester: remove 'supportsTVOS' flag (#29018)
Summary:
Refs: [0.62 release](https://reactnative.dev/blog/#moving-apple-tv-to-react-native-tvos), https://github.com/facebook/react-native/issues/28706, https://github.com/facebook/react-native/issues/28743

Support for the tvOS with the 0.62 release has been moved out to the `react-native-tvos` package. This PR removes the legacy flag related to the tvOS in the RNTester app examples.

Since Android TV support is still included in the Core I assume that the TV platform check cannot be removed completely.

## Changelog

[Internal] [Removed] - remove 'supportsTVOS' flag from the RNTester examples

## Test Plan

I have used the local working copy of `react-native` repo and test the changes in the RNTester app build from this code. Flow and List checks passed (but there is one, unrelated Prettier issue in the `AlertExample.js` file).
Pull Request resolved: https://github.com/facebook/react-native/pull/29018

Reviewed By: kacieb

Differential Revision: D22109549

Pulled By: TheSavior

fbshipit-source-id: d0f71f3d5f5f89d554972ec194ebf2801386fcff
2020-06-19 00:13:26 -07:00
Daniel Andersson 709570acfb Add sanity checks to JSBigFileString
Summary:
When asking for the data of a JSBigFileString, check that the instance satisfies some basic invariants.

This is meant to catch any corruption issues as early as possible.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22125436

fbshipit-source-id: e0a84752c86151d56b7e7cbed3b95650d8ba1f75
2020-06-18 20:51:59 -07:00
Luna Wei b095432e6d Catch getRouteEntry errors
Summary:
## Changelog:

[Internal][Changed] - Prevent symbolicating stacktrace and no logbox when running in express route

Context:
ExpressRoute doesn't support some things (like promises) due to the limited initialization we do.

Right now the app will crash when trying to evaluate those entrypoints in express route if they depend on such initialization. Ideally a redbox would warn the developer that express route would break if they modify their express-route compatible entrypoint. Displaying a redbox seems to require a bit of refactoring as it can't easily be triggered from native/express-route -- something more to investigate. Occasionally one does appear (when trying the attached test plan) but it is inconsistent and seems dependent on timing of bridge, express route initialization.

The plan:
* Since we are going to roll out an opt-in for each surface (note there are two flags, `fetchWithExpressRouteIfAvailable` and `useExpressRouteIfInitialized` - the former being for using `getPreloadProps` to parallel fetch and the latter as a flag to get route information) we have more control of the roll out of express route.

Things still to improve:
* It's obviously not great that we don't get better errors -- something to address if that is really the next blocker to rolling out ExpressRoute

Reviewed By: sahrens, ejanzer

Differential Revision: D22026444

fbshipit-source-id: 7698109f5921f82a2d0bc9a8346e12b67defca27
2020-06-18 16:58:21 -07:00
Luna Wei 568d2206f7 Add non-fatal error handling
Summary:
## Changelog:

[Internal][Added] - Additional option to report non-fatal JS error

Reviewed By: ejanzer

Differential Revision: D22054406

fbshipit-source-id: 25e2a8d45f086173b09ee095331f94364cae4c1a
2020-06-18 16:58:21 -07:00
Tim Yung 64860972be RN: Adjust Image Blur on Android
Summary:
Adjusts the behavior of `blurRadius` for `Image` on Android so that it behaves more closely to other platforms (web and iOS).

Changelog:
[Android][Changed] - Effect of `blurRadius` now more closely matches other platforms.

Reviewed By: shergin

Differential Revision: D22118680

fbshipit-source-id: c6d14aef29b4a086e43badfa78407bfa07f9fee2
2020-06-18 14:46:49 -07:00
Jesse Katsumata a69bd9dadf chore: use es6 import for SafeAreaView component (#29143)
Summary:
This PR is to help proceed this discussion. https://github.com/react-native-community/discussions-and-proposals/issues/201#issuecomment-588454552

Converted `require` to `import` for SafeAreaView.

## Changelog

<!-- 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] - switched to es6 import for SafeAreaView
Pull Request resolved: https://github.com/facebook/react-native/pull/29143

Test Plan: Tested that App runs on RNTester

Reviewed By: shergin

Differential Revision: D22109435

Pulled By: TheSavior

fbshipit-source-id: 57dc4ab88bf497b43422b20416afbe4c4a1e001d
2020-06-18 14:41:43 -07:00
Petr Bela e73208e2ca Better error message when missing entry file (#29012)
Summary:
If the entry file has been renamed (e.g., to `index.ts`), the script currently fails silently and prints out that the bundle file does not exist.

This change will print the correct error message instead.

## Changelog

[iOS] [Fixed] - Better error message when missing entry file
Pull Request resolved: https://github.com/facebook/react-native/pull/29012

Test Plan: N/A

Reviewed By: hramos

Differential Revision: D22109657

Pulled By: TheSavior

fbshipit-source-id: edd7b6f88becc954ee41ed01ae43efb4481adc95
2020-06-18 13:35:36 -07:00
Richard Groves 3e5a7b2939 Add quotes around paths in shell script call (#29160)
Summary:
Without this the RNTester app on iOS can’t be built in a folder that has a space in the path.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[iOS] [FIXED] - RNTester app builds in a path that contains a space
Pull Request resolved: https://github.com/facebook/react-native/pull/29160

Test Plan:
1. Clone react-native into a folder where the path has a space
2. Follow the instructions at https://github.com/facebook/react-native/blob/master/RNTester/README.md to get the RNTesterPods.xcworkspace
3. Open the workspace and build the project. Path to workspace was /Users/richard/UX Cam/Code/Test Projects/ReactNative/react-native/RNTester/RNTesterPods.xcworkspace

4. See error message - '/Users/richard/UX' is the first part of my path before the space

/Users/richard/Library/Developer/Xcode/DerivedData/RNTesterPods-ctjcmrlwzntpssgmcjydmovoztwl/Build/Intermediates.noindex/RNTesterPods.build/Debug-iphonesimulator/RNTester.build/Script-68CD48B71D2BCB2C007E06A9.sh: line 3: /Users/richard/UX: No such file or directory

Reviewed By: RSNara

Differential Revision: D22118259

Pulled By: TheSavior

fbshipit-source-id: 1213d88f66fd47dd052eaeb5f26da9056887f5ea
2020-06-18 10:44:06 -07:00
Vijay Ramamurthy 9a532edaaf upgrade to flow v0.127.0
Summary: Changelog: [Internal]

Reviewed By: samwgoldman

Differential Revision: D22098723

fbshipit-source-id: 8203925b2eeeb7b81ada60eb56ff0000c601240e
2020-06-18 07:28:45 -07:00
Lulu Wu e6fc20ee68 Keyframes is not implemented in Fabric Android
Summary:
Implement Keyframes in Fabric Android

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D21952500

fbshipit-source-id: 6ba3af1afea227d58b6b12c1be629698d309a04d
2020-06-17 15:25:18 -07:00
Samuel Susla 93f9d8dd6b An attempt at resolving crash in RCTStringFromNSString
Summary:
Changelog: [Internal]

# Why we crash?

`cStringUsingEncoding` returns `char *`, not `std::string`. Compiler uses implicit conversion to construct and copy `char *` into  `std::string`. Maybe optimiser does something unexpected there? Maybe something weird happens there? I think it is worth trying to be more explicit about it and construct std::string there explicitly. Also if you do a google search, this seems to be a go to strategy when converting `NSString` to `std::string`.

This is all just an assumption, I can't repro the crash

# Why get rid of 2nd argument in RCTStringFromNSString

2nd argument is `NSStringEncoding`. It isn't being used, we always use default value.

Also, if you pass in `NSUTF16StringEncoding` or `NSUTF32StringEncoding`, you get undefined behaviour.
Check https://developer.apple.com/documentation/foundation/nsstring/1408489-cstringusingencoding?language=objc# section "Special Considerations"

Reviewed By: shergin

Differential Revision: D22089694

fbshipit-source-id: d449b383c61983c3822bc589c0a01fa97c0b6e64
2020-06-17 14:19:58 -07:00
Kacie Bawiec 8e1b812779 Add FDSTooltipView to LegacyViewManagerInterop for Fabric
Summary:
Add tooltip to the list of components supported with the legacy view manager, so that it will work in Fabric.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D21917137

fbshipit-source-id: 1ab6c7cdd0a10a496531d2ea8fbcae7e427ec647
2020-06-17 13:22:57 -07:00
Samuel Susla 36b586ada1 Font size in Text now respects preferredContentSizeCategory
Summary:
Changelog: [Internal]

Add support for dynamic font size.

New class `ThreadStorage` is introduced, which is used to pass LayoutContext to `YogaLayoutableShadowNode::yogaNodeMeasureCallbackConnector`.

## Shortcoming
This implementation doesn't cause re-render, if user changes font size and comes to the app without restarting it, it will show old font size. I believe this is fine for now as most people set their font size before they use the app and keep the same setting for a long time.

Reviewed By: shergin

Differential Revision: D22043728

fbshipit-source-id: 7453d165c280a2f4bcb73f4ee6daf9e64b637ded
2020-06-17 10:22:32 -07:00
Samuel Susla ec9da43de5 Rename LayoutableShadowNode::measure to LayoutableShadowNode::measureContent
Summary:
Changelog: [internal]

Rename `LayoutableShadowNode::measure` to `LayoutableShadowNode::measureContent` and add LayoutContext as parameter.

Pass `LayoutConstraints` by reference rather than value.

Reviewed By: shergin

Differential Revision: D22043727

fbshipit-source-id: b668240c45b658db5b114630b73d7407d35482aa
2020-06-17 10:22:32 -07:00
Oleksandr Melnykov 6afc984e81 Update loading banner text and colors
Summary: This diff updates the loading banner text and color on Android to match its style on iOS.

Differential Revision: D22066823

fbshipit-source-id: 7f8d6cf1a6c4c48babe919995044978d7a81c674
2020-06-17 09:10:51 -07:00
Oleksandr Melnykov fca3a39da5 Add native module for loading split JS bundles in development
Reviewed By: mdvacca, cpojer

Differential Revision: D22001709

fbshipit-source-id: 4e378fd6ae90268e7db9092a71628205b9f7c37d
2020-06-17 09:10:51 -07:00
Joshua Gross 2e2c881147 NativeAnimatedModule should not crash if UIManager disappears
Summary:
If UIManager disappears, it's likely due to (1) teardown due to memory pressure, (2) teardown due to crash, (3) normal teardown.

In all of those cases, I would just want NativeAnimatedModule to stop executing and fail silently ASAP.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22079209

fbshipit-source-id: 21650abdfdb119a6f4abccd6962d0c09f7c7c6cd
2020-06-16 17:04:22 -07:00
Tim Yung fa0e6f8051 RN: Image Progress Event on Android
Summary:
Adds support for the `onProgress` event on `Image`, for Android.

Since Fresco does not provide a progress listener on `ControllerListener`, this uses a forwarding progress indicator `Drawable` to pass along values from `onLevelChange`.

Caveat: The ratio between `loaded` and `total` can be used, but `total` is currently always 10000. It seems that Fresco does not currently expose the content length from the network response headers.

Changelog:
[Android][Added] - Adds support for the `onProgress` event on `Image`

Reviewed By: mdvacca

Differential Revision: D22029915

fbshipit-source-id: 66174b55ed01e1a059c080e2b14415e7d268bc5c
2020-06-16 15:01:05 -07:00
Tim Yung 74ab8f6e5a RN: Consistent API for Image Events
Summary:
Changes the `onLoad` and `onError` events on `Image` to be consistent with each other and with the `ImageSource` type.

Changelog:
[Android][Breaking] - On `Image`, `onLoad` and `onError` event objects will no longer have an extra `uri` property.
[Android][Breaking] - On `Image`, `onLoad` event objects' `source.url` is now renamed to `source.uri`.
[iOS][Breaking] - On `Image`, `onLoad` event objects' `source.url` is now renamed to `source.uri`.

Reviewed By: mdvacca

Differential Revision: D22023565

fbshipit-source-id: 5ea7904c697f87e01118bdb81ed50ab0a5aecdce
2020-06-16 15:01:05 -07:00
Tim Yung 90997c26e3 RN: Cleanup ImageLoadEvent Logic (Android)
Summary:
Cleans up `ImageLoadEvent` to minimize constructor confusion and to make the dispatching logic more predictable.

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D22023141

fbshipit-source-id: 17e66de867f51121a3f9a6b782dbad700a54231a
2020-06-16 15:01:05 -07:00
Tim Yung 76fe94e8b0 RN: Support $ReadOnly Properties in Codegen
Summary:
Currently, the codegen supports `$ReadOnly` values, but not `$ReadOnly` properties on objects. This adds support for those (by pretty much ignoring them).

Changelog:
[General][Added] - Support `$ReadOnly` in object properties when defining native event types

Reviewed By: TheSavior

Differential Revision: D22023142

fbshipit-source-id: 7167852050925bf31392607923576f023e729f5f
2020-06-16 15:01:05 -07:00