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

1964 Коммитов

Автор SHA1 Сообщение Дата
Samuel Susla 9948fbdeec Fabric: remove LocalData from ShadowNode
Summary:
LocalData isn't used by any components. We've moved towards State.
Changelog: [internal]

Reviewed By: mdvacca

Differential Revision: D19250732

fbshipit-source-id: dd23a723c5392632165798f6365ea107b37b54cd
2020-01-20 05:48:31 -08:00
Samuel Susla 5a94471650 Fabric: remove LocalData from ShadowNodeFragment
Summary:
LocalData isn't used by any components. We've moved towards State.
Changelog: [internal]

Reviewed By: mdvacca

Differential Revision: D19250603

fbshipit-source-id: f95da375117dcb8f6540a6c75d3a80bba630672c
2020-01-20 05:48:30 -08:00
Samuel Susla 291b45b686 Add unit tests for LayoutableShadowNode::getRelativeLayoutMetrics
Summary:
Adds a bare minimum test that verifies correct behaviour of `getRelativeLayoutMetrics`.

Changelog: [internal]

Reviewed By: shergin

Differential Revision: D19449128

fbshipit-source-id: afde997a770921d580575eb0cdd04fce6252cb5a
2020-01-20 01:31:23 -08:00
Samuel Susla b3af384a13 Fix wrong layoutMetrics being returned by `measure` call
Summary:
# Logs
```
[tid:com.facebook.react.JavaScript][ConcreteViewShadowNode.h:119] width: 0   tag: 1432 debugValue: r1
[tid:com.facebook.react.JavaScript][ConcreteViewShadowNode.h:119] width: 375 tag: 1432 debugValue: r2
[tid:com.facebook.react.JavaScript][ConcreteViewShadowNode.h:119] width: 375 tag: 1432 debugValue: r2
[tid:com.facebook.react.JavaScript][UIManager.cpp:197]            width: 0   tag: 1432 debugValue: r1/sealed <----------------- FIRST TAP
[tid:com.facebook.react.JavaScript][UIManager.cpp:197]            width: 0   tag: 1432 debugValue: r1/sealed <----------------- FIRST TAP
[tid:com.facebook.react.JavaScript][ConcreteViewShadowNode.h:119] width: 375 tag: 1432 debugValue: r4
[tid:com.facebook.react.JavaScript][ConcreteViewShadowNode.h:119] width: 375 tag: 1432 debugValue: r5
[tid:com.facebook.react.JavaScript][ConcreteViewShadowNode.h:119] width: 375 tag: 1432 debugValue: r6
[tid:com.facebook.react.JavaScript][ConcreteViewShadowNode.h:119] width: 375 tag: 1432 debugValue: r7
[tid:com.facebook.react.JavaScript][ConcreteViewShadowNode.h:119] width: 375 tag: 1432 debugValue: r8
[tid:com.facebook.react.JavaScript][UIManager.cpp:197]            width: 375 tag: 1432 debugValue: r7/sealed <----------------- SECOND TAP
[tid:com.facebook.react.JavaScript][UIManager.cpp:197]            width: 375 tag: 1432 debugValue: r7/sealed <----------------- SECOND TAP
```
# What’s happening here?

Opening a *BottomSheet* and tapping the first item. As you can see before the item is tapped, it has *width* set to 375 in revision *r2*.
When the tap happens, JavaScript is requesting an old revision of ShadowNode, which still has width 0.

# My assumption.

1. Native creates node with *width* 0 and returns handle to *JS*.
2. Native *clones* the node, sets its *width* to 375, doesn’t tell *JS* about it. This update is due to state change.
3. *JS* tries to get the size of the node, but asking for first revision of the component it receives width 0.

# Other observations

1. Manually setting width to 375 in UIManager::getRelativeLayoutMetrics fixes the problem.
2. This happens only on device, I wasn’t able to reproduce this on simulator.

# Fix

Find the newest revision of ShadowNodeFamily, and return its layoutMetrics.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19433873

fbshipit-source-id: 4558cf6e704051e9b3968e83821d8d25b3dadcda
2020-01-20 01:31:22 -08:00
Samuel Susla 5b156f83fa Fix origin calculation in getRelativeLayoutMetrics
Summary:
# Problem
The issue is in implementation of `LayoutableShadowNode::getRelativeLayoutMetrics`.
If you have view tree (A has a child B), and you call `B.getRelativeLayoutMetrics(A)`, the expected result is B's origin within A. The implementation wasn't reflecting that, it was reflecting B's origin within A + A's origin within its parent.

# Fix
When iterating over ancestors of ShadowNode, the last ancestor should be skipped.
AncestorList is a list that starts with provided ancestor and ends with parent of `this`. To skip provided ancestor we iterate to `rend() - 1`.

# Why does it work in some cases?
This function is triggered from `UIManager.getRelativeLayoutMetrics` without `ancestorShadowNode` provided, we find the RootShadowNode, which has origin `{0, 0}`.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19447900

fbshipit-source-id: 4a9606dc1fab3fecfb85d337b014188d80e5b355
2020-01-20 01:31:22 -08:00
Samuel Susla 1e81b67701 Use fixtures for ShadowNodeTests
Summary:
Changelog: [Internal]

Refactor the setup code for tests to a single place.
Now there is fixed set of nodes where we test different methods of ShadowNode.

Reviewed By: shergin

Differential Revision: D19464966

fbshipit-source-id: 749e9f56ac2e5489647885b2ddcb1309eb20909a
2020-01-20 01:11:51 -08:00
Samuel Susla 582738bdc8 Use EXPECT instead of ASSERT in tests
Summary:
Changelog: [Internal]

1. Replace ASSERT_* with EXPECT_*. Assert is a fatal assertion. Expect is non-fatal assertion. So if assert fails, tests do not continue and therefore provide less information.

2. Rename tests in `RawPropsTest.cpp` from `ShadowNodeTest` to `RawPropsTest`.

Source: https://github.com/google/googletest/blob/master/googletest/docs/primer.md#basic-assertions

Reviewed By: shergin

Differential Revision: D19464967

fbshipit-source-id: add83751ebdb0a12fbf8f70b851747aa5624366a
2020-01-20 01:11:50 -08:00
Scott Kyle 84adc85523 Export exception classes with default visibility
Summary:
This fixes a crash caused by a `JSError` exception not being successfully caught in a different dynamic library from where it was thrown. Since the libraries were compiled with hidden symbols and loaded with `RTLD_LOCAL`, the exception typeinfo becomes unique to each module.

Reading on this subject:
https://gcc.gnu.org/wiki/Visibility
https://stackoverflow.com/questions/14268736/symbol-visibility-exceptions-runtime-error

Reviewed By: mhorowitz

Differential Revision: D19343161

fbshipit-source-id: 4eb3bc2576bbcca2c3aef4f52b5a27dfde214c6a
2020-01-19 00:10:38 -08:00
Peter Argany 459c54c407 Refactor RCTTurboModuleManager to take in a CallInvoker
Summary:
In bridgeless mode, `RCTTurboModuleManager` is initialized with a nil bridge. This has mostly worked, since `RCTBridge` doesn't do too many things for TMM (some notifs and perf markers). The one important thing it provides is a `_jsInvoker`.

In bridgeless mode, up until this point `_jsInvoker` has been nil, and turbo modules were not able to call functions on the JS thread. This diff fixes that.

Reviewed By: RSNara

Differential Revision: D19437174

fbshipit-source-id: 86bfc0a47bd9576e7d3203b860e86446eb0b63dd
2020-01-17 15:55:25 -08:00
Riley Dulin 0ee7fb98cc Update the chrome devtools protocol for the inspector
Summary:
Changelog: [Internal] Upgrade Chrome devtools protocol for Hermes

Update to the most recent version of the devtools protocol, r730699.
This just adds a few parameters to the stable API.
They have reasonable defaults that shouldn't break the existing functionality.

Reviewed By: willholen

Differential Revision: D19387559

fbshipit-source-id: 49d9ebf4a1a20f349ea6e46be6d5f36184ba8afb
2020-01-15 16:52:19 -08:00
Riley Dulin 46351cc276 Use the devtools-protocol npm package to generate code
Summary:
Changelog: [Internal]

Before, we were relying on checking out the `devtools-protocol` Github repo at a specific commit and
making special changes to the JSON file.
In order to make it easier to update, use the officially published npm package.

I found the closest package version that was published, but it had two differences:
* `Runtime.getHeapUsage` was either missing (in earlier versions) or experimental (in later versions)
* `isDefault` and `isPageContext` were removed. I'm not sure what these were used for anyway, the comment leads me to believe they're probably not necessary anymore

There were some customizations made previously to annotate `recursive` on some properties. The npm package doesn't set these,
so I wrote some checks to add it back in if it can be detected. This was mostly to handle one special case: `Runtime.StackTrace`.
The workaround seems to be fine for that case.

Reviewed By: willholen

Differential Revision: D19386890

fbshipit-source-id: db0d85f6bc71cba77ee67d85efe2f38376d7cc87
2020-01-15 16:52:18 -08:00
Riley Dulin 4b703e3c1f Remove .flowconfig from hermes/inspector/tools/msggen
Summary:
Changelog: [Internal]

This separate `.flowconfig` file was causing versioning issues.
Delete it so that `msggen` can share the same flowconfig as the rest
of React Native.

Reviewed By: willholen

Differential Revision: D19413710

fbshipit-source-id: 748cb50a3151df1c67ee7176e57e259e48f50be7
2020-01-15 16:52:18 -08:00
Samuel Susla fca833e2ae Fix handling of nil event in legacy interop layer's eventInterceptor
Summary:
interop layer doesn't deal with `nil` being sent as event, example https://fburl.com/diffusion/t5zx6xm0.

This later triggers following assertion https://fburl.com/diffusion/dr5xzgic.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19309356

fbshipit-source-id: 82b3841c337f949ce7ca0b875c98f608edddb599
2020-01-14 06:30:35 -08:00
Valentin Shergin ce9cf3795a Fabric: <TextInput> component on iOS, the C++ part
Summary:
This is C++ part of the implementation of Fabric-compatible <TextInput> component on iOS.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D19169987

fbshipit-source-id: e2eac9beac6d1e124b5176b4a23676b8e05490c3
2020-01-13 23:22:09 -08:00
Samuel Susla cfbd93ccd5 Fix crash when accessing nullptr imageRequest
Summary:
ImageState if created with default constructor is created with `imageRequest_` being nullptr.
Calling `getObserverCoordinator()` on it was causing a crash.

We create initial state data with `imageRequest` populated.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19332711

fbshipit-source-id: 0266222551dbfb10b3f86e72a43d5306650fd09b
2020-01-13 23:19:26 -08:00
Joshua Gross 16ada9dfb0 Fix MountingCoordinator stub view tree printer
Summary:
On Android/when printing to logcat, output is truncated to a certain max length; outputting a massive string as a single log item will cause some of it to be truncated. In the case of the mutations list and shadow node description, most of it is truncated.

Easy fix: split into lines and log each line. This isn't necessary on iOS but works fine.

I also removed the conditional and changed to an assert. Most of the time when we're using this block of code, it's because we want to see all mutations; and unless we reintroduce a bug into the core, the assert is never hit and so (before this change) the conditional would never be true and we'd never see this output. It's more generally useful to be able to see this output if the `RN_SHADOW_TREE_INTROSPECTION` macro is defined.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D19378929

fbshipit-source-id: 2f5dffeef7608823ac1ba092090d8c2ab5e965e1
2020-01-13 23:16:14 -08:00
Samuel Susla 0c64733c6b Fabric: migrate Slider from LocalData to State
Summary:
Changelog: [Internal]
We are moving away from LocalData in favour of State.

Reviewed By: shergin

Differential Revision: D19250592

fbshipit-source-id: 6d2eef9a0c0e53e0146da609ba0c24fa09766433
2020-01-06 05:25:23 -08:00
Samuel Susla 3d6f5f50a7 Fabric: Migrate Image to State from LocalData
Summary:
Changelog: [Internal]

We are moving away from LocalData in favour of State.

Reviewed By: shergin

Differential Revision: D19247031

fbshipit-source-id: 8884133b13dd111e8d9e2cd4936bf90bfc5b4932
2020-01-06 05:25:23 -08:00
Kevin Gozali 674b591809 iOS: Deprecate iOS 9 / tvOS 9 SDK support
Summary:
It is time to target SDK version 10.0+.

Changelog: [iOS] [Deprecated] - Deprecating support for iOS/tvOS SDK 9.x, 10.0+ is now required

Reviewed By: mdvacca

Differential Revision: D19265731

fbshipit-source-id: 93b6f9e8f61c5b36ff69e80d3f18256aa96cc2c0
2020-01-02 12:52:12 -08:00
Valentin Shergin 26650c766d Fabric: Disabling RN_SHADOW_TREE_INTROSPECTION
Summary:
We see some asserts firing inside the Shadow Tree introspection.
While we are investigating what exactly went wrong it's better to disable that to stop bleading.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D19256449

fbshipit-source-id: 9920392996a00879043d9516e5bc189a1c806ead
2019-12-31 08:47:59 -08:00
David Vacca cf10cf56ea Remove method findShadowNodeByTag_DEPRECATED from UIManagerBinding class
Summary:
This diff removes the findShadowNodeByTag_DEPRECATED method from class UIManagerBinding. This method was created on D17175953 to implement findNodeHandle in Fabric. Recently we decided that we don't need to expose findNodeHandle anymore. This diff cleans up thi code.

Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D19216996

fbshipit-source-id: 07c16aeed28851afc09b0f5d6be338bb4440f813
2019-12-23 17:09:44 -08:00
David Vacca 878f4211c1 Expose findNodeAtPoint API to JS
Summary:
This diff implements the findNodeAtPoint API into UIManagerBinding to allow JS to call this method

changeLog: [Internal]

Reviewed By: shergin

Differential Revision: D19190284

fbshipit-source-id: 3a65a2238f964ce031b12c8cf264cdacb6cc8f2e
2019-12-23 17:09:44 -08:00
David Vacca 5e7a03f7b6 Implement findNodeAtPoint method
Summary:
This diff implements the findNodeAtPoint method to return the ShadowNode that is positioned into a Point of the screen.

What's not supported:
- Scroll position
- Transform
- return layoutable nodes that are contained inside a non-layoutable node

Changelog: [internal]

Reviewed By: shergin

Differential Revision: D19190285

fbshipit-source-id: fdc0358dc21312e9950a4eb16c36020e9e43e33f
2019-12-23 17:09:44 -08:00
David Vacca ac83f75b8c Extend Geometry class
Summary:
This diff extends Geometry class with methods to substract points and to determine if a Rect contains a Point or not

Changelog: [internal]

Reviewed By: sammy-SC

Differential Revision: D19190283

fbshipit-source-id: 7c7dd73be2cd644081ed9af8eeef7e137c618ae4
2019-12-23 17:09:43 -08:00
David Vacca 7932e1a658 Expose eventTarget as part of EventEmitter API
Summary:
This diff exposes eventTarget on the EventEmitter API

Changelog: [internal]

Reviewed By: shergin

Differential Revision: D19190281

fbshipit-source-id: 00dc8cf64f42b1fe176ecb7beefad59e61bd53ca
2019-12-23 17:09:43 -08:00
Valentin Shergin a09ab53692 Fabric: Use ComponentDescriptorParameters as an actual parameter of ComponentDescriptor constructor
Summary:
This diff changes the signature of ComponentDescriptor constructor to make it simpler and easier to support: now all arguments are passed via struct that contains all these arguments as fields.

Now the ComponentDescriptor constructor accepts three arguments one of which is optional. This causes some confusion and the possibility of bugs in all subclasses that needs to implement a custom constructor. Mostly because in every case we need to ensure that the constructor:
 * Accepts and pass down all parameters/arguments;
 * Accepts the right types of those parameters (shared vs weak pointers, references vs values).
 * Accepts all thee arguments and pass them (including flavor!). We failed this point several times.

Overal that makes the code simpler and allows changing the set of parameters relatively easy. (There is no plan for it!)
Look at the LOC balance: less code!

Changelog: [INTERNAL]

Reviewed By: sammy-SC

Differential Revision: D18548173

fbshipit-source-id: 5d038b135e004f6c054026b3235ed57db99c086d
2019-12-22 22:22:00 -08:00
Will Holen 58f3673099 `yarn upgrade` msggen
Summary:
This upgrades the yarn.lock for msggen

Changelog: [Internal]

Reviewed By: avp

Differential Revision: D19199162

fbshipit-source-id: 8064a14032948fa81e3c7e637cfca1e02f5bfcd6
2019-12-20 11:40:40 -08:00
Samuel Susla f871bbada2 Cosmetic adjustments to ShadowNode::getAncestors
Summary:
Changelog: [internal]

Just cosmetic changes to code, shouldn't affect behaviour at all.

Reviewed By: shergin

Differential Revision: D19177494

fbshipit-source-id: b2e4d3d2cf0d30f40f2e2d950dd7a10dc7a5b5ea
2019-12-20 01:01:55 -08:00
Marc Horowitz a195447539 Handle errors building JSErrors better
Summary:
If building a JSError causes a JSError, this would lead to infinite recursion.  This changes the error handling path so the problem is visible to JS.  There's also a few related cleanups included, and a new test case.

Changelog: [General] [Fixed] - If Error global is not callable when building an error, jsi will throw a JS exception back to JS code. #158

Reviewed By: tmikov, dulinriley

Differential Revision: D18796269

fbshipit-source-id: 57a45d144fa2ea5e78d18c27d3130611737dda96
2019-12-19 21:33:18 -08:00
Will Holen 35dd2e0c37 Upgrade more msggen dependencies
Summary:
GitHub still marks some dependencies as vulnerable. Updating them.

Changelog: [Internal]

Reviewed By: avp

Differential Revision: D19183702

fbshipit-source-id: 9c9c815816c4fc591c77d811058234a63aeda727
2019-12-19 14:02:57 -08:00
Samuel Susla 61f7639d38 Fabric: Remove eventEmitter from ShadowNodeFragment
Summary:
As part of the plan is splitting ShadowNodeFragment into two parts. ShadowNodeFamilyFragment is already in place. This diff removes use of `ShadowNodeFragment::eventEmitter` and goes over all call sites to change it to `ShadowNodeFamilyFragment::surfaceId`.
Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19146697

fbshipit-source-id: 22cae5404b0f3098feb86c0437a4aa256d5b773e
2019-12-19 13:48:22 -08:00
Samuel Susla 97f1c053b3 Fabric: Remove surfaceId from ShadowNodeFragment
Summary:
As part of the plan is splitting `ShadowNodeFragment` into two parts. `ShadowNodeFamilyFragment` is already in place. This diff removes use of `ShadowNodeFragment::surfaceId` and goes over all call sites to change it to `ShadowNodeFamilyFragment::surfaceId`.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19115785

fbshipit-source-id: 5972332c3360b88ca935581ed36070f26e678b22
2019-12-19 13:48:22 -08:00
Samuel Susla f9c5bf8bee Fabric: Remove tag from ShadowNodeFragment
Summary:
As part of the plan is splitting `ShadowNodeFragment` into two parts. `ShadowNodeFamilyFragment` is already in place. This diff removes use of `ShadowNodeFragment::tag` and goes over all call sites to change it to `ShadowNodeFamilyFragment::tag`.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19115781

fbshipit-source-id: 6ab3464a063c220d0924bf5a69b75449ca178650
2019-12-19 13:48:22 -08:00
Samuel Susla 90874d974f Fabric: ShadowNode now takes family as its constructor parameter
Summary: Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19115780

fbshipit-source-id: 7a693b5eea7599dca3e4b737126fcbb26078894d
2019-12-19 13:48:21 -08:00
Samuel Susla bc9d50991a ShadowNodeFamily now accepts fragment in constructor
Summary:
`ShadowNodeFamily` now accepts ShadowNodeFamilyfragment as its constructor parameter.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19115794

fbshipit-source-id: 95605398a8f6b54b5c6f196a22b8b6cadb18baad
2019-12-19 13:48:21 -08:00
Samuel Susla bd359ce257 Introduce new class ShadowNodeFamilyFragment
Summary: Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19115782

fbshipit-source-id: 9c3b069dbbf2c3d7321dfc9fbd0e54ae4e485a32
2019-12-19 13:48:21 -08:00
Will Holen 389a91c9d9 Update msggen dependencies
Summary:
`msggen` has dependencies on some npm packages with vulnerabilities.
This diff updates the dependency list.

Changelog: [Internal]

Reviewed By: avp

Differential Revision: D19107926

fbshipit-source-id: 0526f6fe430c162322ec9ecb84f3d78604cd76bc
2019-12-18 15:06:53 -08:00
Joshua Gross bb5622dd89 Prop parsing: always require explicit default argument to `convertRawProp`
Summary:
Having automatic defaults/an optional arg for `convertRawProp` has caused way more problems than it is worth. Remove the default argument.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19151594

fbshipit-source-id: 839ec8d138b2c3c083f221a2871582454004648c
2019-12-18 15:02:09 -08:00
Valentin Shergin b2f267ac3b Fabric: Propagation of ScrollView's contentOffset value down to ShadowNode layer on Android
Summary:
This implements propagation of ScrollView's contentOffset value on Android. That allows `LayoutableShadowNode::getRelativeLayoutMetrics` (and some measure functions) return values that take that info into  account.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: mdvacca

Differential Revision: D19027433

fbshipit-source-id: 023ff9642d023971b3d24d5cc5f7c2f4b443031e
2019-12-18 10:48:41 -08:00
Valentin Shergin c89ead313c Fabric: Proper implementation of ScrollView::contentOffset-aware measure functions (iOS only for now)
Summary:
This diff re-enables propagation of ScrollView's content-offset value down to the ShadowTree layer and enables measure fucntions opt-in incorporating this info to result.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: zackargyle

Differential Revision: D18981891

fbshipit-source-id: a6c0f4e690703b0ee07d45efab161750cfcc4b60
2019-12-18 10:48:40 -08:00
Samuel Susla 38af48d5fd Fix argument passed to method in TemplateViewComponentDescriptor
Summary:
Incorrect argument was being passed to `createShadowTreeFromTemplateProps`

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19114167

fbshipit-source-id: c0d7d96e5cbf43cbdcf653ff19b4565fd44e9994
2019-12-18 07:49:20 -08:00
Valentin Shergin 2c30b5dde9 Fabic: Fixed typo in LegacyViewManagerInterop
Summary:
Just typo.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D19137124

fbshipit-source-id: f1d751a4ddf785453575a9beeb7e0152d33f9071
2019-12-17 18:26:49 -08:00
Valentin Shergin 44ff3f46a5 Fabric: Re-enabling RN_SHADOW_TREE_INTROSPECTION in DEBUG mode
Summary:
This diff reverts D15908765 where we disabled the introspection feature because we were afraid that it leaks into prod because of some sort of misconfiguration. Seems that wasn't the case.
We need to re-enable this to get some signals if it's broken.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D19104526

fbshipit-source-id: 696c0e68bb858da270dbbb5da11032e664d75659
2019-12-17 18:26:49 -08:00
Valentin Shergin 9e2e754555 Fabric: Removing a workaround from ComponentDescriptorRegistry
Summary:
We used that on iOS only before we had `ComponentDescriptorProviderRequest`. Now iOS does not use `_fallbackComponentDescriptor`.
On Android we still use `_fallbackComponentDescriptor` but set that explicitly via `ComponentDescriptorRegistry::setFallbackComponentDescriptor`.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D19103296

fbshipit-source-id: fb2a2142afb183145fd3c8e48f620cb3f316c0bb
2019-12-17 18:26:49 -08:00
Samuel Susla b02d516d7c Fabric: fix order of arguments for ShadowNodeFragment
Summary: Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19109689

fbshipit-source-id: 6c7b477324376e95dac1c381e339a23f261a0d60
2019-12-17 03:43:35 -08:00
Kevin Gozali eb95b2f855 iOS Fabric: added support for image instrumentation [2]
Summary:
Passing thru image instrumentation activities to the image loader class, which now supports Fabric instrumentation.

Changelog: [Internal]

Reviewed By: mdvacca, voznesenskym

Differential Revision: D19047898

fbshipit-source-id: d12cb5a06a83e85347629a25e593d30cb9020fe6
2019-12-16 22:50:45 -08:00
Kevin Gozali 55142efd3a iOS Fabric: added support for image instrumentation [1]
Summary:
Added basic hook to enable image instrumentation. The hook passes information to the existing image loader, where instrumentation is done, specific for each app, if any.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D19047899

fbshipit-source-id: 6c013806cce98bcf1ea240d696a7ede9697e5cd9
2019-12-16 22:50:44 -08:00
Kevin Gozali 743074d09c iOS image: introduced RCTImageURLLoaderRequest for instrumentation/tracking purpose
Summary:
The `RCTImageURLLoaderWithAttribution` protocol historically only returns a cancellation block to cancel the url request. But for more complex instrumentation, we may need to associate a requestId for the specific URL request. To do this, the protocol now returns an object that has both the unique ID and the cancellation block, so that instrumentation logic can refer to the ID in the future.

Note that the `RCTImageURLLoader` protocol is unchanged, because the request ID is only relevant for instrumentation purpose.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D19047900

fbshipit-source-id: cd029f2470c32fc7bffd674b09a5353fe1dbc80b
2019-12-16 22:50:44 -08:00
Joshua Gross 5bc7f0441d Ensure that TextAttribute prop parsing in BaseTextProps uses proper defaults
Summary:
Motivation: in Marketplace, there's a TextInput in JS that sends { lineHeight: null } to C++. In Paper this was correctly handled as a default value, which just causes that property to not be set. In C++ in Fabric, it was being parsed incorrectly as 0 (because of incorrect defaults being passed into `convertRawProp`), causing the text to not be visible at all. The solution is to make sure that its default value is NaN, which is handled correctly, and causes the Text to render again.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19128049

fbshipit-source-id: fe985428f3ed8b90d56cfa387fbc2d1476d19d36
2019-12-16 18:14:14 -08:00
Valentin Shergin 5e50d3141d Fabric: Fixed `View::transform::scaleX/Y/Z` property
Summary:
The coefficients in the code were incorrect: the default value of the scale should be 1, not 0.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sahrens

Differential Revision: D19101221

fbshipit-source-id: 3b4c3afc692ddb6bf32bf2344a77ec5ca34a06e4
2019-12-16 14:35:24 -08:00