Summary:
This is similar in function to the old JSCExecutor, but uses the more abstract JSI API to interact with the JSVM.
@public
Reviewed By: axe-fb
Differential Revision: D9328241
fbshipit-source-id: 3212ff4f43d0589a70d7bebc4d463d4433590f1d
Summary:
This diff is an implementation of jsi::Runtime which uses JSC as the virtual machine. All of the JSC-specific details are encapsulated here.
@public
Reviewed By: RSNara
Differential Revision: D9328242
fbshipit-source-id: be3c7bed161916c1cb9a48182600b558f054eadc
Summary: This will help abstract the JS engine from React Native
Reviewed By: hramos
Differential Revision: D9328237
fbshipit-source-id: 7b34f55f28e43d83ba24d22e83e836c92ca737a9
Summary:
The first implementation of EventEmitter's enable/disable feature didn't not provide a way to enable an object after it was disabled.
Apparently, we need this functionality due that fact that all nodes of the same family share same event emitter.
Reviewed By: mdvacca
Differential Revision: D10395849
fbshipit-source-id: 0eba54f0bb7ded35d64afb6559e6e27208c2b577
Summary:
Trivial.
We have to proxy layout directions as well as min and max sizes to RootNode's Props to properly communicate the constrains to Yoga.
Reviewed By: sahrens
Differential Revision: D10387798
fbshipit-source-id: a02ec0a20b3ef28f6230738e5b3a4a2b0b8e0961
Summary: An `AttributedString` object generated by a cross-platform layer of React Native must have already resolved text styles to make the actual resulting text identical across platforms. To do so we have to have a unified default.
Reviewed By: sahrens
Differential Revision: D10287725
fbshipit-source-id: e8c62b33496be34146182baccd0009d3624a7fe5
Summary: This might be useful to specify some default props.
Reviewed By: sahrens
Differential Revision: D10284657
fbshipit-source-id: b6fbdc6bab75697af67bdbb5d06eb3309500ab8c
Summary: We didn't have support for them... and now we have it.
Reviewed By: sahrens
Differential Revision: D10280430
fbshipit-source-id: 7275d4617ed3994366f673a17c24b823293d7092
Summary: This diff fixes the release of ImageRequest object. The responseFutureSplitter_ can be destroyed by the time ~ImageRequest is executed. See P60163877 for original crash (this crash was reproducible when reloading or closing a Fabric screen that contains several images.
Reviewed By: shergin
Differential Revision: D10282207
fbshipit-source-id: 4f0894959e54f6d15b98e216df102e764866e387
Summary:
Fixes#815
Imagine a node with this style: `{ paddingHorizontal: 10, paddingStart: 0 }`.
After running layout on this node, we expect its computed `paddingStart` to be `0`. However, it is actually `10`.
Consider the expression `paddingEdgeStart.getValue() > 0.0f` in [`getLeadingPadding`](328ec7dc4d/yoga/YGNode.cpp (L461)). Why is `0` handled like a negative number rather than a positive number? I suspect this should be `>=` so `0` is handled like the positive numbers (this is how `getTrailingPadding` works).
It looks like 3a82d2b1a8 (diff-07b4949bf42749fde386e769ff08a124) changed the operator from `>=` to `>` in `getLeadingPadding`. I suspect it was a mistake. `getTrailingPadding` still uses `>=`.
I manually verified this using the code in #815 and added some unit tests to catch this bug and other similar issues.
Adam Comella
Microsoft Corp.
Pull Request resolved: https://github.com/facebook/yoga/pull/816
Reviewed By: priteshrnandgaonkar
Differential Revision: D10282617
Pulled By: shergin
fbshipit-source-id: 2ab2874ae39d9454308a020a960ace85573fe777
Summary: missing header and platform. attributedstring builds now, but still fails because of T34990592
Reviewed By: mdvacca
Differential Revision: D10349210
fbshipit-source-id: dcd163df9ac9a4fcb36399cb9f93dbf1b33c062d
Summary:
`YGRoundValueToPixelGrid` currently rounds negative numbers incorrectly. For example:
```
YGRoundValueToPixelGrid(-2.2, 1.0, /* ceil */ false, /* floor */ true) = -2.0
```
However, that operation is supposed to take the floor of the number so the result should acutally be `-3.0`.
There's a detailed comment in `YGRoundValueToPixelGrid` about the fix and why it works.
A symptom that manifested because of this bug is that text nodes could get smaller and smaller on each layout pass. For details see https://github.com/facebook/yoga/issues/824.
Fixes#824
Adam Comella
Microsoft Corp.
Pull Request resolved: https://github.com/facebook/yoga/pull/825
Reviewed By: priteshrnandgaonkar
Differential Revision: D10282064
Pulled By: shergin
fbshipit-source-id: 16ca966e6cb0cfc88b1dbf4ba31e7b1dbe1f2049
Summary: Simplies UIManager a bit and some other tweaks
Reviewed By: shergin
Differential Revision: D10211883
fbshipit-source-id: 93ab23dd2baab2fdc6d9c54e976b001a19efab7f
Summary:
This consists of several fixes:
- Some of the C++ functions called by the tests were missing `WIN_EXPORT`
- It looks like Yoga was changed to round up after `TestMeasureFuncWithFloat` was written. Here's the function call that results in the rounding: 357ca78f9f/yoga/Yoga.cpp (L4019-L4026)
- The format of the result of the `Print` method was changed after `TestPrint` was written.
Pull Request resolved: https://github.com/facebook/yoga/pull/818
Differential Revision: D10282902
Pulled By: shergin
fbshipit-source-id: a5fd732a7dbff1a704cbafbfc95ae3e0c0a0cdd8
Summary: This diff avoids the serialization of color that are set as: "UndefinedColor". This allows the text rendering system to set the default color in the native side
Reviewed By: shergin
Differential Revision: D10275834
fbshipit-source-id: b81c7a5995bef65e04a246d99f44ff10cb20f548
Summary: This diff enables the onPress event for TextViews that render RawText
Reviewed By: shergin
Differential Revision: D10222183
fbshipit-source-id: 4b6a6ad548286453f7dd3a14a5e4ee453a55b923
Summary: This diff enables view flattening for Android when using Fabric.
Reviewed By: shergin
Differential Revision: D10254678
fbshipit-source-id: cc7acaa38a6d01e112ba0e8a92db61cdeefbffee
Summary: This diff introduces the collapsable props in the viewProps. This prop is used in product code to prevent specific Views to be removed from the view hierarchy
Reviewed By: shergin
Differential Revision: D10254679
fbshipit-source-id: 637665b8998a86e29e839eb6d405a0fac354c8d3
Summary: Previsouly, we basically didn't support Accessibility at all.
Reviewed By: mdvacca
Differential Revision: D10250635
fbshipit-source-id: d33eed8f56374f57310654653f41c312cb5942e6
Summary: This is the second and the final part of adopting clang-format.
Reviewed By: mdvacca
Differential Revision: D10229624
fbshipit-source-id: d97670b716800ea2488b84bd0aacaf54d8bd2e31
Summary: Quite obviously, having a `complete` method which accepts only `newRootShadowNode` was a baaad idea. When we `complete` or `commit` we always have to have two nodes (before and after). And only after layout and right before swapping (and acquiring the mutex) we have to verify that *current* root node is still the same as it was when we initialized the transaction (if not, we have to abort).
Reviewed By: mdvacca
Differential Revision: D10201902
fbshipit-source-id: 15adc78c5d31d6fd39fd7fc6e53203a5539717a8
Summary:
Size constraints are essential part of the running Surface, decoupling them from starting process means that we will have to perform additional commit later.
This and previous couple diffs fix a problem with initial zero size of the surface and following visible "jumpy" relayout.
Reviewed By: sahrens
Differential Revision: D10174280
fbshipit-source-id: 0ec48692cb814fd46cc3a1d044c5eb8ab9ecb031
Summary:
New `ShadowTree::synchronize` method allows to perform operations on ShadowTree without a risk of an unsuccessful commit. To make it happen, the `commitMutex_` is now recursive and `synchronize` acquires it before calling the callback.
Using that we finally can implement reliable `constraintLayout`.
Reviewed By: mdvacca
Differential Revision: D10174281
fbshipit-source-id: 9864ebb5343d40e2da205272a834710f0ab730db
Summary:
Setting the right expectations: setting layout constraints might fail. Nothing really changed.
Implementing a reliable `constraintLayout` which locks instead of returning immediately requires some additional work and new/additional API.
Reviewed By: mdvacca
Differential Revision: D10159457
fbshipit-source-id: bb23c7de105629ef086ae0b04667ff32c6ffb81d
Summary: With new `ShadowTree::getRootShadowNode()` method all access to rootShadowNode_ is protected by commit mutex.
Reviewed By: mdvacca
Differential Revision: D10159456
fbshipit-source-id: 0bc8676ca2564a8ef95d60e912356e99d9f172c1
Summary:
Calling `uninstall` synchnously was a bad idea. Unfortunatelly, even if it illuminate possible race condition during uninstallation, sometimes it deadlock.
It's not clear for now how to solve both problems without introducting another layer of indirection between UIManager and JSI.
Reviewed By: mdvacca
Differential Revision: D10081500
fbshipit-source-id: 90d8120603929a8219a3e606d8b3527e297b13ce
Summary: That's why we need the previous three diffs. Synchonous executor deadlocks if the beat is missing.
Reviewed By: sahrens
Differential Revision: D10081501
fbshipit-source-id: 9986d0a1844e642048b6f37a1fcb5f623a267663
Summary: In some cases we have to have a way to notify a EventBeat consumer that the beat cannot be (and will not be) delivered, so we introducing special API for that.
Reviewed By: mdvacca
Differential Revision: D10081503
fbshipit-source-id: 4c5a392d32572f426e3744bdba797efcd29b8cb4
Summary:
All code styles are terribly ugly. We have the only choise - choise something and embrace it.
This particular code style was borrowed from a neibour Fabric-friendly project because it follows established Facebook guides and respects client-side traditions.
Reviewed By: mdvacca
Differential Revision: D10218598
fbshipit-source-id: 8c4cf6713c07768566dadef479191661c79988f0
Summary: This diff unifies the 'handling' of the top prefix in the EventEmitter.cpp class
Reviewed By: shergin
Differential Revision: D10149497
fbshipit-source-id: d0ddbbbeefe3790b414b101da47582161354c971
Summary: This diff renames com.facebook.fbreact.fabric.UIManager to FabricUIManager, this is done in order to avoid confusion with com.facebook.react.bridge.UIManager
Reviewed By: shergin
Differential Revision: D10128635
fbshipit-source-id: 0cb874ec1ba698077d750214f1d25004065c2f59
Summary: This diff exposes the method EventEmitter.dispatchEvent as public in order to be able to access it from the android side.
Reviewed By: shergin
Differential Revision: D10127509
fbshipit-source-id: d6ddf59c654a91fdeed5fba867ca31d6de96d607
Summary: This change implements `onLayoutOnly` for regular bare <View> component (*not* for its descendants!) After this view flattening is actually starting working for all platforms.
Reviewed By: mdvacca
Differential Revision: D9511001
fbshipit-source-id: 3562dd1b7570a064150f100cc2e1bc4220b81290
Summary:
... instead of using direction access to `ygNode.getLayout()` object.
Suddenly, YGLayout object that YGNode exposes contains unresolved/directional-unaware styles. To get resolved directional-aware styles we have to use functions from Yoga.h.
I am not happy with this solution, I will try to implement something like `ygNode.getResolvedLayout()` and use that instead.
This change fixes strange missing horizontal padding around some views.
Reviewed By: mdvacca
Differential Revision: D10112049
fbshipit-source-id: 4b6ef39d8dd34e78a4592962e8af4eeaa5028768
Summary: That should save us some app size kilobytes.
Reviewed By: mdvacca
Differential Revision: D10081499
fbshipit-source-id: 2b950768c609b412f9be332c22b6b1e96657e5ea
Summary: We have to uninstall UIManager synchronously to avoid a race condition when JS is capable to call already deallocated UIManager.
Reviewed By: mdvacca
Differential Revision: D10033406
fbshipit-source-id: 194d1ae2dd5ab09b036b1c165de289ada8e66014
Summary:
There is no need to make JS calls to start or stop React Native apps; Scheduler does it automatically. Yay!
With this change (because we have to change Scheduler API) we are starting slow process migrating away from using term `reactRootTag` when we refer to running a ReactNative app (aka Surface). We will use `surfaceId` instead. We plan to slowly and gracefully retire `reactTag` term entity replacing it with several appropriate entities specific for particular usage, e.g. `viewId` (some id which makes sense for mounting), `surfaceId`, `nodeId` (unique id representing nodes which were cloned from the original one), or `eventTarget`.
Reviewed By: mdvacca
Differential Revision: D9999336
fbshipit-source-id: bbc7303c195b070b8c235c9ca35546d1dc693e98
Summary: This is the last step before making JSIUIManagerInstaller a direct dependency of UIManager (and making UIManager installation process completely seamless/platform-agnostic).
Reviewed By: mdvacca
Differential Revision: D9995781
fbshipit-source-id: 6f8c7177495b01ebaac1dbe330f49dce2e2a552c
Summary:
EventBeatBasedExecutor is an executor derived from EventBeat and using EventBeat to ensure proper threading.
Why do we need yet another executor? Because otherwise, we have to make it platform specific-dependency that each platform-specific implementation has to implement and provide. We already have all that we need in already provided EventBeat, so we can just convert that into simple executor in a platform-agnostic way.
Reviewed By: mdvacca
Differential Revision: D9995783
fbshipit-source-id: f8aa72a9744e50ebecbea9ad0e2546f41f5358f2
Summary: UIManager now can install and uninstall itself calling a functions that are provided as constructor arguments.
Reviewed By: mdvacca
Differential Revision: D9931329
fbshipit-source-id: b8d2d9925b0e2db0fed44bdf2e185d198fabd5ee
Summary: As it mentioned in the comment, we have to commit an empty tree as part of cleaning up Surface.
Reviewed By: mdvacca
Differential Revision: D9931320
fbshipit-source-id: 04e780bafdb917adeb89f2edef2dc0348b2a4d4a
Summary: This diff adds support for the ActivityIndicator component into the Android Fabric C++ implementation
Reviewed By: shergin
Differential Revision: D9781846
fbshipit-source-id: 952d72556983955875198ac3b7eece6868bc4ae8
Summary: This diff adds support for image views in Android
Reviewed By: shergin
Differential Revision: D9757712
fbshipit-source-id: 8d33e04c8ac4a670af6ca49bb3b9dccc69d52e40
Summary: This diff fixes the compilation error: "implicit instantiation of undefined template std::hash" when using TextAttributes in Android
Reviewed By: shergin
Differential Revision: D9849407
fbshipit-source-id: 7fcb94b1d4f7715d8037ecbf302d8f345e99e9fd