Commit Graph

15 Commits

Author SHA1 Message Date
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
Samuel Susla bcc4ab35da Remove use of TextLayoutManager::Shared and SharedTextLayoutManager
Summary:
changelog: [internal]

For some reason, using `TextLayoutManager::Shared` in `TextInputShadowNode` trips up clang tidy linter. We have a plan to move away from `*::Shared` anyway, so let's remove it from `TextInputShadowNode` now.

Why do we want to move away from `*::Shared`?
Using `TextLayoutManager::Shared` is confusing for people unfamiliar with Fabric's codebase. It expresses a concept of immutability but uses term `shared`. Term shared is already used in C++  `std::shared_ptr`.

Reviewed By: fkgozali

Differential Revision: D33186422

fbshipit-source-id: 10ee588735997f5fedc372a1d1e3d9cd9684178a
2021-12-22 04:20:42 -08:00
Andrew Coates 4d87d8c6b2 Fix various c++ warnings (#31399)
Summary:
react-native-windows runs with a more strict set of warnings as errors.  This fixes a bunch of warnings being hit while compiling core react-native code as part of react-native-windows.  In particular warnings about mismatched signed/unsigned comparisons, lossy conversions, and variable names that conflict with names in outer scopes (yoga has a global for `leading` and `trailing` that conflicts with some local variable names)

## Changelog

[Internal] [Fixed] - Fix various C++ warnings

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

Test Plan: I've run these changes in react-native-windows. -- Shouldn't have any functionality difference.

Reviewed By: sammy-SC

Differential Revision: D28290188

Pulled By: rozele

fbshipit-source-id: 2f7cf87f58d73a3f43510ac888dbcb9ab177d134
2021-05-12 12:35:33 -07:00
Samuel Susla 79090c4802 Fabric: Decoupling Telemetry aggregation classes into a separate module
Summary:
We need to do this to break a dependency cycle that would happen if we try to have `view` depend on `mounting` just to add some telemetry to `view`.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: mdvacca

Differential Revision: D26827446

fbshipit-source-id: 4c415ebf5be3a02c18c80ea8a4a77068cae0f0fe
2021-03-29 05:12:42 -07:00
Joshua Gross 70608eed1e Clean up Paragraph Cxx/iOS code after D27238439
Summary:
In my haste to get out D27238439 (https://github.com/facebook/react-native/commit/aca0f418baf4890b8be3c1214be70819e4b88a95), parts of it are sloppy. Nothing critical and no known bugs, but we should clean up the commented code, and add back these asserts.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D27266288

fbshipit-source-id: f242c26401dfc8851cb1ee0ef8911d19d9c1d9ae
2021-03-23 15:02:50 -07:00
Joshua Gross aca0f418ba Change State references to TextLayoutManager to a weak_ptr (ParagraphState)
Summary:
TextLayoutManager indirectly holds ShadowNodes, which could hold onto TextLayoutManager via a shared_ptr; so we probably have some reference cycles here.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D27238439

fbshipit-source-id: b0b65cc451891e75bafddb7a08aa34ddf86d6a35
2021-03-22 19:29:32 -07:00
Valentin Shergin 60f15d6b5d Tracking time spent on measuring text in TransactionTelemetry
Summary:
Now we not only measure how many times we measured text but also measure how much time it takes. This way we can see which portion of the layout process is spent by layout itself (and measuring embedded components).

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: mdvacca

Differential Revision: D26827447

fbshipit-source-id: e0b09fcacc86aed50dd94b48458215adbb0a60ef
2021-03-11 14:34:22 -08:00
Joshua Gross b3930f935f Convert most Fabric Cxx code to use react_native_assert instead of assert
Summary:
See react_native_assert.{h,cpp}. Because of the BUCK+Android issue where NDEBUG is always defined, we use react_native_assert instead of assert to enable xplat asserts in debug/dev mode.

This migrates most of the codebase, but probably not 100%. The goal is to increase assertion coverage on Android, not to get to 100% (yet).

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D26562866

fbshipit-source-id: a7bf2055b973e1d3650ed8d68a6d02d556604af9
2021-02-19 20:52:52 -08:00
Andres Suarez 0f4f917663 Apply clang-format update fixes
Reviewed By: igorsugak

Differential Revision: D25861683

fbshipit-source-id: 616afca13ae64c76421053ce49286035e0687e36
2021-01-09 22:11:00 -08:00
Samuel Susla c1af56df71 Wire call from C++ to Java to get lines measurements
Summary: Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D23782998

fbshipit-source-id: fa9bda274c024d5bbd3ca24f394b5d76f8c07ad2
2020-09-22 01:53:24 -07:00
Samuel Susla 412fc7d324 Prevent calling onTextLayout with the same value
Summary:
Changelog: [internal]

In D23648430 (https://github.com/facebook/react-native/commit/a315e4cd30e4b8da841f587650146a62c868f67d) I made a mistake. I prevented calling `onTextLayout` unless there are attachments in the component. It fixed the problem because I unintentionally prevented `onTextLayout`  to be called. Therefore, changes from D23648430 (https://github.com/facebook/react-native/commit/a315e4cd30e4b8da841f587650146a62c868f67d) need to be reverted.

To prevent infinite loop in `onTextLayout`, ParagraphEventEmitter checks if `linesMeasurements` have changed before dispatching it to JS.

Reviewed By: shergin

Differential Revision: D23782717

fbshipit-source-id: 0e84ae4f46d79ce0cf4c7340cd32be6f562ae179
2020-09-20 08:18:55 -07:00
Samuel Susla a315e4cd30 Prevent an infinite loop in Text.onTextLayout
Summary:
Changelog: [internal]

# Problem
onTextLayout was called even if there was no change to text layout. This can cause an infinite loop with onTextLayout triggering commit which triggers onTextLayout.

# Fix
Do not call onTextLayout if there is nothing to layout.

Reviewed By: yungsters

Differential Revision: D23648430

fbshipit-source-id: 055dc34a9aca0edf2c78a5812b35b80df32c9e3e
2020-09-11 11:37:29 -07:00
Valentin Shergin bc3251c6a5 Fabric: MountingTelemetry renamed to TransactionTelemetry
Summary:
Just renaming, nothing more.
The idea of MountingTelemetry already grown to something bigger than just mounting telemetry, so we are renaming it.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: mdvacca

Differential Revision: D23374947

fbshipit-source-id: f60ce38b75d1ce77498b84688e59598314c69a78
2020-08-28 10:22:41 -07:00
Valentin Shergin dfa25df2cf Fabric: Counting number of text measuments as part of MountingTelemetry
Summary:
With this change, we now collect the number of text measurements that we perform during the layout phase of the commit. Text measurements are the most expensive layout operations which pretty much responsible for the vast majority of time spent in the layout phase.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: mdvacca

Differential Revision: D23364664

fbshipit-source-id: 19514b93166b4053c2f3be37e79507f2c5248000
2020-08-27 12:33:58 -07:00
David Vacca 2d8fe89784 Move Text C++ out of inner folders
Summary:
This diff flattens the hierarchy of Text C++ files.
This is required to integrate Text into RN OSS

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D23173556

fbshipit-source-id: ce90000cae147460aa4ddad55b7c90369fa734a2
2020-08-18 19:55:50 -07:00