Commit Graph

15 Commits

Author SHA1 Message Date
Dark Knight 18b6e53c0b Revert D38280674: Multisect successfully blamed D38280674 for test or build failures
Summary:
This diff is reverting D38280674 (https://github.com/facebook/react-native/commit/a561df0e96da334a44e4e8b798c1be9e19fa1bc2)
D38280674 (https://github.com/facebook/react-native/commit/a561df0e96da334a44e4e8b798c1be9e19fa1bc2) has been identified to be causing the following test or build failures:
Tests affected:
- https://www.internalfb.com/intern/test/562950020230233/

Here's the Multisect link:
https://www.internalfb.com/intern/testinfra/multisect/1102425
Here are the tasks that are relevant to this breakage:
T93118125: [7 CRITICAL TEST FAILURES] 12 tests started failing for oncall marketplace_feed_experience in the last 2 weeks
We're generating a revert to back out the changes in this diff, please note the backout may land if someone accepts it.

 ---

Changelog:
[General][Changed] - Reverting "[react-native] Exit early if currentShadowNode cannot be casted" due to test failures

Differential Revision: D38338773

fbshipit-source-id: 0e0c11b1f5e27d98fdcfab34847a2fd0750ff5af
2022-08-02 00:11:58 -07:00
David Vacca a561df0e96 Exit early if currentShadowNode cannot be casted
Summary:
This diff fixes the bug T127619309 by exit early during calculateTransformedFrames if currentShadowNode cannot be casted

This is a bug that fired in fb4a but we didn't have a way to reproduce locally.
We are going to release this and enable feature flag with a MC

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D38280674

fbshipit-source-id: 1c42c17678d8473564e4075a78d3c688efed1a23
2022-08-01 13:57:36 -07:00
David Vacca 1e4ebf2531 Disable calculation of TransformedFrames in Layoutable ShadowNodex
Summary:
Calculation of TransformedFrames was a method introduced by D37994809 (https://github.com/facebook/react-native/commit/64528e5faa445907b8287b412c344f30c20fca61) to fix rendering of inverted flat lists.

We found that this operation is crashing in fb4a causing the UBN T127619309

This diff creates a feature flag to disable the calculation of TransformedFrames in Layoutable ShadowNodes. **The goal of this diff is to revert the behavior introduced by D37994809 (https://github.com/facebook/react-native/commit/64528e5faa445907b8287b412c344f30c20fca61)**

The featureFlag is disabled in fb4a and enabled in react AR (because ReactAr apps relies on the calculation of TransformedFrames and these apps are not affected)

The root cause of the bug will be fixed by D38280674 (which still requires more testing and investigation)

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D38286857

fbshipit-source-id: 721cd0554ae6a6b369b3f8dbb584160a270d0f18
2022-07-29 17:32:35 -07:00
Samuel Susla 64528e5faa Fix measure when view is inverted
Summary:
changelog: [internal]

Vertical and horizontal inversion was not taken into account in `computeRelativeLayoutMetrics`. To fix it, we precompute frames to include inversions.

Reviewed By: mdvacca

Differential Revision: D37994809

fbshipit-source-id: 043e6f19b6fa577f61fa3c739ce2d751ef973cc3
2022-07-21 03:34:56 -07:00
Samuel Susla 681ed402de Turning on clang tidy performance-*
Summary:
changelog: [internal]

Enable performance related clang tidy rules.

Reviewed By: javache

Differential Revision: D33350556

fbshipit-source-id: 486446ed0a1ac88af21b691ac6905b4f2359dafc
2022-01-05 05:53:13 -08:00
Andres Suarez 8bd3edec88 Update copyright headers from Facebook to Meta
Reviewed By: aaronabramov

Differential Revision: D33367752

fbshipit-source-id: 4ce94d184485e5ee0a62cf67ad2d3ba16e285c8f
2021-12-30 15:11:21 -08:00
Kevin Gozali fb39d45ed5 C++ - better => butter
Summary:
Renaming the `better` utilities to `butter`:
- to prevent claims that this library is superior to others - it really depends on use cases
- to indicate ease of use throughout the codebase, easily spread like butter

Changelog: [C++][Changed] Renaming C++ better util to butter, used by Fabric internals

Reviewed By: JoshuaGross

Differential Revision: D33242764

fbshipit-source-id: 26dc95d9597c61ce8e66708e44ed545e0fc5cff5
2021-12-20 22:25:14 -08:00
Joshua Gross d291a7efdd Allow disabling RTTI/exceptions for android builds; disable by default on Android
Summary:
For fbandroid builds only, disable RTTI and exceptions by default.

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D31632757

fbshipit-source-id: cfe0e43486df19fcaacc2b5b818b9d00ec2d427f
2021-10-19 17:17:30 -07:00
CodemodService FBSourceClangFormatLinterBot 8ca8f0cbe3 Daily arc lint --take CLANGFORMAT
Reviewed By: zertosh

Differential Revision: D29095479

fbshipit-source-id: a640a3c29125fb906e4c0b07dc60064249622185
2021-06-14 04:19:36 -07:00
Andrew Coates 050922a17e Remove usages of RTTI in places used by react-native-windows (#31694)
Summary:
Adding runtime type information adds greatly to the binary size, so react-native-windows builds without it.  But some parts of the fabric code currently uses dynamic_cast, which means to use fabric we have to build with RTTI turned on.  This PR removes the usages of dynamic_cast that are hit in release builds, which should allow react-native-windows to turn off RTTI in release builds.

Required for:  https://github.com/microsoft/react-native-windows/issues/7981

One thing to note, the comment in ShadowNodeTraits indicates that core was reserving the first 16 bits.  I'm adding two more.  Is that ok?  Should core be reserving more for future use?

## 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
-->

[Internal] [Fixed] - Remove uses of dynamic_cast in release builds

Pull Request resolved: https://github.com/facebook/react-native/pull/31694

Test Plan:
Verified that I can build react-native-windows with Fabric in release, without RTTI.
Boot / clicked around in RNW RNTester

Reviewed By: sammy-SC

Differential Revision: D29040383

Pulled By: JoshuaGross

fbshipit-source-id: e49286e59c4ba54faf0b4de5e244dfa1f7c3f193
2021-06-11 11:52:30 -07:00
Samuel Susla 369b3d2983 Remove unused methods from LayoutableShadowNode
Summary:
Changelog: [internal]

These methods were not used, removing them.

Reviewed By: shergin

Differential Revision: D25680765

fbshipit-source-id: 7e44aa5b9c4ffa9d0264b573dcb7edc2ad2a74c3
2020-12-23 04:45:54 -08:00
Samuel Susla 18f29db5a7 Fix ordering of children in LayoutableShadowNode::findNodeAtPoint
Summary:
Changelog: [internal]

`LayoutableShadowNode::findNodeAtPoint` was iterating children in incorrect order and wasn't taking zIndex into accout.

Reviewed By: JoshuaGross

Differential Revision: D23814866

fbshipit-source-id: 38eee297147a5c5912304d139bb10f8b16ae2ee1
2020-09-21 11:14:19 -07:00
Samuel Susla 154ce78972 Take viewport offset into account in UIManager.measureInWindow
Summary:
Changelog: [Internal]

Fabric's UIManager.measureInWindow didn't take viewport's offset into account. This diff fixes it by including viewport's offset in `LayoutContext`.

Reviewed By: JoshuaGross

Differential Revision: D23021903

fbshipit-source-id: 9106a8789d66fe19d8cb0a9378ee5bc8f2c83005
2020-08-10 12:52:23 -07:00
Samuel Susla 43b2c6dd85 Fix conditions to fire onLayout event
Summary:
Changelog: [Internal]

# Problem

## Step 1
JS clones a node that has size {100, 100} and changes props that cause the node to increase size to {200, 200}. JS holds pointer to this node.

Now, the size (stored in LayoutableShadowNode.layoutMetrics_) changes after Yoga layout is triggered.

However, the node gets cloned inside State Reconciliation before Yoga layout phase. The JS pointer points to a node with size {100, 100}, not to a node with size {200, 200}.

## Step 2

Again, JS clones node (with old reference, therefore gets old layoutMetrics_ with size {100, 100}) and it changes props that cause the node to decrease its size back to {100, 100}.
We go all the way to Yoga layout and looking for nodes that have been affected by the node. The node, affected by the layout because it went from {200, 200} to {100, 100}, will be evaluated as not affected. This causes onLayout event to not be fired.

# Fix
We can safely remove the frame equality check (please see below). This can be done because we already check for equality before dispatching onLayout. It happens here:

https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/components/view/ViewEventEmitter.cpp?commit=881853eb0c42625fd0812bd2652bf36fcbd614ee&lines=43

As far as I know, `affectedNodes` isn't used for anything else besides dispatching onLayout.

# Discussion

This problem manifests itself only when a node has two different sizes that it flips between. To better understand this, please watch the video in Test plan labelled "before". Notice how the text has 2 different values that it flips between.

Here is a code that was affected by it https://fburl.com/diffusion/3hwo0iy5
If you inspect it closely, you will notice that it depends on `onLayout` to return correct value to calculate offset from left.

Reviewed By: JoshuaGross

Differential Revision: D22999891

fbshipit-source-id: e2d0f5771c1bf3cd788e5e9da0155c92e33fb84e
2020-08-10 05:11:29 -07:00
David Vacca 1ae76bf0dd Remove inner folders of react/renderer/core
Summary:
This diff removes the inner folder of react/renderer/core, moving all its files into react/renderer/core

This is necessary to simplify the compilation of Fabric in OSS

More details: https://fb.quip.com/amaRA631DX3K

changelog: [internal] Internal

Reviewed By: fkgozali, JoshuaGross

Differential Revision: D22875854

fbshipit-source-id: e2d969c3ec67eab1bbdc9288e5a4285c740fa944
2020-08-01 13:31:03 -07:00