Commit Graph

1908 Commits

Author SHA1 Message Date
Max Ovtsin 166a5ddf88 Get ReactiveNative compiled with Clang 10 (#28362)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/28362

Fixed a few compilation errors emitted by Clang 10.

Changelog:
[iOS] [Fixed] - Get ready for Clang 10

Differential Revision: D20549970

fbshipit-source-id: dc36a85d90d3e43a05f045feb57c6ab6ded67da7
2021-04-30 13:07:43 +01:00
Jason Safaiyeh 572f710492 Resolve React-cxxreact warnings (#28047)
Summary:
Resolve Xcode warnings from React-cxxreact.

## Changelog

[iOS] [Fixed] - Resolve Xcode warnings from React-cxxreact.
Pull Request resolved: https://github.com/facebook/react-native/pull/28047

Test Plan: React-cxxreact should no longer throw `... creates a copy from type...` warnings

Differential Revision: D19874043

Pulled By: hramos

fbshipit-source-id: 15a4a810adee268e6ede459d6d4917ccfa83c157
2020-02-13 16:19:33 +01:00
Pascal Hartig 8c11d3ffce Migrate to FBJNI (#27729)
Summary:
This is an incomplete effort to migrate from libfb to libfbjni. This is needed to restore the compatibility with Flipper and other FB Android projects that make use of FBJNI. Effectively, the outcome is that `fbjni` no longer has a checked-in copy here, but instead relies on the public artifacts published at github.com/facebookincubator/fbjni that can be deduplicated at build-time.

**A non-exhaustive list of tasks:**

* [X] Gradle builds the SDK and RNTester for Android.
* [X] Buck build for rntester works in OSS.
* [ ] Move from `java-only` release to full `fbjni` release. This requires finding a solution for stripping out `.so` files that the old `Android.mk` insists on including in the final artifacts and will clash with the full distribution.
* [ ] Import this and fix potential internal build issues.
* [ ] Verify that the changes made to the Hermes integration don't have any unintended consequences.

## Changelog

[Android] [Changed] - Migrated from libfb to libfbjni for JNI calls
Pull Request resolved: https://github.com/facebook/react-native/pull/27729

Test Plan:
- CI is already passing again for Gradle and Buck in OSS.
- After applying the following patch, RNTester builds and works with the latest Flipper SDK:

```
 diff --git a/RNTester/android/app/build.gradle b/RNTester/android/app/build.gradle
index b8a6437d7..eac942104 100644
 --- a/RNTester/android/app/build.gradle
+++ b/RNTester/android/app/build.gradle
@@ -170,10 +170,19 @@ dependencies {
     debugImplementation files(hermesPath + "hermes-debug.aar")
     releaseImplementation files(hermesPath + "hermes-release.aar")

-    debugImplementation("com.facebook.flipper:flipper:0.23.4") {
+    debugImplementation("com.facebook.flipper🐬+") {
         exclude group:'com.facebook.yoga'
-        exclude group:'com.facebook.flipper', module: 'fbjni'
-        exclude group:'com.facebook.litho', module: 'litho-annotations'
+        exclude group:'com.facebook.fbjni'
+    }
+
+    debugImplementation("com.facebook.flipper:flipper-network-plugin:+") {
+        exclude group:'com.facebook.yoga'
+        exclude group:'com.facebook.fbjni'
+    }
+
+    debugImplementation("com.facebook.flipper:flipper-fresco-plugin:+") {
+        exclude group:'com.facebook.yoga'
+        exclude group:'com.facebook.fbjni'
     }

     if (useIntlJsc) {
```

Reviewed By: mdvacca

Differential Revision: D19345270

Pulled By: passy

fbshipit-source-id: 33811e7f97f44f2ec5999e1c35339909dc4fd3b1
2020-02-05 11:02:13 +00:00
Valentin Shergin 0cdc3b7016 Fabric: Making DebugStringConvertibleOptions a required parameter for all methods of static debug-printing infra
Summary:
Having those arguments optional does not really make anything easier to use; on another side that makes it hard finding problems caused by missing that parameter.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D18797337

fbshipit-source-id: c119b8f6a03994072edb45e39337e33b0f8b602f
2019-12-09 15:37:59 -08:00
Joshua Gross 254ebab1d2 AndroidTextInput: don't set TextInput value to placeholder; use eventCounter prop to send tree updates via state
Summary:
Fix (1) placeholder (2) modifying TextInput in Fabric on Android.

Changelog: [internal]

Reviewed By: mdvacca

Differential Revision: D18894538

fbshipit-source-id: 21103f56e6f6e108fcf6359a23c9dd9a0323250e
2019-12-09 14:44:36 -08:00
Samuel Susla 5ee8202b26 Add missing accessibilityTraits in Fabric
Summary:
`accessibilityTraits` was missing, this diff adds it.

Also there is a name mis match, in javascript it is called `accessibilityRole`.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D18857668

fbshipit-source-id: 10656e8fb4e8c1d771a72c7f354b845e41cfc313
2019-12-09 06:41:27 -08:00
Valentin Shergin b1f2c1e2c5 Fabric: Disabling an assert in ComponentDescriptorProviderRegistry
Summary:
This temporarily disables an `assert` in `ComponentDescriptorProviderRegistry`. The `assert` only suggests that the call to the class is redundant, so it's safe to just remove it for now.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross, sammy-SC

Differential Revision: D18878273

fbshipit-source-id: 007a2c6f62f858126912b7e54a1098e6f4c25a16
2019-12-08 09:54:37 -08:00
Valentin Shergin 36d895ce21 Fabric: Enabling new TextMeasureCache thing for Android
Summary:
Read more about this in D18848583 (where it's implemented for iOS). This diff enables that for Android.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18869823

fbshipit-source-id: ebdc863ec07268119d1cbbb911760532bb28ee04
2019-12-07 22:47:49 -08:00
Valentin Shergin 3aba90b58a Fabric: Workaround for mysterious crash in synchronouslyUpdateViewOnUIThread:props:.
Summary:
We are seeing some non-trivial amount of crashes happened because `[RCTSurfacePresenter synchronouslyUpdateViewOnUIThread:props:]` requests a Component Descriptor which does not register in the registry.
And the problem here is that ComponentDescriptors are not being designed to be used outside of C++ UIManager, and we only use that in RCTSurfacePresenter only because it's an old workaround that makes Native Animation Driver works with Fabric.

Messing with ComponentDescriptors are in general dangerous. Accessing them outside of UIManager means that they might be deallocated at any time, extending their lifetime will cause other crashes on the other side. So, that's why this is "BROKEN".

This diff does not make the code worse, it just designates the problem that was there for a long time, so it kinda makes it better.

We don't know for sure why some ComponentDescriptors are not registered but this diff at least makes it not crash in such case.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D18869651

fbshipit-source-id: 9d945ac7a2bd24a69a9bbb83b4fdd3cd19808f87
2019-12-06 17:58:35 -08:00
Valentin Shergin e08412d9a1 Fabric: Text Measuring: TextMeasureCache the new, improved text measure cache
Summary:
Special thanks for Joshua Gross for flagging this problem!

This diff implements a custom evicting hash map designed specially to hold text measurement information. The key feature of this is custom equality checks and hashing functions.

They are designed around the following principals:
* Decorative text attributes (such as color, shadows, etc) has no effect on layout, therefore they should not be taking into account;
* `minimum height`, `minimum width`, and `maximum height` don't affect the measurement;
* the value of `layout metrics` are important only for `attachment` fragments.

After I redo all tests, I will enable this for Android-specific TextLayoutManager in separate diff.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D18848583

fbshipit-source-id: 46c2fc445fbd1823afc5e7498e37de75381258b1
2019-12-06 10:54:13 -08:00
Valentin Shergin 1a12919dea Fabric: Text Measuring: Using unlimited height during text measuring
Summary:
In the previous diff, we noted that the maximum height is not really important for text measurement. That diff make is in code.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D18848585

fbshipit-source-id: 5fe0ea8f76487a50baa8a2e024663a85afcd9861
2019-12-06 10:54:13 -08:00
Valentin Shergin c9b9c93c90 Fabric: Text Measuring: Doing clamping outside of caching
Summary:
Here the deal with the clamp thing:
A layout engine asks nodes to measure their content providing layout constraints (min and max size) and that would be kind from nodes to return a result that in space of those constraints. Sometimes, satisfying that is an additional separate step of that operation, e.g. if we know that the intrinsic size of some node is `{100, 100}`, we need to clamp that to satisfy constraint `[min: {200, 200}, max: {inf, inf}]`.

In case when we need to cache measure information, it becomes tricky enough when we need to make the cache work most efficiently. For the case of measuring Text, we have an insight: the available maximum width is important, the rest three metrics (maximum height and minimum size) are not.

That means that any changes in those three metrics don't affect the actual measurement result but will affect the final value because the actual value will be clamped by constraints that didn't influence measuring in the first place.
That's why moving clamping outside of a cache is the first step into making it more efficient.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D18848584

fbshipit-source-id: 8feeb3f1a9d0e9691abac8be43639487a626fec3
2019-12-06 10:54:12 -08:00
Eli White e362470305 Convert easy files to flow strict-local
Summary:
This diff was generated by this script used by WWW
https://our.intern.facebook.com/intern/diffusion/WWW/browse/master/scripts/flow/upgrade_to_flow_strict_local.sh?lines=0

Changelog:
[Internal] Upgrade flow to flow strict-local

Reviewed By: zackargyle, rickhanlonii

Differential Revision: D18833630

fbshipit-source-id: e64d4e9a49a0db5e6bf70a0c489567862b578d7f
2019-12-05 16:06:46 -08:00
Joshua Gross b9491b7c51 TextInput: support editing completely empty TextInputs
Summary:
Before this change, C++ couldn't propagate changes that updated TextInputs that were completely empty. In C++ the AttributedString cannot contain Fragments with empty text, so a completely empty TextInput would have no Fragments; this breaks the C++ state value updating infra since it relies on copying over existing fragments.

Instead, now we propagate default TextAttributes and ShadowView through State, so that State updates can use them to construct new Fragments.

Changelog: [Internal]

Reviewed By: shergin, mdvacca

Differential Revision: D18835048

fbshipit-source-id: 58ac94c5454c8610c6287b096b62199045e5879b
2019-12-05 13:20:30 -08:00
Joshua Gross 0556e86d09 TextInput: support modifying TextInputs with multiple Fragments (Cxx side)
Summary:
Support for modifying AndroidTextInputs with multiple Fragments was added on the Java side in a previous diff.

This diff adds support on the C++ side for the following scenario:

A <TextInput> is initially given contents via children <Text> notes, which represents multiple Fragments (that could have different TextAttributes like color, font size, backgroundcolor, etc). The Android EditText view must get this initial data, and then all updates after that on the Android side must flow to C++ so that the C++ ShadowNode can perform layout and measurement with up-to-date data.

At the same time, the <TextInput> node could be updated from the JS side. All else equal, this would cause the native Android EditText to be replaced with the old, original contents of the <TextInput> that may not have been updated at all from the JS side.

To mitigate this, we keep track of two AttributedStrings with Fragments on the C++ side: the AttributedString representing the values coming from <TextInput> children, from JS (`treeAttributedString`); and the AttributedString representing the current value the user is interacting with (`attributedString`). If the children from JS don't change, we don't update Android/Java with that AttributedString. If the children from JS do change, we overwrite any user input with the tree from JS.

Changelog: [Internal]

Reviewed By: shergin, mdvacca

Differential Revision: D18785976

fbshipit-source-id: a1f3a935e02379cabca8ab62a39cb3c0cf3fbca5
2019-12-05 13:20:30 -08:00
Joshua Gross 2a46980535 AttributedString equality: only check tags of parentShadowView; ShadowViews are never equal otherwise
Summary:
For future diffs, we need to check AttributedStrings for equality.
It turns out that any time props or state change, two `parentShadowView`s will never be equal to each other, even if we'd consider them equal for our use-cases here for AttributedStrings. Just compare the tags instead of the whole object.

NOTE: I don't have any strong opinions about how we should be comparing them. It just isn't working currently for AndroidTextInput. Comparing tags seems convenient and reasonably correct for now.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D18786004

fbshipit-source-id: 13c0e881cd8d2c2a207e8891309b3c9b880b827f
2019-12-05 13:20:29 -08:00
Joshua Gross 25ce622683 Fix TextInput example with text attribute and child Text node: text background shouldn't be same as TextInput background
Summary:
Currently the TextInput background is same as the background of the `text` value's attributes, because of the way we're parsing props and using the TextInput's props both for the background of the TextInput, and for the AttributedString/background color of the `text` prop node's attributes. If the background color has opacity, the `text` prop node will not have the correct background because it will be applied twice. Fix it.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18760384

fbshipit-source-id: 0cdcc8dd8839dd47e8fe0f593b4696bc16a62333
2019-12-05 13:20:29 -08:00
Joshua Gross a09346f129 TextInput: support text value+child Text nodes
Summary:
Fix and simplify `AndroidTextInputShadowNode::getAttributedString` so that it (1) works, and (2) is aligned with the equivalents in the old Java code.

The issue is that we weren't picking up `text` attributes since we're only traversing children and not the TextInput node itself. If a `text` attribute is present it needs to be treated as its own Text node.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18739830

fbshipit-source-id: 4b3bc81dbe8c241c2e06fe5be1f9b50e49132890
2019-12-05 13:20:29 -08:00
Joshua Gross 7590d9f8f4 Support creating AndroidTextInputState from previous state + folly::dynamic
Summary:
This is necessary for allowing TextInput updates from Java.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18739831

fbshipit-source-id: 0ba2d7eac96cac7471c5e46cc1e03a4d065229f5
2019-12-05 13:20:28 -08:00
Valentin Shergin 42f2ded900 Fabric: Returning zero size on attempt to measure an empty string in RCTTextLayoutManager
Summary:
Sometimes, very irregularly, measuring an empty string crashes/freezes iOS internal text infrastructure. This is our last line of defense.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC, mdvacca

Differential Revision: D18802308

fbshipit-source-id: addf523b31b78b0777be7eeaeee140ac8416393b
2019-12-04 18:36:49 -08:00
Valentin Shergin d12385cae6 Fabric: Support for AttributedStringBox::Mode::OpaquePointer in RCTTextLayoutManager
Summary:
Now RCTTextLayoutManager (and TextLayoutManager) not only accept `AttributedStringBox`  but also is capable to measure such kind of string when it contains a pointer to NSAttributedString.
The same can be implemented for Android when/if needed.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D18670791

fbshipit-source-id: f19089de64d00e1290767310a500ade4cede4685
2019-12-04 18:36:49 -08:00
Valentin Shergin c4876d0313 Fabric: Introducing AttributedStringBox
Summary:
The diff implements a new class called `AttributedStringBox` that represents an object storing a shared `AttributedString` *or* a shared pointer to some opaque platform-specific object that can be used as an attributed string. The class serves two main purposes:
- Represent type-erased attributed string entity (which can be platform-specific or platform-independent);
- Represent a container that can be copied with constant complexity.

Why? Several reasons:
- Sometimes it makes sense to keep an attributed string as a shared resource. This way we don't need to pay for expensive copying and we also implement a copy-on-write semantics on top of that if needed.
- We need to extend a TextLayoutMeasure API to support measuring some platform-specific attributed string implementation to remove the necessity of converting a string back and forth between representations. That's especially important for TextInput because we will need to measure that very efficiently (and the source of measuring, in this case, is a platform attributed string).

In other words, we need something to store inside TextInputState to measure and update very efficiently. The source of this data might be a native TextInput control or a data from React, to represent that kinda object we need this data structure (and interfaces that deal with it).

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D18670793

fbshipit-source-id: bc0164f801f28642f7c6da340af12acf33b85d24
2019-12-04 18:36:48 -08:00
Valentin Shergin 7368f79169 Fabric: Introducing AttributedString::Range
Summary:
We need this type to work with string ranges (e.g. working with selection ranges). This diff implements parsing and printing that as well.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D18607656

fbshipit-source-id: f2cfd7c5b7ba9f225a9a0c5a078947a220b2f30d
2019-12-03 14:19:52 -08:00
Valentin Shergin bb1f9b23e7 Fabric: Using better::map instead of std::unordered_map in ShadowTreeRegistry
Summary:
Becasue better one is more efficient.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D18626666

fbshipit-source-id: 143dab1dd4c2e168368d2ca14bf2ffc8367d71ea
2019-12-01 19:23:26 -08:00
Will Holen 33f82c569c Allow enumerating local variables
Summary:
Our current lazy compilation parent scope issue caused us to only have a
single lexical scope, which was taken to be the global scope. This
effectively hid all local variables. Additionally, the variables were
not marked as enumerable, so Chrome didn't show them.

As further improvements, 'this' is now included, and we more correctly
tag parent scopes as closures.

Changelog: [Internal]

Reviewed By: avp

Differential Revision: D18671527

fbshipit-source-id: cbbf9fbd319e433b9f681bd23e4ad7b4bb4a3d74
2019-12-01 05:05:50 -08:00
Sidharth Guglani 3e065572df Remove bitfield.h
Summary:
##Changelog:

[Internal][Yoga] Remove Bitfield.h

Reviewed By: astreet

Differential Revision: D18519647

fbshipit-source-id: b46fe585d3ef5f1da7d2726b2d9f759a649be121
2019-11-27 14:20:47 -08:00
Sidharth Guglani c8520dd94f Remove bitfield from YGNode.h
Summary:
##Changelog:

[Internal][Yoga] remove Bitfield from YGNode.h

Reviewed By: astreet

Differential Revision: D18519633

fbshipit-source-id: b5a7d8d5ee960c5618df382900c4ded3da0587a6
2019-11-27 14:20:47 -08:00
Joshua Gross 7ab5eb4caf AndroidTextInput: support using commands instead of setNativeProps (native change)
Summary:
In AndroidTextInput, support codegen'd ViewCommands in native and add three commands that will eventually replace usage of setNativeProps on Android.

TextInput will use these commands in a future diff.

Changelog: [Internal]

Reviewed By: TheSavior

Differential Revision: D18612150

fbshipit-source-id: 5d427040686e8c5ab504dd845bc8ef863f558c35
2019-11-27 12:55:48 -08:00
Joshua Gross 98b8a17645 AndroidTextInput: don't override text with default/placeholder text except for measurement
Summary:
In C++ we return default/placeholder text instead of text in `getAttributedString` so that measurement is correct. This is fine but we shouldn't actually set the attributedString on the ReactEditText view.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18672369

fbshipit-source-id: 1bb5cddda3cf78f2cff6f805e67c8994ab32ee7c
2019-11-27 12:55:48 -08:00
Joshua Gross da5ea0215a AndroidTextInput: keep track of mostRecentEventCount in C++ State
Summary:
Keep track of AndroidTextInput's mostRecentEventCount in C++ State.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18672368

fbshipit-source-id: ea7a635629050a6d4957cbcef6ec0bda5faaad9a
2019-11-27 12:55:47 -08:00
Joshua Gross 309de462bd Support setting partial state from Android, and filling in data with previous State constructor
Summary:
iOS and other platforms have direct access to C++ StateT structs, whereas Java only has access to a Java map equivalent - state updates from Java can't update complex types, or must incur significant cost to reconstruct large objects from their folly::dynamic representation (not to mention the complexity of implementing the Java-to-C++ struct converters). Thus it's hard for Java to update StateT's with complex types on the C++ side.

This diff makes a minor change to Android's updateState which uses both the folly::dynamic data from Java as well as the previous State, so each StateT can have fields that are read-only from the Java perspective.

Motivation: For AndroidTextInput we need to set params from Java, without being able to send all of the State params from Java.

In this diff, we introduce a new State constructor that takes the previous State value and a folly::dynamic. It is up to each State implementation how the additional parameter will be used.

We migrate every existing component except for AndroidTextInput in this diff.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18672365

fbshipit-source-id: 4469e0a3c7658c204089c6fed39394979883f124
2019-11-27 12:55:47 -08:00
Joshua Gross 07580f0f7e AndroidTextInput: support proper measuring of AndroidTextInput text, and displaying attributed strings
Summary:
Use a similar setup as Paragraph, and support in Fabric:

- Correct measuring of AndroidTextInput
- Correct display of AndroidTextInput attributed strings

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18669957

fbshipit-source-id: 84e0ad8021c9edf8219e0c673c781276ca29787d
2019-11-27 12:55:46 -08:00
Joshua Gross 1cab7ad1d6 Core: Fix props parsing when accessing prop more than once in Props struct initialization
Summary:
See previous diff implementing failing unit test in RawPropsTest.cpp.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18664014

fbshipit-source-id: ef827bce8c676666b2ce4d5db4abbb0ab11cc454
2019-11-27 12:55:46 -08:00
Joshua Gross fb9cddcab0 Core: Fix infinite loop in prop parsing
Summary:
See previous diff where I added RawPropsTest.cpp to unit-test this functionality. Before this, if you looked up a prop name that does not exist, the prop parser would enter an infinite loop.

I also took this opportunity to comment the block a little bit as it's not super intuitive at first glance.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18662135

fbshipit-source-id: 319a3b80d1c606db18b2added9f2aa99d4d03407
2019-11-27 12:55:46 -08:00
Joshua Gross 46ca564fbf RawPropsTest C++ unit tests (fabric)
Summary:
Add RawPropsTests unit tests.

The general idea is to cover the normal props use-cases and then add a few abnormal cases and some errors, to make sure nothing crashes.

The final test uncovers an infinite loop in RawProp parsing.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D18662136

fbshipit-source-id: 2f603b4c3e32f2d4334587e898ea81ad025b07b6
2019-11-27 12:55:45 -08:00
Valentin Shergin 83aa5b7e31 Fabric: RCTNSLineBreakModeFromWritingDirection was renamed
Summary:
... because the original name made no sense.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D18607834

fbshipit-source-id: bf32d2b61d1c3deccba0b599b303ede0b82e6dd6
2019-11-22 22:25:06 -08:00
Valentin Shergin 11c9f480af Fabric: Handling duplicating sub-props in RawPropsKeyMap
Summary:
This diff makes the parsing *Props object with sub-props with duplicating names deterministic: only the first one will be assigned. Before this change, the order was not guaranteed because `qsort` sorting algorithm is not stable and because binary search that we use to search in the sorted array does not handle duplicates deterministically.

The behavior when the only sub-prop (the first one) is being assigned actually desirable feature that exists on purpose. There are places where it's desired behavior (like TextInputProps) and in cases where it's not desired (we don't really have those), it's easy to "fix" implementing the custom constructor.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D18607657

fbshipit-source-id: aa53a320e6a48877a0dd1b9351dfcc8a9f419b38
2019-11-22 22:25:06 -08:00
Valentin Shergin ed909b619c Fabric: Removing AttributedString::Fragment::shadowNode
Summary:
Before this change `AttributedString::Fragment` had two ShadowView objects (`shadowView` and `parentShadowView`). This diff unifies those two things into one. That allows us to save some CPU and memory and makes things a bit simpler. Besides that, now the length of NSAttributedString and AttributedString is now always the same (it's one Unicode character for an attachment for both).

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D18607658

fbshipit-source-id: 502ae244e98a52694adc0d646650f8ea0d7922ae
2019-11-22 22:25:06 -08:00
Valentin Shergin 890968cc2c Fabric: Fixed missing base class constructor call in TextProps
Summary:
We need to call all custom base constructors as part of a custom constuctor of the superclass otherwise C++ will use the default one (and that's not what we want here).

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D18607654

fbshipit-source-id: 6e6154ce4b546c0717a8a67e3c497dfcd696ec41
2019-11-22 22:25:05 -08:00
Valentin Shergin 858824c08b Fabric: Fixing event priority propagation in ConcreteState
Summary:
Two changes:
 * Now we pass the given `priority` to the next function;
 * The default value for `updateState` is now the same as a default value in another overload of the same function (AsynchronousBatched).

All that don't change anything for now because sync event dispatching is disabled (that will matter bit later thought).

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D18607655

fbshipit-source-id: 9dc7cdac9f347e09449a931c780e613925882a1e
2019-11-22 22:25:05 -08:00
Will Holen d0ed21531a If getters throw, replace value with a placeholder
Summary:
Currently, if you try to inspect globals in the debugger and they have
properties that throw exceptions, the app redscreens.  In particular,
inspecting any function triggers the bug because of `arguments` and
`caller`.

This diff catches the exception and shows a placeholder instead.

Changelog: [Internal]

Reviewed By: mhorowitz

Differential Revision: D18664765

fbshipit-source-id: 0c662f3d97b21a29c57a1dd724e63d17a3b4e263
2019-11-22 16:13:57 -08:00
Sidharth Guglani 156306606d Remove BItfield from YGLayout.h
Summary:
##Changelog:

[Internal][Yoga] Remove Bitfield from YGLayout

Reviewed By: astreet

Differential Revision: D18519623

fbshipit-source-id: 950b8cb1ca2cd0424b8d8748c4b71336b40fc15f
2019-11-22 04:32:07 -08:00
Sidharth Guglani aeebf3afdf Remove Bitfield from YGStyle
Summary:
##Changelog:

[Internal][Yoga] Remove Bitfield from YGStyle

Reviewed By: astreet

Differential Revision: D18519614

fbshipit-source-id: 70f18bc679b62712d40d76bd793cf85906b067a1
2019-11-22 04:32:07 -08:00
Sidharth Guglani bfed94376a Added BitUtils
Summary:
Adds BitUtils to be used later instead of Bitfield.h

##Changelog:
[Internal][Yoga] : Adds BitUtils to be used later instead of Bitfield.h

Reviewed By: astreet

Differential Revision: D18519609

fbshipit-source-id: 8353929543505a7d80d66281adb801d34372beed
2019-11-22 04:32:07 -08:00
Sidharth Guglani 95b3673e21 Back out "not using templates for updating styles which are used via bitfield"
Reviewed By: astreet

Differential Revision: D18628090

fbshipit-source-id: 9d006534111f10ec25a0d56214792aeb96fbdef9
2019-11-22 04:32:06 -08:00
Valentin Shergin be324ca2dc Fabric: Adding some logs to Scheduler, UIManager and co
Summary:
We hope that will help us to understand more.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18599164

fbshipit-source-id: 431f83de707fc7113e04abd3dd5b59ee5c9cc675
2019-11-21 16:21:25 -08:00
George Zahariev 8553e1acc4 Exact-by-default codemod for react-native-github
Summary:
We are rolling out exact-by-default syntax to xplat/js.

I had to manually move around some comments to preserve proper placement.

Changelog: [Internal]

Reviewed By: jbrown215

Differential Revision: D18633611

fbshipit-source-id: 48f7468dcc55b1d00985419d035a61c6820b3abe
2019-11-21 09:42:57 -08:00
Joshua Gross 9c5b26639a Return AttributedString for placeholder text if text is empty
Summary:
In AndroidTextInput ShadowNode, return AttributedString for placeholder text if text is empty. This ensures that empty TextInputs will have non-zero height.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18623063

fbshipit-source-id: 2eec2b794b526e8ff5435352e20ccb659358fc84
2019-11-20 18:40:22 -08:00
Valentin Shergin 8dea0acc23 Fabric: Using LOG(ERROR) instead of LOG(Fatal) in Scheduler
Summary:
FATAL crashes the app, which was never the intent of that log message.
We need to use ERROR instead.

Changelog: [INTERNAL]

Reviewed By: fkgozali, zackargyle, mdvacca

Differential Revision: D18597249

fbshipit-source-id: 523c96550f97e837e1957c933786acf28033e60a
2019-11-19 17:01:55 -08:00
Ramanpreet Nara 8ac9b32779 Remove __unused annotation from ConcreteSystraceSection ctor args
Summary:
The constructor arguments to `ConcreteSystraceSection` are actually used. It seems like they were accidentally marked unused in D14181748.

Changelog:
[iOS][Fixed] - Remove __unused annotation from ConcreteSystraceSection ctor args.

Reviewed By: PeteTheHeat

Differential Revision: D18574190

fbshipit-source-id: 38d58da794341d4ecc52f3bc16e05ef2757cca1d
2019-11-19 10:51:59 -08:00