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

3454 Коммитов

Автор SHA1 Сообщение Дата
John Porto b467094f18 Add StringPrimitive::create for UTF8 strings
Summary:
This is pre-work for adding the v8 stack trace API support.

Changelog: [Internal]

Reviewed By: kodafb

Differential Revision: D34048366

fbshipit-source-id: 9d2b469767f7669cb428c61b215f193894892c03
2022-02-10 05:00:32 -08:00
Chiara Mooney 42b391775f Fix ReactCommon Break for Windows (#33047)
Summary:
Changes to MapBuffer code in aaff15c...d287598 broke build for Windows. Errors included incompatible type conversions, the use of `__attribute__(__packed__)` which is only supported by GCC and Clang, and the usage of designated initializers which are only supported on C++20.

Changes here restore build on Windows.

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

[General] [Fixed] - Fix build break on Windows with ReactCommon

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

Test Plan: React Native project built on Windows and passes react-native-windows repository pipeline. These edits are currently merged into the main branch of react-native-windows.

Reviewed By: ShikaSD

Differential Revision: D34101367

Pulled By: philIip

fbshipit-source-id: 1596365c2e92f377c6375805b33de5e1c7b78e66
2022-02-09 13:03:10 -08:00
Andrei Shikov 3112238b14 De-duplicate conversion of SharedColor to Android int value
Summary:
Removes duplicated code in SharedColor conversions. The original copy was done for the MapBuffer experiment, as the method was returning `folly::dynamic` instead of integer. Nothing prevents us from returning integer here directly, so we can keep one implementation.

Changelog: [Internal] - Removed duplicated SharedColor conversion for Android

Reviewed By: javache

Differential Revision: D33797490

fbshipit-source-id: 196657f0616e6cb7e987225b76328fe77fd6c28a
2022-02-09 10:26:30 -08:00
Pieter De Baets a75bbe7552 Fix docs in ModalHostView headers
Summary:
Copy-paste error

Changelog: [Internal]

Reviewed By: genkikondo

Differential Revision: D34077530

fbshipit-source-id: 04ab17ba9308762361d993b7ed1b372af400b8d1
2022-02-09 03:03:09 -08:00
CodemodService FBSourceClangFormatLinterBot e737270d11 Daily `arc lint --take CLANGFORMAT`
Reviewed By: zertosh

Differential Revision: D34099214

fbshipit-source-id: 7a1fc8550968d8b87f016e4bf706252bf03e4483
2022-02-08 19:15:34 -08:00
Neil Dhar 5b66bb90c6 Add missing symbol handling in kindToString
Summary: Changelog: [Internal]

Reviewed By: kodafb

Differential Revision: D34062869

fbshipit-source-id: 08fed59d62b0d0a46e0868874a89b125731a44e5
2022-02-08 15:18:15 -08:00
Raphael Herouart 669cd0257c Test Chrome DevTools Notifications
Summary:
Some test to make sure hermes engine follows the Chrome DevTools Protocol for all implemented Debugger Notifications
Changelog: [Internal]

Reviewed By: ShikaSD

Differential Revision: D34055503

fbshipit-source-id: 8c2dd1066ba2b68e395226f15954d303894d0365
2022-02-08 06:46:31 -08:00
Raphael Herouart 921ed737eb Test Chrome DevTools Protocol Responses Format
Summary:
Some test to make sure hermes engine follows the Chrome DevTools Protocol for all implemented Debugger Responses
Changelog: [Internal]

Reviewed By: ShikaSD

Differential Revision: D34052619

fbshipit-source-id: d213ed41335b64bf3168a43ce043f2c57f05fc52
2022-02-08 06:46:30 -08:00
Samuel Susla d79f658016 Rename RuntimeScheduler::callImmediates to RuntimeScheduelr::callExpiredTasks
Summary:
changelog: [internal]

Rename method so it does not collide with immediates that already exist in React Native.

Reviewed By: javache

Differential Revision: D34041418

fbshipit-source-id: 0ae75b683983c3be50320b195a7068d7178b0ed8
2022-02-07 10:06:07 -08:00
Raphael Herouart 31a92b008d Add some tests for compliance to the Chrome DevTools Protocol
Summary:
Some test to make sure hermes engine follows the Chrome DevTools Protocol for all implemented Debugger Messages

Changelog: [Internal]

Reviewed By: ShikaSD

Differential Revision: D34042008

fbshipit-source-id: 3a074e9840706ca977ff86d050e67b0dcea5c7ef
2022-02-07 09:06:31 -08:00
Samuel Susla ee454e4f0b Add description to ConcreteComponentDescriptor::adopt
Summary: changelog: [internal]

Reviewed By: javache

Differential Revision: D34041312

fbshipit-source-id: 3b6d650034481813273f67444426e2fa5cb7d59f
2022-02-07 09:03:56 -08:00
Andrei Shikov 2bc883e6b7 Back out "Implement Runtime.getHeapUsage for hermes chrome inspector"
Summary:
The new messages are breaking SparkAR VSCode debugger
Original commit changeset: 49d863e6a58d
Original Phabricator Diff: D33616658 (3568a72987)
Changelog: [Internal]

Reviewed By: the-over-ape

Differential Revision: D34003669

fbshipit-source-id: 5327820cda60d5f58521da56e2e1f5d824bf861d
2022-02-04 07:20:31 -08:00
Samuel Susla 5e933fdd2a Yield for each access to the runtime
Summary:
changelog: [internal]

With multiple requests to the runtime, we need to make sure they are all granted before React continues with rendering. A boolean is not enough to track this. The first lambda that has VM will set it to false and subsequent requests will have to wait for React to finish rendering.

To prevent this, we can count how many lambdas are pending access to the runtime.

Reviewed By: ShikaSD

Differential Revision: D33792734

fbshipit-source-id: f785fae3575470179dd69acc6a466211b79b633b
2022-02-03 10:20:33 -08:00
Samuel Susla 491c4231db Pass raw ShadowNode instead of shared_ptr
Summary:
changelog: [internal]

pass raw ShadowNode instead of shared_ptr. Ownership is not transferred, shared_ptr is misleading.

Reviewed By: javache

Differential Revision: D33917010

fbshipit-source-id: 4d9fdd4b4e0376149f1719ad160b957de4afdce3
2022-02-03 04:30:10 -08:00
Janic Duplessis 3568a72987 Implement Runtime.getHeapUsage for hermes chrome inspector (#32895)
Summary:
I was looking at the hermes chrome devtools integration and noticed requests to `Runtime.getHeapUsage` which was not implemented. When implemented it will show a summary of memory usage of the javascript instance in devtools.

<img width="325" alt="image" src="https://user-images.githubusercontent.com/2677334/149637113-e1d95d26-9e26-46c2-9be6-47d22284f15f.png">

## Changelog

[General] [Added] - Implement Runtime.getHeapUsage for hermes chrome inspector

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

Test Plan:
Before

<img width="912" alt="image" src="https://user-images.githubusercontent.com/2677334/149637073-15f4e1fa-8183-42dc-8673-d4371731415c.png">

After

<img width="1076" alt="image" src="https://user-images.githubusercontent.com/2677334/149637085-579dee8f-5efb-4658-b0a8-2400bd119924.png">

Reviewed By: christophpurrer

Differential Revision: D33616658

Pulled By: ShikaSD

fbshipit-source-id: 49d863e6a58d4a92d4c86f9a288ac33ed8d2cb0d
2022-02-02 10:37:06 -08:00
John Porto eb08af57a9 Implement Runtime.callFunctionOn
Summary:
[Hermes][Inspector] Implement the CDP API for calling a function on an object.

Changelog: [Internal]

Reviewed By: avp

Differential Revision: D33722301

fbshipit-source-id: da26e865cf29920be77c5c602dde1b443b4c64da
2022-02-01 16:50:14 -08:00
Felipe Perez 3552ff0562 Back out "Delete RuntimeScheduler yielding mobile config"
Summary:
D33740360 (16ed62a850) broke Explore VR on React Native. The app would go into a loop on boot and not finish mounting. This is probably a product code issue, but it's not a trivial issue to solve. Unlanding to unblock the RN migration.

Changelog:

[internal] internal

Reviewed By: mdvacca

Differential Revision: D33918026

fbshipit-source-id: cc77c70ece9994d82c91f7ae8783e959629e9cfb
2022-02-01 15:17:14 -08:00
Samuel Susla 6351064b75 Introduce RuntimeScheduler::callImmediates
Summary:
changelog: [internal]

React on web uses microtasks to schedule a synchronous update for discrete event. Microtasks are not yet available in React Native and as a fallback, React uses native scheduler and task with immediate priority. Until Microtasks are in place, React Native needs to make sure all immediate tasks are executed after it dispatches each event.

I tried to stay as close to [microtask standard](https://developer.mozilla.org/en-US/docs/Web/API/queueMicrotask) as I reasonably could.

Once microtasks on RN are shipped, this code can be removed.

Reviewed By: mdvacca

Differential Revision: D33742583

fbshipit-source-id: eddebb1bd5131ee056252faad48327a70de78a4a
2022-01-28 16:35:18 -08:00
John Porto d2f5044c37 Catch exceptions thrown by user callbacks
Summary:
Calls to Inspector::evaluate() and Inspector::executeIfEnabled()
take a user-provided callback which are not try-guarded. This
means that, should the user code throw, the inspector's process
will likely die due to the unhandled exception. This change
makes sure that, if the user provided callback throws, then
the promise attached to those methods will be fulfilled by
an exception.

Change: [internal]

Reviewed By: avp

Differential Revision: D33852073

fbshipit-source-id: 7fbb6662b28d393a5d5b494c004aa9521e23ebb6
2022-01-28 13:38:27 -08:00
Xin Chen 8aa87814f6 Consider transform when calculating overflowInset values
Summary:
The fix in this diff seems simple, but it took some time to understand why this change fixed the issue that views animated use native driver out from their parent's layout are not getting touch events.

We introduced `overflowInset` to RN Android a while back to give each shadow node extra information to cover all its children's layout. These values (left, top, right, bottom extensions from the view's own layout) help us improve hit-testing algorithm used in touch events. We could ignore all subtrees that the touch point not in their parent's overflowInset box.

However, this was not working for native animation. When `userNativeDriver` is on, all animation happens without Fabric knows anything about them. The overflowInset is out of date with the final animated layout, which caused the issue that we ignored the animated view as we thought it's not under the pointer.

Here is a playground demo (P476407654) for the issue:

https://pxl.cl/1XfPL

We've tried to fix this by passing the final animated values via `passthroughAnimatedPropExplicitValues` added in D32539976. This is a prop that will get merged into `style` prop for [animation component](https://fburl.com/code/jybzfgu5). The transform values were already applied when measuring layout in [Pressability](https://fburl.com/code/5mect2k3), which uses [LayoutableShadowNode](https://fburl.com/code/qh8fufrw). However, this is not the case for overflowInset calculation. Hence, the fix here is to apply the transform matrix in Yoga before calculating the overflowInset.

Changelog:
[Android][Fixed] - Fix overflowInset calculation by using transform values

Reviewed By: ShikaSD

Differential Revision: D33806030

fbshipit-source-id: e438618e3d6e5b0333cff9ff9919b841d73b2e9d
2022-01-28 10:37:34 -08:00
David Vacca 4b7face721 Move pointerEvents from formsStacking -> formsView
Summary:
This was a bug, we are fixing it.

Move pointerEvents from formsStacking -> formsView and we are also removing "onLayout" from formsStackingContext

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D33846660

fbshipit-source-id: 6b65a9a7815972e34dafbc48b3d732d9b02d5e9f
2022-01-28 09:30:17 -08:00
Pieter De Baets 20b9ed91c0 Remove FBREMAP experiment
Summary:
The flag was removed in https://www.internalfb.com/diff/D28467996 (2c5f68df46) but the code was not removed yet.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D33792884

fbshipit-source-id: 0ae5d904ca2ca94437ca63b495d41e47585fde33
2022-01-27 12:02:19 -08:00
Pieter De Baets 86fa2a5106 Emit warning when dispatching event to null target
Reviewed By: ShikaSD

Differential Revision: D33767454

fbshipit-source-id: c2f10b6b857544c06780fb13b66417d12f9b8d2c
2022-01-26 11:24:32 -08:00
Samuel Susla b856465e3a Add missing header and initialisation in RuntimeSchedulerTest
Summary: changelog: [internal]

Reviewed By: ShikaSD

Differential Revision: D33789519

fbshipit-source-id: 395c0cc7ddd1d63fbe57efb8f3212e5f5647e2bd
2022-01-26 09:23:08 -08:00
Samuel Susla 9bf533e6b8 Remove shared_ptr from RuntimeScheduler::cancelTask interface and add comments
Summary:
Changelog: [internal]

Add comments and avoid using shared_ptr unnecessarily.

Why note shared_ptr? Using shared_ptr suggests we are transferring ownership of object, which we are not.

Reviewed By: javache

Differential Revision: D33741836

fbshipit-source-id: 56ebb098e6185793f05e2bb587005bb0f093c0c9
2022-01-26 09:23:08 -08:00
Samuel Susla 16ed62a850 Delete RuntimeScheduler yielding mobile config
Summary:
changelog: [internal]

Yielding in RuntimeScheduler is shipped. This diff removes the gating around it.

Reviewed By: sshic

Differential Revision: D33740360

fbshipit-source-id: 267372e81e66dda96e451435954a7c3546cc6fbe
2022-01-26 09:23:08 -08:00
Andrei Shikov 3c86e82a02 Namespace MapBuffer structs and typealiases by moving them into class
Summary:
Refactors MapBuffer-related `primitives.h` to be namespaced with `MapBuffer` class, to avoid name collisions and confusion later on.
Most of the size constants are moved to relevant .cpp files or updated to use `sizeof`.

Additionally, adds a little bit of documentation about `MapBuffer` serialization format.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D33662487

fbshipit-source-id: 5a7a2b1c7f2bb13ee1edfc5fae51ba88c34f0d3c
2022-01-20 12:57:22 -08:00
Andrei Shikov adb2167640 Serialize and assert type information in mapbuffer
Summary:
Serializes type information along with key/value in MapBuffer, asserting the data type on Java side during read. At the moment, accessing value with incorrect will result in a crash.

Other changes:
Adds a `getType` method to verify types before accessing them.
Removes `null` as a type, as just not inserting value and checking for its existence with `hasKey` is more optimal.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D33656841

fbshipit-source-id: 23a78daa0d84704aab141088b5dfe881e9609472
2022-01-20 12:57:22 -08:00
Andrei Shikov d287598d23 Allow random stores and accesses to MapBuffer values
Summary:
Removes the need to store keys in incremental order by sorting them after before inserting into MapBuffer.
Updates MapBuffer to support random access on C++ side, actually retrieving values by keys and not bucket index.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D33611758

fbshipit-source-id: c81e970613c8ecc688bfacb29ba038bf081a0c0f
2022-01-20 12:57:22 -08:00
Andrei Shikov b173bf3c0e Minor MapBuffer renames for consistency
Summary:
Rename `_header` to `header_` to align with the C++ naming scheme we use.
Rename `readKey` to `readUnsignedShort` as purpose of the method have changed.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D33637127

fbshipit-source-id: a82f4d6c1b753b21e0567fbe919af98e4c78105d
2022-01-18 18:00:07 -08:00
Andrei Shikov c338fff521 Cast MapBuffer bytes to struct to read header
Summary:
The struct is copied directly to the buffer, so it is safe to read it back.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D33624036

fbshipit-source-id: 7ee2b28b815690ab471832c0c622a075b5dd7d78
2022-01-18 08:04:54 -08:00
Andrei Shikov 5b489d5f95 Use vector for dynamic data in MapBufferBuilder
Summary:
Replaces dynamic manually managed array with a vector of bytes, removing the need for managing memory manually.

This approach is a little bit slower than before, as vector is allocating memory more conservatively. This can be improved in the future by providing an estimate for the data size.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D33611759

fbshipit-source-id: a0e5e57c4e413206a9f891cd5630ecc9088a9bf7
2022-01-17 13:15:49 -08:00
Andrei Shikov b1ef4405ee Use struct for building mapbuffer buckets
Summary:
Instead of copying integer values into key/value data array, this implementation keeps a structured vector of `Bucket` structs (which is sized to be serialized later).

This approach provides multiple benefits to modify and access buckets (e.g. sort them based on the key, allowing for out of order inserts (D33611758))

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D33601231

fbshipit-source-id: 62ace1374936cb504836d6eae672e909ea404e3f
2022-01-17 13:15:49 -08:00
Andrei Shikov 0b48ef7ca8 Add more complex perf test for the mapbuffer
Summary:
Benchmarks performance/correctness of mapbuffer with several different types of data

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D33608299

fbshipit-source-id: 81b1e195aecac60ad1cc3ca416d1cf7b09feab32
2022-01-16 23:07:40 -08:00
Andrei Shikov ea712f825a Use reference when copying strings into mapbuffer
Summary:
This method can produce unnecessary copy of the string, replacing it with reference to optimize.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D33607765

fbshipit-source-id: e04eddffec063c0c8e173bfdf690e7b8e1050525
2022-01-16 23:07:40 -08:00
Andrei Shikov f33892081a Cleanup ReadableMapBuffer
Summary:
Cleans up `ReadableMapBuffer` APIs and migrates to use `std::vector` instead of raw pointer array.

Also uses `fbjni` utility to allocate the bytes instead of making manual JNI calls.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D33513027

fbshipit-source-id: afe7d320d12830503de4c9994117d849f0b25245
2022-01-12 08:13:32 -08:00
Andrei Shikov aaff15c2c8 Use std::vector to manage MapBuffer storage
Summary:
Replaces raw array pointer inside `MapBuffer` with `std::vector`, which is more conventional "safer" way of storing dynamically sized arrays.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D33512115

fbshipit-source-id: d875a2240f7938fd35c4c3ae0e7e91dc7456ff32
2022-01-12 08:13:32 -08:00
Moses DeJong 5baf6875f7 TurboModules: use weakSelf for block sent to main thread
Summary:
TurboModules: use weakSelf for block sent to main thread.

Changelog:
[iOS][Fixed] - Use weakSelf in objc block instead of self.

Reviewed By: RSNara

Differential Revision: D33488938

fbshipit-source-id: d03c98fb59fbd1fc4b67686251ebec541e5d3e6c
2022-01-11 23:21:51 -08:00
Samuel Susla bdd25ed6a3 Clean up ShadowTree::progressState
Summary:
changelog: [internal]

Use std::vector access operator without bounds checking.

Trying to resolve T108113554 and discovered this inefficiency.

Reviewed By: mdvacca

Differential Revision: D33349619

fbshipit-source-id: e9000a054ba9e7e6835105b7558dbf1a9a04deff
2022-01-05 09:10:06 -08: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
Samuel Susla d639fe1f3d Make iterators const in LayoutAnimationKeyFrameManager
Summary:
changelog: [internal]

Just making more stuff const.

Reviewed By: mdvacca

Differential Revision: D33254016

fbshipit-source-id: 9a170b025c065845432933bd851148599124b525
2022-01-04 11:42:16 -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
Samuel Susla 8c6a98400e Introduce TextInput.onChangeSync
Summary:
changelog: [internal]

Add experimental `TextInput.onChangeSync` which delivers onChange event synchronously.

Reviewed By: ShikaSD

Differential Revision: D33188083

fbshipit-source-id: 1e1dcd0d71c7eec98d3d5f69967659e07ac4e6a6
2021-12-30 06:38:50 -08:00
Samuel Susla f85273d484 Enable modernize-use-transparent-functors clang tidy rule
Summary:
changelog: [internal]

You can read more about this rule on https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-transparent-functors.html

Reviewed By: rubennorte

Differential Revision: D33297509

fbshipit-source-id: 4b5c38e6fe0eab9aa39131f0200cf9c5654ec19f
2021-12-23 10:21:10 -08:00
Samuel Susla b76a488199 Enable modernize-use-using clang tidy rule
Summary:
changelog: [internal]

You can read more about this rule on https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-using.html

Reviewed By: rubennorte

Differential Revision: D33297576

fbshipit-source-id: 1124c410f0b950b0eb37e1b0e950ba9e76925dce
2021-12-23 10:21:10 -08:00
Samuel Susla 8d9101e578 Enable modernize-use-override clang tidy rule
Summary:
changelog: [internal]

You can read more about this on https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-override.html

Reviewed By: rubennorte

Differential Revision: D33297524

fbshipit-source-id: 259aa6f0b3ceb0ef065497199f72760449634ffc
2021-12-23 10:21:10 -08:00
Samuel Susla 1d0495e0a2 Enable modernize-use-equals-delete clang tidy rule
Summary:
changelog: [internal]

You can read more about this rule on https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-equals-delete.html

Reviewed By: rubennorte

Differential Revision: D33296068

fbshipit-source-id: 72e7ae199da39527476494729b1ab862e7e989e4
2021-12-23 10:21:10 -08:00
Samuel Susla 76af846c1d Enable modernize-use-noexcept clang tidy rule
Summary:
changelog: [internal]

You can read more about this rule on https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-noexcept.html

Reviewed By: rubennorte

Differential Revision: D33296107

fbshipit-source-id: 5a27b3e1c9e2da71a0eee149f25d9d70ca83b443
2021-12-23 10:21:10 -08:00
Samuel Susla 52b7828cdc Enable modernize-use-default-member-init clang tidy rule
Summary:
changelog: [internal]

You can read more about this rule on https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-default-member-init.html

Reviewed By: rubennorte

Differential Revision: D33296545

fbshipit-source-id: e6813542b76e50db0a4b3ae9fdfafde2dbd8ac5b
2021-12-23 10:21:10 -08:00
Samuel Susla d8d4e95697 Enable modernize-use-nullptr clang tidy rule
Summary:
changelog: [internal]

You can read more about this rule on https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html

Reviewed By: rubennorte

Differential Revision: D33296118

fbshipit-source-id: ba9de4611c0f0459db9cea56722385e2541b155e
2021-12-23 10:21:09 -08:00
Samuel Susla bf9872a7b5 Enable modernize-use-equals-default clang tidy rule
Summary:
changelog: [internal]

You can read more about this rule on https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-equals-default.html

Reviewed By: rubennorte

Differential Revision: D33295116

fbshipit-source-id: d7da62c35e141fc2bf5a83c28f80f4f8d355c4cb
2021-12-23 10:21:09 -08:00
Samuel Susla 1251b2f993 Enable modernize-shrink-to-fix clang tidy rule
Summary:
changelog: [internal]

You can read more about this rule on https://clang.llvm.org/extra/clang-tidy/checks/modernize-shrink-to-fit.html

Reviewed By: rubennorte

Differential Revision: D33280814

fbshipit-source-id: f7b17e57b540cf4461dca1f3fa266b02f24ce455
2021-12-23 10:21:09 -08:00
Samuel Susla 9c5518f77e Enable modernize-use-emplace clang tidy rule
Summary:
changelog: [internal]

You can read more about this rule on https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-emplace.html

Reviewed By: rubennorte

Differential Revision: D33295156

fbshipit-source-id: 91a7bd34d689506ea9a68462b050c41fdb3faa4e
2021-12-23 10:21:09 -08:00
Samuel Susla 6c7581c6b3 Enable modernize-unary-static-assert clang tidy rule
Summary:
changelog: [internal]

You can read more about this rule on https://clang.llvm.org/extra/clang-tidy/checks/modernize-unary-static-assert.html#:~:text=The%20check%20diagnoses%20any%20static_assert,%2B%2B17%20and%20later%20code.

Reviewed By: rubennorte

Differential Revision: D33281759

fbshipit-source-id: 0399229947dce5f9297c4f65567b299dc0dca7ba
2021-12-23 10:21:09 -08:00
Samuel Susla b9cbd5a104 Enable modernize-replace-random-shuffle clang tidy rule
Summary:
changelog: [internal]

You can read more about this rule on https://clang.llvm.org/extra/clang-tidy/checks/modernize-replace-random-shuffle.html

Reviewed By: rubennorte

Differential Revision: D33279255

fbshipit-source-id: 0802cbafee448cfd5eed7f866a44ae3f3c5eb0fd
2021-12-23 10:21:09 -08:00
Samuel Susla 9419bebb98 Enable modernize-use-bool-literals clang tidy rule
Summary:
changelog: [internal]

You can read more about this rule on https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-bool-literals.html

Reviewed By: feedthejim

Differential Revision: D33295106

fbshipit-source-id: 34e68153a6796d5b9120166aeca6461ae0936e1e
2021-12-23 07:53:50 -08:00
Samuel Susla 474682dab7 Enable modernize-replace-auto-ptr clang tidy rule
Summary:
changelog: [internal]

You can read more about this rule on https://clang.llvm.org/extra/clang-tidy/checks/modernize-replace-auto-ptr.html

Reviewed By: fkgozali

Differential Revision: D33279163

fbshipit-source-id: b04c7fb4ff4caa0320c312ae187a7bcfe42cb3d3
2021-12-23 07:53:49 -08:00
Samuel Susla 028fb20e4b Enable modernize-raw-string-literal clang tidy rule
Summary:
changelog: [internal]

You can read more about this rule on https://clang.llvm.org/extra/clang-tidy/checks/modernize-raw-string-literal.html

Reviewed By: fkgozali

Differential Revision: D33277859

fbshipit-source-id: 2a1c980f72fee36451cc84ee0255c2e90a8f810a
2021-12-23 07:53:49 -08:00
Samuel Susla 5fa6c5a941 Enable modernize-pass-by-value clang tidy rule
Summary:
changelog: [internal]

You can read more about this rule on https://clang.llvm.org/extra/clang-tidy/checks/modernize-pass-by-value.html

# Isn't it wasteful to copy? Isn't reference more efficient?

This rule of thumb is no longer true since C++11 with move semantics. Let's look at some examples.

# Option one

```
class TextHolder
{
public:
   TextBox(std::string const &text) : text_(text) {}
private:
   std::string text_;
};
```

By using reference here, we prevent the caller from using rvalue to and avoiding copy. Regardless of what the caller passes in, copy always happens.

# Option two

```
class TextHolder
{
public:
   TextBox(std::string const &text) : text_(text) {}
   TextBox(std::string &&text) : text_(std::move(text)) {}
private:
   std::string text_;
};
```
Here, we provide two constructors, one for const reference and one for rvalue reference. This gives the caller option to avoid copy. But now we have two constructors, which is not ideal.

# Option three (what we do in this diff)

```
class TextHolder
{
public:
   TextBox(std::string text) : text_(std::move(text)) {}
private:
   std::string text_;
};
```
Here, the caller has option to avoid copy and we only have single constructor.

Reviewed By: fkgozali, JoshuaGross

Differential Revision: D33276841

fbshipit-source-id: 619d5123d2e28937b22874650366629f24f20a63
2021-12-23 07:53:48 -08:00
Samuel Susla 70b346fb9c Enable modernize-make-unique clang tidy rule
Summary:
changelog: [internal]

You can read more about this rule on https://clang.llvm.org/extra/clang-tidy/checks/modernize-make-unique.html

Reviewed By: feedthejim

Differential Revision: D33255905

fbshipit-source-id: a0c354dec37515db11633fb039de09bc97d6c228
2021-12-23 05:53:31 -08:00
Samuel Susla 6d1d2fe2b8 Enable modernize-use-auto clang tidy rule
Summary:
changelog: [internal]

You can read more about this rule on https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-auto.html

Reviewed By: mdvacca

Differential Revision: D33281781

fbshipit-source-id: 8e23becb74305e282993fe6b3996fa1a5878cf98
2021-12-23 03:55:16 -08:00
Samuel Susla 4febfd9491 Enable modernize-return-braced-init-list clang tidy rule
Summary:
changelog: [internal]

You can read more about this rule on https://clang.llvm.org/extra/clang-tidy/checks/modernize-return-braced-init-list.html

Reviewed By: mdvacca

Differential Revision: D33279829

fbshipit-source-id: 3969eda9f0f3ed37c262d495c8e31bb4f5326eab
2021-12-23 03:55:16 -08:00
Samuel Susla c270b48f68 Enable modernize-redundant-void-arg clang tidy rule
Summary:
changelog: [internal]

You can read more about this rule on https://clang.llvm.org/extra/clang-tidy/checks/modernize-redundant-void-arg.html

Reviewed By: mdvacca

Differential Revision: D33278172

fbshipit-source-id: 5c3c6123290bd23edc7da4085277803d8745a3dd
2021-12-23 03:55:16 -08:00
Samuel Susla 5763133984 Enable modernize-make-shared clang tidy rule
Summary:
changelog: [internal]

You can read more about this rule on https://clang.llvm.org/extra/clang-tidy/checks/modernize-make-shared.html

Reviewed By: ShikaSD

Differential Revision: D33254590

fbshipit-source-id: 1f5f9e7ec8e7d938490b10e880ba10a64c5ada7f
2021-12-22 08:22:44 -08:00
Samuel Susla 26fffe8cbf Enable modernize-loop-convert rule in clang-tidy
Summary:
changelog: [internal]

You can read more about this rule on https://clang.llvm.org/extra/clang-tidy/checks/modernize-loop-convert.html

Reviewed By: ShikaSD

Differential Revision: D33253673

fbshipit-source-id: db2ec74cc584f2e8eb74ce54c4f50986d8168387
2021-12-22 08:22:44 -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
Kevin Gozali f142bfed45 Butter C++: clarify goals/intent in the comment
Summary:
Just clarifying the purpose of this library.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D33245053

fbshipit-source-id: b4325415774ca33b34b5ba53d222a19f88e2175f
2021-12-20 23:38:52 -08:00
Kevin Gozali 6a93c07485 Butter C++: fixed clangtidy config
Summary:
Added missing `InheritParentConfig: true` per internal clang config.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D33244729

fbshipit-source-id: 9ae8f8265c202902447c8b784206f6c00222c43d
2021-12-20 23:38:52 -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
Samuel Susla 8c3b839625 Enable modernize-deprecated-ios-base-aliases in clang-tidy
Summary:
changelog: [internal]

You can find more about this rule on https://clang.llvm.org/extra/clang-tidy/checks/modernize-deprecated-ios-base-aliases.html#:~:text=Detects%20usage%20of%20the%20deprecated,have%20a%20non%2Ddeprecated%20equivalent.

Reviewed By: ShikaSD

Differential Revision: D33237586

fbshipit-source-id: acc497fb3427f5ac2c7436af3d9627fbaed3d777
2021-12-20 11:22:43 -08:00
Samuel Susla b3fe2d40e8 Remove unused arguments
Summary:
changelog: [internal]

Linter was not happy about this.

Reviewed By: ShikaSD

Differential Revision: D33235690

fbshipit-source-id: 389a49afe2c828f60bfbfb1c6e92d2c74f676600
2021-12-20 11:22:43 -08:00
Samuel Susla eb35e4a4f6 Enable modernize-deprecated-headers rule in clang-tidy
Summary:
changelog: [internal]

You can find more about this rule on https://releases.llvm.org/6.0.1/tools/clang/tools/extra/docs/clang-tidy/checks/modernize-deprecated-headers.html

Reviewed By: ShikaSD

Differential Revision: D33235582

fbshipit-source-id: 28d38b4eab4ad535d87468bc8d64dc87c4b0aeca
2021-12-20 11:22:43 -08:00
Samuel Susla f7c96c000a Enable modernize-avoid-c-arrays in clang tidy
Summary:
changelog: [internal]

In an effort to make our codebase more approachable, I'm enabling more clang-tidy rules.

Read more about modernize-avoid-c-arrays in https://clang.llvm.org/extra/clang-tidy/checks/modernize-avoid-c-arrays.html

Reviewed By: ShikaSD

Differential Revision: D33187162

fbshipit-source-id: c6b3888f67d095274bb492a01132985ae506c0d5
2021-12-20 11:22:43 -08:00
Samuel Susla dc5cae5a6f Enable modernize-avoid-bind in clang tidy
Summary:
changelog: [internal]

I will be enabling more clang tidy rules in Fabric to make it easier for new contributors and standardise the codebase. \
You can read more about the rule in https://clang.llvm.org/extra/clang-tidy/checks/modernize-avoid-bind.html

Reviewed By: ShikaSD

Differential Revision: D33162192

fbshipit-source-id: b4bb332f3134c42c49559a8baf10aeb7a7fdd87f
2021-12-20 04:30:52 -08:00
Luna Wei 3204c55981 Remove usages of bump-oss-version from generated scripts
Summary: Changelog: [Internal] - Update the source of the changes in generated files, no longer bump-oss-version but set-rn-version

Reviewed By: sota000

Differential Revision: D33110408

fbshipit-source-id: 8cd5004f5d40dde82fe4d6271d5b8598cd27ca31
2021-12-17 18:37:37 -08:00
Samuel Susla 6568bc4bb2 Execute only necessary minimum in sync mode in RuntimeScheduler
Summary:
changelog: [internal]

Only execute tasks that are expired when in synchronous mode.

Reviewed By: philIip

Differential Revision: D33062746

fbshipit-source-id: 1825cb572202d1f5dc18eb2b481dd3c20e8e91ba
2021-12-17 10:34:29 -08:00
Samuel Susla fd18225767 Add unit tests for RuntimeScheduler::executeNowOnTheSameThread
Summary: Changelog: [internal]

Reviewed By: philIip

Differential Revision: D33062204

fbshipit-source-id: f37375400fea645f5540b85c3c1ef6343e64be2e
2021-12-16 06:45:34 -08:00
Julio C. Rocha 1d45b20b6c Set CxxModule instance before retrieving Method vector (#32719)
Summary:
Allows `CxxModule` objects to set their `instance_` member before `getMethods()` is invoked, allowing for the `Method` callbacks to capture a weak reference to `getInstance()` if needed.

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

[General] [Fixed] - Set CxxModules' Instance before retrieving their Method vector.

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

Test Plan: Ensure this statement swap does not break any scenarios with existing CI validation.

Reviewed By: JoshuaGross

Differential Revision: D32955616

Pulled By: genkikondo

fbshipit-source-id: fd7a23ca2c12c01882ff1600f5aef86b1fe4a984
2021-12-15 14:37:37 -08:00
Samuel Susla d902a89b40 Move surface registry code out of UIManagerBinding
Summary:
changelog: [internal]

Just moving code that doesn't belong to UIManagerBinding out of the class.

Reviewed By: philIip

Differential Revision: D33060412

fbshipit-source-id: 2d54929072cef14fd1fa6b70bde382ae21ecff45
2021-12-15 10:52:15 -08:00
Samuel Susla 34c4fdb8e2 Remove implicity type conversions from LayoutAnimations
Summary: changelog: [internal]

Reviewed By: philIip

Differential Revision: D33058920

fbshipit-source-id: 6d39e26c369dad409f5141dceae7554fe65daaba
2021-12-15 07:19:51 -08:00
David Vacca 8f6aee0df5 Create experiment to increase size of TextMeasureCache and enable in RNPanel apps
Summary:
Fabric uses a cache where it stores the result of the text measurement in C++ (to avoid unnecessary text measurement that are very costly). This cache has a "max size" of 256 and this size is not enough to store all the texts we have in the screen

In my tests, the amount of texts being measured are ~290 and after scrolling many times they increase to 611.

This diff increases the size of the TextMeasure to 1024 for users in the experiment. As a result this improves performance of HoverEvents by +5x times (see test plan)

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D33112788

fbshipit-source-id: e15feecf0f54da62b252892d37a64fb4ead29e22
2021-12-14 19:33:09 -08:00
Andrei Shikov 0088c22b3d Clang-tidy uimanager/scheduler modules
Summary:
Applies suggestions from default preset that make sense in our codebase

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D33010231

fbshipit-source-id: 6bc9edf01fd9bd9938d211e3494dd1a127b24eaa
2021-12-14 10:27:30 -08:00
Janic Duplessis 20b0eba581 Static link for hermes-inspector (#32694)
Summary:
Follow up to https://github.com/facebook/react-native/issues/32683 to also link hermes-inspector statically.

## Changelog

[Android] [Fix] - Static link for hermes-inspector

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

Test Plan: Tested a clean build and made sure hermes-inspector.so doesn't exist anymore.

Reviewed By: cortinico

Differential Revision: D32791208

Pulled By: ShikaSD

fbshipit-source-id: 6076b263469b9e2c6176d488d13292d4f1731dcc
2021-12-13 07:48:39 -08:00
Samuel Susla b30ff9853c Simplify construction of UIManagerBinding
Summary:
changelog: [internal]

Provide `UIManager` to `UIManagerBinding` in constructor to make the API safer.

Reviewed By: philIip

Differential Revision: D32668892

fbshipit-source-id: a15cd295196a60c3f46997e59c05c4f90503e18d
2021-12-13 06:52:37 -08:00
Andrei Shikov 1d4e7f6d40 Use reference for command args
Summary:
The IDE warning suggests that passing folly::dynamic by value will create a copy on each call.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D32978154

fbshipit-source-id: a47a60c332a9d299eb2110d3537dfab0bc2398b6
2021-12-09 09:47:38 -08:00
Samuel Susla f5f6fd70f2 Introduce TextInput.onKeyPressSync
Summary:
changelog: [internal]

Introduce a way to execute `onKeyPress` synchronously. This feature is experimental and will be changed in the future. It is not decided if marking native events as "sync" is going to be path forward with synchronous access.

NOTE: This is experimental API.

Reviewed By: ShikaSD

Differential Revision: D32882092

fbshipit-source-id: 68c66a9bb7c97758219e085c88a77f3c475c1eb3
2021-12-07 13:42:18 -08:00
Samuel Susla 69acb9569e Remove unused method from TextInputEventEmitter
Summary:
changelog: [internal]

Event `onChangeText` does not exist in TextInput. Let's remove this method to avoid confusion.

Reviewed By: philIip

Differential Revision: D32882056

fbshipit-source-id: 37eb260b84dd7d6cce412ce1bc39c0cbf9cab112
2021-12-07 13:42:18 -08:00
Samuel Susla fcda1ac514 Add support for synchronous completeRoot
Summary:
changelog: [internal]

Exposes a new flag on RuntimeScheduler: `unstable_getIsSynchronous`. Flag indicates if the current code is run synchronously and therefore commit phase should be synchronous.

Unit tests will be added later, to keep this diff short. This code path is not executed yet.

Reviewed By: mdvacca, ShikaSD

Differential Revision: D32677814

fbshipit-source-id: e01d4fff7e716d627ff99fe104965851138c3aef
2021-12-07 12:11:24 -08:00
Andrei Shikov c0710244b3 Clean up AndroidTextInputEventEmitter
Summary:
This class is not used and can be safely deleted

Changelog: [Internal] Delete unused Android event emitter

Reviewed By: mdvacca

Differential Revision: D32916706

fbshipit-source-id: 6dceb6b6ed9d201d96454bf0d646853c5c893d59
2021-12-07 11:09:22 -08:00
Samuel Susla 387e79f8aa Remove background_executor flag
Summary:
changelog: [internal]

Background executor has been shipped on both platforms for a long time.
I've kept the flag around because I wanted to run tests and compare Concurrent Mode vs Background Executor. The intention was to see if we can get rid of Background Executor to simplify the threading model.

Since then, React team has moved away from Concurrent Mode towards more gradual rollout of concurrent rendering and it no longer makes sense to do this comparison. Right now, we don't have a concern with concurrent rendering and Background Executor. If we ever want to run the an experiment, this gating will need to be added again.

Reviewed By: javache

Differential Revision: D32674798

fbshipit-source-id: a1e51c9c5b8e48efa4cb0f25379d58e7eb80ccd9
2021-12-02 15:32:28 -08:00
Samuel Susla 9e2ec4d3dd Make UIManager::animationTick const
Summary:
changelog: [internal]

UIManager::animationTick is thread safe. Let's make it obvious by marking the method const.

Reviewed By: javache

Differential Revision: D32669102

fbshipit-source-id: 49e35d0f0a5c5d1b03baa1cbf9cdece082909e85
2021-12-02 07:54:09 -08:00
Janic Duplessis b2cf24f41c Make hermes-executor-common a static lib (#32683)
Summary:
I've been seeing a couple crashes related to missing hermes-executor-common.so, seems to happen on specific android versions, but can't repro. I investigated this so file more and noticed it is incorrectly linked as a static library here b8f415eb6c/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/Android.mk (L20). There doesn't seem to be any reason for this to be a shared lib so I changed it to be compiled as a static lib.

## Changelog

[Android] [Fixed] - Make hermes-executor-common a static lib

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

Test Plan:
- Verify there is no more hermes-executor-common-{release,debug}.so
- Test locally in an app to make sure it build and run properly.
- Verify that the crash happening on play store pre-launch report doesn't happen anymore.

Reviewed By: ShikaSD

Differential Revision: D32754968

Pulled By: cortinico

fbshipit-source-id: cb57e2d81edb4cbdb1f003dab45c53e594a5a62a
2021-12-01 11:19:23 -08:00
Felipe Perez 79d20a1717 Fix fromRawValue(EdgeInsets) from single float case falling through to float array
Summary:
If `value` is of type `float`, it will still fall through to the `react_native_assert` below, exploding. The `map` type is handled correctly.

Changelog: [Internal][Fixed] Fix fromRawValue(EdgeInsets) from single float case falling through to float array and exploding

Reviewed By: javache

Differential Revision: D32648848

fbshipit-source-id: e70cddd291a8f52d6ee3de5fef11b0bb7aee92cd
2021-11-30 10:38:22 -08:00
Andrei Shikov 041398a775 Compile platform Android components into static libraries
Summary:
Removes extra .so files by merging built-in components into libfabricjni.so
These components shouldn't be referenced in outside modules, so merging them is trivial atm.

Changelog:
[Internal][Android] - Compile native components into static libraries

Reviewed By: cortinico

Differential Revision: D32677572

fbshipit-source-id: fc1a6c5a2832ee49e438c30856562f85677514ea
2021-11-30 08:31:44 -08:00
Andrei Shikov 7eb1ff5048 Rename reactconfig module to react_config to align naming
Summary:
title

Changelog:
[Internal][Android] - Rename reactconfig c++ module

Reviewed By: cortinico

Differential Revision: D32677571

fbshipit-source-id: 41b4313a1f7c75da7204cf829ae3d0d700151eba
2021-11-30 08:03:27 -08:00
Samuel Susla a9815286c2 Remove redundant parameter from ShadowTreeRegistry::enumerate
Summary:
Changelog: [internal]

Nothing was using `stop` parameter, let's get rid of it.

Reviewed By: philIip

Differential Revision: D32669018

fbshipit-source-id: dc2d52048a2f7dd3785dd959270087001c778962
2021-11-30 04:32:02 -08:00
Nicola Corti b8f415eb6c Update LOCAL_SHARED_LIBRARIES to be a multiline string
Summary:
We have `LOCAL_SHARED_LIBRARIES` that are getting longer and are
making reviewing them on Diffs quite hard.
Having all the list of the dependency on a single line is suboptimal
and it makes hard to find duplicated entries.
I've updated the longest `LOCAL_SHARED_LIBRARIES` to be multilines and
I've sorted the entries here.

Changelog:
[Internal] [Changed] - LOCAL_SHARED_LIBRARIES

Reviewed By: ShikaSD

Differential Revision: D32695127

fbshipit-source-id: f5b381c501ddff083ef9f4baaca6c4c8c9523368
2021-11-29 13:01:51 -08:00
Nawbc 0872e220cf fix: Link incompatible target in debug mode (#32595) (#32648)
Summary:
Build from source crash in debug mode on other linux distributions except ubuntu

Changelog:  Link incompatible target in debug mode (https://github.com/facebook/react-native/issues/32595)

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

Reviewed By: ShikaSD

Differential Revision: D32642360

Pulled By: cortinico

fbshipit-source-id: 6b35c560aca3d2e8d30b24a3b800ebfd9b35bda2
2021-11-25 00:27:27 -08:00
Nicola Corti a5469f9d7f Update libruntimeexector to be a shared lib rather than a static lib
Summary:
AGP 7.x is changing the path where we can find
the precompiled static libraries. Therefore is getting complicated
to share prebuilt `.a` files. I'm updating `libruntimeexecutor` to be
a shared library instead so this will solve this issue for now.

Changelog:
[Internal] [Changed] - Update libruntimeexector to be a shared lib rather than a static lib

Reviewed By: ShikaSD

Differential Revision: D32646112

fbshipit-source-id: ce42e930076c1d3b5f54f3d8adcca1c38909d0fb
2021-11-24 10:58:54 -08:00
Samuel Susla c10dc49368 Fix typo in TextInputEventEmitter::onScroll
Summary:
changelog: [internal]

Fix JS Exception "unsupported top level event type".

Reviewed By: ShikaSD

Differential Revision: D32649068

fbshipit-source-id: bc65722ff1d4f6237074ca246906fcb6604411d3
2021-11-24 10:07:05 -08:00
Paige Sun 160807d112 Add ReactMarker::LogTaggedMarkerBridgeless, to replace LogTaggedMarkerWithInstanceKey
Summary:
# Issue in iOS
Before this diff, [Venice would override](https://www.internalfb.com/code/fbsource/[08e6e7a37f9ac1d33e14fc14ed763c0f8716f73a]/fbobjc/Apps/Internal/Venice/Core/RCTPerformanceLoggerUtils.mm?lines=52%2C57) the static function ReactMarker::LogTaggedMarker [created in CxxBridge](https://www.internalfb.com/code/fbsource/[08e6e7a37f9ac1d33e14fc14ed763c0f8716f73a]/xplat/js/react-native-github/React/CxxBridge/RCTCxxBridge.mm?lines=179%2C183). This means that in mixed mode they would share the Bridgeless instance of RCTPerformanceLogger [owned by Venice-only RCTInstance](https://www.internalfb.com/code/fbsource/[08e6e7a37f9ac1d33e14fc14ed763c0f8716f73a]/fbobjc/Apps/Internal/Venice/Core/RCTInstance.mm?lines=65%2C73).

This is wrong because Bridge is supposed to use the instance of RCTPerformanceLogger [owned by RCTBridge](https://www.internalfb.com/code/fbsource/[73ab70b2d9e28569171b62f60e9f25744461d4d9]/xplat/js/react-native-github/React/Base/RCTBridge.m?lines=353).

# Fix iOS and refactor Android

1) Add LogTaggedMarkerBridgeless to use the bridgeless RCTPerformanceLogger.

2) Use LogTaggedMarkerBridgeless to replace logTaggedMarkerWithInstanceKey.
- Remove logTaggedMarkerWithInstanceKey because it always clear from the code that instanceKey is 0 for Bridge, and 1 for Bridgeless,
- iOS doesn't use instanceKey and keeps separate instances of FBReactBridgeStartupLogger, FBReactWildePerfLogger, and RCTPerformanceLogger instead. This is better than using instanceKey because they are all [deallocated when Bridgeless is invalidated](https://www.internalfb.com/code/fbsource/[ea436e5ea6ae4ebc5e206197c4900022be867135]/fbobjc/Apps/Wilde/FBReactModule2/FBReactModuleAPI/FBReactModuleAPI/Exported/FBReactModule.mm?lines=1160%2C1167%2C1170).
- logTaggedMarkerWithInstanceKey is only called from Venice's ReactInstance.cpp so it's easy to remove.

Reviewed By: sshic

Differential Revision: D32588327

fbshipit-source-id: 3151a44c9796da88fef4459b9b56946861514435
2021-11-23 12:55:56 -08:00
Phillip Pan 6a344fe900 introduce removePrerenderedSurfaceWithRootTag:
Summary:
similar to android, we want to handle removing dropped surfaces. in this diff, we add the API to do so.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D32557069

fbshipit-source-id: 2487c459df3f1f412ad0da77568d6c0ab0a1298c
2021-11-23 02:01:25 -08:00
Samuel Susla 19bca222dc Remove asserts in EventTarget
Summary: changelog: [internal]

Reviewed By: philIip

Differential Revision: D32393073

fbshipit-source-id: 9e228000291d67f3a0cedaa152c0376e11d7dcf6
2021-11-22 04:21:55 -08:00
David Vacca 26e30a5ee9 Fix incorrect ViewFlattening for views that were listening for a JS event
Summary:
This diff prevents view flattening for views that are handling some events in the JS side

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D32253124

fbshipit-source-id: acda2b12287f0a9c39a810b23a101765093ba217
2021-11-19 15:48:15 -08:00
David Vacca 34a5158ec8 Update Fabric to suport onEnter/onExit/onMove events
Summary:
This diff updates the internals of Fabric to add support for onEnter/onExit/onMove events.

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D32253128

fbshipit-source-id: 5b30e927bda0328ba1332801f66a6caba77f949b
2021-11-19 15:48:14 -08:00
Phillip Pan 9822464c99 add onScroll event to TextInputEventEmitter
Summary:
resolving issue in https://fb.workplace.com/groups/rn.support/permalink/7241260632589156/

we didn't hook up the onScroll event to the fabric text input component yet, so this stack does that

in this diff, we add the onScroll event to the event emitter

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D32479450

fbshipit-source-id: 3ac0e6f87a4bf391e3ceee24b5765e3e41ecc59d
2021-11-18 12:42:13 -08:00
Marc Horowitz d123a6fae4 Stop forcing /usr/bin to the front of the path
Summary:
This messes with python version selection. At least based on
the comments, it is no longer needed, as /opt/local/bin appears to be
empty on my devserver and on a sandcastle host.

D32337004 revealed the problem.  T105920600 has some more context.  I couldn't repro locally, so D32451858 is a control (which I expect to fail tests) to confirm that this fixes the test failures.

#utd-hermes

Reviewed By: neildhar

Differential Revision: D32451851

fbshipit-source-id: 4c9c04571154d9ce4e5a3059d98e043865b76f78
2021-11-16 19:37:36 -08:00
Christoph Purrer 5dcad6a116 jsi.h Fix typo
Summary:
Changelog:
[Internal][Fixed] - I have been reading this header file recently and discovered some typos

Reviewed By: kodafb

Differential Revision: D32455214

fbshipit-source-id: c27291943476014b787ee1641fd8642056bdbc5a
2021-11-16 08:56:53 -08:00
Pieter De Baets 79cf25bdbe Fix JSInspector build error on windows (#32585)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32585

D31631766 (b60e229d7f) unified compiler flags for all RN targets, which also enabled `-Werror`  for this target. This causes issues on Windows where some warnings are extremely noisy and unhelpful and causes our Hermes+JSInspector build to fail

Reviewed By: rshest

Differential Revision: D32244577

fbshipit-source-id: 7cda346c46d21ff03490bae705759c502f6cf29f
2021-11-15 11:44:37 -08:00
Nicola Corti 2ae06df58f Let react_native_assert really abort the app
Summary:
Fixed a bug in `react_native_assert` that was not effectively letting the app
call `abort()`. The app was actually printing on log twice.
Ref: https://developer.android.com/ndk/reference/group/logging#__android_log_assert

Changelog:
[Android] [Changed] - Let react_native_assert really abort the app

Reviewed By: JoshuaGross

Differential Revision: D32204080

fbshipit-source-id: ca16c50aaf4e41a2318277c233be0e944b2ad8f1
2021-11-11 08:57:59 -08:00
Ken Tominaga 9b059b6709 Remove iOS 11 availability check (#32488)
Summary:
This pull request aims to remove iOS 11 availability check which is no longer needed.

The minimum iOS deployment target for React Native is iOS 11 but we still have iOS 11 version check like below.

```
if (available(iOS 11.0, *)) {
```

This is a continuation pull request of https://github.com/facebook/react-native/pull/32151

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

[iOS] [Changed] - Remove iOS 11 availability check

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

Reviewed By: yungsters

Differential Revision: D32006312

Pulled By: ryancat

fbshipit-source-id: 0ee6579e433a15d3d220a52d2ccd6931b0513971
2021-11-03 09:06:06 -07:00
Tim Yung 77ecc7ede1 JS: Format with Prettier v2.4.1 [3/n]
Summary:
Changelog:
[General][Internal]

Reviewed By: zertosh

Differential Revision: D31883447

fbshipit-source-id: cbbf85e4bf935096d242336f41bf0cc5d6f92359
2021-11-02 22:14:16 -07:00
Sota Ogo 9c4c12722a Fix a build issue where codegen order is incorrect (#32480)
Summary:
D31809012 (f7e4c07c84) introduced a condition where codegen files weren't generated in a correct order so the build fails in `yarn test-ios` if it was a first time to run the command. So it broke ci/circleci: test_ios_unit_hermes.

In this diff

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

Changelog: [intermal]

Reviewed By: cortinico

Differential Revision: D31953580

fbshipit-source-id: db854d6cfed8167dc4aae2667d379738bc261cfe
2021-10-27 09:45:25 -07:00
Sota Ogo f7e4c07c84 Move codegen output out of node_modules
Summary:
In this diff, it moves the codegen output location out of node_modules and to build/generated/ios folder.

A temp pod spec will be created so that those files will be included in the Xcode project.

Changelog: [Internal]

Reviewed By: hramos, cortinico

Differential Revision: D31809012

fbshipit-source-id: ba1c884c8024306ba0fd2102837b7dbebc6e18ac
2021-10-25 20:48:24 -07:00
Phillip Pan def7dd857d use new instead of alloc init
Summary:
i saw this a lot in the codebase, it's not optimal bc we're using two selectors when we only need one.

  fastmod --extensions m,mm '\[\[(.*) alloc] init]' '[${1} new]' --dir xplat/js/react-native-github/*

i manually updated the callsites that this codemod couldn't handle (e.g., where there were more than one of these instances in a single line)

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D31776561

fbshipit-source-id: 1b16da240e8a79b54da67383d548921b82b05a9f
2021-10-20 22:18:38 -07:00
CodemodService FBSourceClangFormatLinterBot a110de9b0e Daily `arc lint --take CLANGFORMAT`
Reviewed By: zertosh

Differential Revision: D31785584

fbshipit-source-id: 6e73901bdeaec659fbf46f1a5559f18cd09ae091
2021-10-19 21:16:42 -07: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
Rob Hogan 61755aced1 Merge textDecoration(LineStyle|LinePattern) into textDecorationStyle
Summary:
The [first implementation of `TextAttributes` in Fabric](62576bcb78) included two separate props instead of `textDecorationStyle`: `textDecorationLineStyle` (single, double, ...) and `textDecorationLinePattern` (dot, dash, dotdash, ...). These two props were implemented in C++ and iOS but never supported in JS.

Pre-Fabric (and CSS) on the other hand use a single prop `textDecorationStyle: 'solid' | 'double' | 'dotted' | 'dashed'`.

This diff implements this same API in Fabric, and removes the unused `textDecorationLineStyle` and `textDecorationLinePattern` props.

Changelog:
[iOS][Fixed] - Implement `textDecorationStyle` on iOS and remove unused `textDecorationLineStyle` and `textDecorationLinePattern` from Fabric.

Reviewed By: dmitryrykun

Differential Revision: D31617598

fbshipit-source-id: f5173e7ecdd31aafa0e5f0e50137eefa0505e007
2021-10-18 02:16:03 -07:00
Joshua Gross 6525f9b082 Stop using RTTI features in Fabric core and components
Summary:
These dynamic_casts aren't really giving us much (they have never fired once in dev! and don't run in prod anyway). They also prevent us from disabling RTTI. So, let's get rid of them.

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D31634895

fbshipit-source-id: 4a9b259837127feb324f64fa3e9e23eb1cc481a6
2021-10-14 19:23:09 -07:00
Joshua Gross b60e229d7f Remove compiler_flags from BUCK modules
Summary:
Nearly all of these are identical and these compiler_flags are now centralized in rn_defs.bzl. This should have NO CHANGE on build configuration, the flags have just moved for now.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D31631766

fbshipit-source-id: be40ebeb70ae52b7ded07ca08c4a29f10a0ed925
2021-10-14 15:34:29 -07:00
Neil Dhar aae93553d0 Remove libstdc++ dependency (#32247)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32247

I don't think we need both libc++ and libstdc++.

allow-large-files

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D30950943

fbshipit-source-id: d0669815ff59c3e9ac45954a4a11930d1bc3959f
2021-10-08 14:16:54 -07:00
Samuel Susla 27304fcd0b Add error handling to RuntimeScheduler
Summary:
changelog: [internal]

Catch JavaScript errors and forward them to `ErrorUtils` in *RuntimeScheduler*. This makes sure that JS errors are handled by ErrorUtils and do not bubble up to bridge.

Reviewed By: philIip

Differential Revision: D31429001

fbshipit-source-id: 50f865872e4cd3ba180056099ff40f5962ee7a77
2021-10-07 15:23:11 -07:00
Samuel Susla ea53d3a9c2 Pass reference instead of shared_ptr to getInspectorDataForInstance
Summary:
changelog: [internal]

This is a pre-condition to get rid of `shared_ptr` from `EventEmitterWrapper`. Also saves us a few copies of shared_ptr, this is negligible though.

Reviewed By: mdvacca

Differential Revision: D31307048

fbshipit-source-id: b84654bed2359b66faf3995795e135e88fe51cb6
2021-10-01 17:47:20 -07:00
Andrei Shikov bf4c6b3606 Expose RawEvent::Category to Java callsites
Summary:
For iOS, event category deduction is done from the C++ code, but the touch events are handled on Java layer in Android. This change exposes the category parameter through the `EventEmitterWrapper` called from Java, allowing to define category for events in the future.

Changelog:
[Internal] - Expose event category through JNI

Reviewed By: mdvacca

Differential Revision: D31205587

fbshipit-source-id: f2373ce18464b01ac08eb87df8f421b33d100be2
2021-09-29 06:53:49 -07:00
Samuel Susla ea3e244668 Add option to use RuntimeScheduler in TurboModules
Summary: changelog: [internal]

Reviewed By: RSNara

Differential Revision: D31145372

fbshipit-source-id: b1d9473d5006d055d1116f71f65899293fb85c56
2021-09-28 09:23:57 -07:00
Samuel Susla 18697adec4 Add option to use RuntimeScheduler in TurboModules
Summary: changelog: [internal]

Reviewed By: RSNara

Differential Revision: D31108093

fbshipit-source-id: 941abf334cc89391641131475725a3eeb790b822
2021-09-25 15:31:21 -07:00
Joshua Gross 10fe09c456 Back out "Send unix timestamp for touch events instead of systemUptime"
Summary:
Original commit changeset: 2acd52ae5873

This original change was made in D26705430 (b08362ade5) and D26705429 (69feed518d). The intention was to change the timestamp definition to make touch telemetry easier, but this is (1) unnecessary and (2) causes other issues.

Changelog: [internal]

Reviewed By: mdvacca

Differential Revision: D31183734

fbshipit-source-id: 6af669bb5696896b43fa4508af1171446d62c6d6
2021-09-24 18:11:33 -07:00
Samuel Susla 382e78e0f0 Cleanup react_fabric_marketplace_home_android_universe.enable_props_forwarding
Summary: changelog: [internal]

Reviewed By: GijsWeterings, ShikaSD

Differential Revision: D30835467

fbshipit-source-id: 6ce2a9dd64eb8a3711370fd07c1b0703b7b3345b
2021-09-24 05:09:58 -07:00
Pieter De Baets 6025611bd0 Use real propsParserContext in LayoutAnimation
Summary: Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D31053819

fbshipit-source-id: 8ec21012500f3bfc7e8aea018b5ca72323da2d9e
2021-09-21 04:24:28 -07:00
Pieter De Baets 9b97c09612 Short-circuit evaluation of formsView
Summary:
Changelog: [Internal]

Small optimization, we can avoid evaluating some properties if `formsStackingContext` is already set, because the end-result is always true.

Reviewed By: sammy-SC

Differential Revision: D30990925

fbshipit-source-id: 08f500aa4b75446a6c644e8821f84dbfccbfebb6
2021-09-17 07:25:54 -07:00
Kevin Gozali b0c8a4eee8 Link RCT-Folly against libc++abi
Summary:
Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this:

```
Undefined symbols for architecture arm64:
  "___cxa_increment_exception_refcount", referenced from:
      folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

See https://github.com/react-native-community/releases/issues/251

Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`.

Changelog: [Fixed][iOS] Unbreak Folly linker error

Reviewed By: lunaleaps

Differential Revision: D30950944

fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca
2021-09-16 22:24:10 -07:00
Tim Yung 2f8cb57406 RN: Resolve `set-value@^4.1.0` Dependency
Summary:
Addresses this security vulnerability: https://github.com/advisories/GHSA-4jqc-8m5r-9rpr

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D30976326

fbshipit-source-id: cb6ead029673774a5a6866d7b6014ab305669047
2021-09-15 18:11:01 -07:00
Samuel Susla 1ecd98adc7 Do not flatten view if prop accessibilityViewIsModal is true
Summary:
changelog: [internal]

As per title, prevent view from flattening if `accessibilityViewIsModal` is true.

Reviewed By: jimmy623

Differential Revision: D30696223

fbshipit-source-id: 0c6bfc116458d1808f152cb13ba6c941c58f052e
2021-09-15 08:31:58 -07:00
CodemodService Bot 18b866da53 xplat/
Reviewed By: scottrice

Differential Revision: D30749716

fbshipit-source-id: d96a943a720fb6a2c8af80deab69e8990f53bb94
2021-09-14 19:13:25 -07:00
Samuel Susla ce6047d816 Pull function calculateAnimationProgress to a separate file
Summary:
changelog: [internal]

Pulling a function from class since it doesn't use any of the ivars.

Reviewed By: RSNara

Differential Revision: D30766917

fbshipit-source-id: 219d9b7d3bc0b110b659d7188f5e3877c7b480ff
2021-09-14 06:21:05 -07:00
Ramanpreet Nara f617e022c8 Fix methodQueue attachment error message
Summary:
When we fail to assign the methodQueue to a NativeModule in the TurboModule system, we say "You must either synthesize the bridge property", when we should say "You must either synthesize the methodQueue property".

Changelog: [Internal]

Created from CodeHub with https://fburl.com/edit-in-codehub

Reviewed By: philIip

Differential Revision: D30909907

fbshipit-source-id: 07dc1060497be3fdd16bdfcf6e80cfed182bc5c7
2021-09-13 14:20:39 -07:00
Samuel Susla cc3064d394 Use designated initialisers for ShadowViewMutation
Summary:
changelog: [internal]

In this diff, we delete default initialised for ShadowViewMutation to prevent accidentally creating empty ShadowViewMutation.
The other initialiser is made private and all of its uses are migrated to designated initialisers. This makes for safer API.

Reviewed By: RSNara

Differential Revision: D30774900

fbshipit-source-id: d2064bf08409850e75e13ad06558b7980a7f5d8d
2021-09-12 08:56:32 -07:00
Samuel Susla d2cc91bcc3 Add a way to simulate memory access to ImageProps in LayoutAnimations
Summary:
changelog: [internal]

I'm chasing down a crash in LayoutAnimations, it would help me to simulate the memory access which causes the crash to learn where the bad memory is coming from.

Reviewed By: RSNara

Differential Revision: D30776840

fbshipit-source-id: 1e97fac28ba2df37ba3e47ec2c110043c3823e70
2021-09-12 08:56:32 -07:00
Samuel Susla c6e203bdb0 Prevent implicit conversion to boolean
Summary:
changelog: [internal]

This looks like a bug where the author did not intend the conversion to boolean. This means that `onlyMutationIsUpdate` was evaluated to true even if more than 1 animation was in the vector.

Reviewed By: RSNara

Differential Revision: D30767172

fbshipit-source-id: 0ef47b65a5d8ef07d774d9e0b358e5642dc0a9ea
2021-09-12 08:56:32 -07:00
Samuel Susla 1e4f364f87 Remove movesToAnimate var which was never read
Summary:
changelog: [intenal]

The variable is never read, removing it.

Reviewed By: RSNara

Differential Revision: D30767134

fbshipit-source-id: de72740f9dc7ad10d651129404fe4df093e6206d
2021-09-12 08:56:32 -07:00
Samuel Susla 273f631535 Annotate arguments in AnimationKeyFrame ctor
Summary:
changelog: [internal]

Just improvement to readability.

Reviewed By: philIip

Differential Revision: D30767100

fbshipit-source-id: eb5d36712f8096e6becd8db1e9d47128d5754624
2021-09-12 08:56:32 -07:00
Samuel Susla 10ab64888f Annotate arguments when constructing ShadowViewMutation
Summary: changelog: [internal]

Reviewed By: philIip

Differential Revision: D30766786

fbshipit-source-id: f7fac3371d9f018c15c366b0e8a5be1de021a0e7
2021-09-11 01:42:32 -07:00
Samuel Susla 24b961b6f7 Add option to crash the app if component descriptor is missing in LayoutAnimations
Summary:
changelog: [internal]

Add a log behind feature flag to learn more about missing component descriptor.

Component descriptor should never be missing, that's a state of program that is impossible as far as I can tell. This logic was introduced in D22216030 (6342e6e3f1) and I think it is just cover the real cause of crashes in LA on iOS.

Reviewed By: RSNara

Differential Revision: D30765947

fbshipit-source-id: 6843384e02529de2f024c59c61ae21b8682ac371
2021-09-11 00:26:27 -07:00
Héctor Ramos ef6ad1f2d6 Codegen: Remove generate-specs.sh
Summary:
First part of the codegen script cleanup effort. Everything that was done in generate-specs.sh is now part of the CocoaPods recipe (e.g. codegen method in `react_native_pods.rb`).

Now that `generate-specs.sh` has been removed, the codegen may still be invoked manually for test purposes like so:

```
cd react-native

# Generate Schema - do this whenever your JS specs change
node packages/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.js <output_file_schema_json> <javascript_sources_dir>

# Generate native interfaces for iOS (use schema.json generated by previous step)
node scripts/generate-specs-cli.js ios <output_file_schema_json> <output_dir> <library_name>
```

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D30648067

fbshipit-source-id: 29688e0aac5496886657db82becb05bc8da076c9
2021-09-10 17:28:55 -07:00
Samuel Susla 4fe72bdc22 Move comparision functions to separate file
Summary:
changelog: [internal]

Just moving two functions to separate file.

Reviewed By: RSNara

Differential Revision: D30765732

fbshipit-source-id: e85e749c2910f6f38f07e56b23a21fb9f1cbc9b5
2021-09-09 11:57:25 -07:00
Samuel Susla 661b11e815 Use unordered_set instead of vector to keep track of tags
Summary:
changelog: [internal]

Prefer `unordered_set` over `vector`. Makes for nicer APIs and has better performance characteristics.

Reviewed By: RSNara

Differential Revision: D30756215

fbshipit-source-id: d259da07f8f0d5837441dc8ba11c00324aac3fa4
2021-09-09 11:57:25 -07:00
Samuel Susla 84d039aad2 Avoid extra copy and use more expressive APIs
Summary: changelog: [internal]

Reviewed By: RSNara

Differential Revision: D30756211

fbshipit-source-id: 650b3faa55ce1b6f33a452f25b699d854a5cee25
2021-09-09 11:57:25 -07:00
Samuel Susla ba6f21e32d Pull handling of stopped surfaces into separate method
Summary:
changelog: [internal]

Just moves stopped surfaces logic into separate method

Reviewed By: RSNara

Differential Revision: D30756213

fbshipit-source-id: d8eb637e6b9fc77c400dfdefa900ebaa89710825
2021-09-09 11:57:24 -07:00
Samuel Susla 668ce510bd Avoid copy in LayoutAnimationDriver
Summary:
changelog: [internal]

Avoid unnecessary copy of `ShadowViewMutation` and `ShadowView`.

Reviewed By: RSNara

Differential Revision: D30756214

fbshipit-source-id: 39c44dd60582e6c111986df482613212e25739d7
2021-09-09 11:57:24 -07:00
Samuel Susla f91974156b Pass by ShadowView by reference to copy
Summary:
changelog: [internal]

Pass ShadowView by reference to avoid unnecessary copy.

Reviewed By: RSNara

Differential Revision: D30756212

fbshipit-source-id: 1ac1f5b943c8f278db5bcdb55d76e88de514debb
2021-09-09 11:57:24 -07:00
Samuel Susla a3343dfca3 Move conversion functions to separate file
Summary:
changelog: [internal]

Just move conversion functions to separate file

Reviewed By: philIip

Differential Revision: D30732128

fbshipit-source-id: 092523de949ee0088b1317c887aca91913991647
2021-09-09 11:57:24 -07:00
Samuel Susla ae4068d63c Add option to skip invalidated key frames
Summary:
changelog: [internal]

Maybe invalid keyframe animation shouldn't be queued. This adds a fix behind feature flag to verify if it fixes iOS crashes.

Reviewed By: RSNara

Differential Revision: D30730005

fbshipit-source-id: 8a2bb54c449449a95d14d51a1a78bfaccad61877
2021-09-09 11:57:24 -07:00
Ramanpreet Nara e36bfef0f1 Conditionally disable TurboModuleManager delegate locking
Summary:
## Context
Whenever the TurboModuleManager calls into its delegate, it [acquires a lock](https://www.internalfb.com/code/fbsource/[f14548634e72009989c844a2ef025915ef74159e]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm?lines=429%2C513). We initially introduced this mutex (in D21170099 (2c473e1a38)). It serializes access to the TurboModuleManager delegate during TurboModule create.

## Problems
- When we call into the delegate, we acquire a lock, and call into arbitrary product code: getModuleClassFromName, getModuleInstanceFromClass. If any of these two product methods create another TurboModule, the application will deadlock, because we'll acquire the same std::mutex twice.

## Fix
The delegate methods of TurboModuleManager are usually implemented as [switch cases over the NativeModule names or NativeModule classes](https://www.internalfb.com/code/fbsource/[f015e461de4e7a18d0d52a697a53086fe6a3b91c]/fbobjc/Apps/Wilde/FBReactModule2/FBReactModuleAPI/FBReactModuleAPI/Exported/FBReactModule.mm?lines=1481-1488%2C1490-1537%2C1539-1577). So, it should be safe to call into them concurrently for two different modules.

So, while we could fix the problem by migrating the TurboModuleManager to an std::recursive_mutex, one could make an argument that this locking shouldn't even be necessary in the first place. We don't have this locking in the Android TurboModule system.

## Changes
This diff introduces a flag in React Native that allows to to safely remove this TurboModuleManager delegate locking in production.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D30754875

fbshipit-source-id: d04a831c18a2a8b46e9bc07ddf690d8e4d0be8e0
2021-09-08 12:53:17 -07:00
Ramanpreet Nara 5a44c596b6 Move RCTModuleRegistry attachment into React Native initialization layer
Summary:
## Context
RCTModuleRegistry allows NativeModules to require other NativeModules, regardless of if they're using the old or the new system.

## Problems
Currently, the TurboModuleManager owns the RCTModuleRegistry. This results in the following ownership diagram:
{F660246242}

As you can see, for the bridge case, we're maintaining two *different* RCTModuleRegistry objects, both of which maintain a backward reference to the bridge and the TurboModuleManager.

## Changes
If we stop having TurboModuleManager own the RCTModuleRegistry, and just have React Native's initialization layer attach it to NativeModules, then we can simplify the above ownership diagram to this:
{F660246285}

## Benefits
- Less complicated design for RCTModuleRegistry
- RCTModuleRegistry understands the old and the new NativeModule system. So, it makes more sense for RCTModuleRegistry to be owned by the bridge, which also understands the old and the new NativeModule system.
- **Actual Motivation:** This allows us to start exporting RCTModuleRegistry from the bridgeless core, which is safer than leaking the TurboModuleManager from the bridgeless core. Diffs incoming.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D30753286

fbshipit-source-id: cf374092b7b939bc177c3c3448424f2fb53033c3
2021-09-08 12:46:35 -07:00
Samuel Susla 16a093029e Group private public and protected methods in LayoutAnimationKeyFrameManager
Summary:
changelog: [internal]

Group public, protected and private methods in header and implementation file. Nothing else is changed in this diff.

Reviewed By: RSNara

Differential Revision: D30729103

fbshipit-source-id: 047bfb86794caedddcf6569ffeee224fee811794
2021-09-08 11:53:16 -07:00
Samuel Susla f2191ecbc5 Clean up dtors in LayoutAnimations
Summary:
changelog: [internal]

Clean up destructors for classes in LayoutAnimations module.

Reviewed By: RSNara

Differential Revision: D30728212

fbshipit-source-id: 612afb8ebf1407318d22fc461fcc7e03a2b72c47
2021-09-08 11:53:16 -07:00
Samuel Susla 2c09095567 Remove unused header imports
Summary:
changelog: [internal]

Clean up unused header imports in LayoutAnimations.

Reviewed By: RSNara

Differential Revision: D30728213

fbshipit-source-id: 725da1a7057b058c6564a8d89856d599f9a798a7
2021-09-08 11:53:16 -07:00
Samuel Susla 5153b43c6a Move LA helper classes to separate file
Summary:
changelog: [internal]

Just moving helper classes to dedicated file

Reviewed By: philIip

Differential Revision: D30728209

fbshipit-source-id: a86feb7f9352356078f3d238eb8d5f0c0f1e7ff2
2021-09-08 11:53:16 -07:00
Samuel Susla d83c310144 Simplify Layout Animation callback handling
Summary:
changelog: [internal]

There was extra bookkeeping associated with lifetime of `LayoutAnimationCallbackWrapper`. We can just copy it into runtimeExecutor lambda to manage its life cycle and delete `jsi::Function` once it was called.

Reviewed By: RSNara

Differential Revision: D30728210

fbshipit-source-id: 6fc60ee83846cb73648f1c09e5aaf1ed04bd0817
2021-09-08 11:53:16 -07:00
Samuel Susla cb58c84dc0 Use set instead of vector to hold stopped surfaces
Summary:
changelog: [internal]

Use set instead of vector. It makes for nicer API to check if the element exists.

Reviewed By: cortinico

Differential Revision: D30728211

fbshipit-source-id: 7b7cc1e94bb82a44b064e2945a753adbbce5dc2c
2021-09-08 06:46:52 -07:00
Samuel Susla 30887403ec Add LayoutAnimation support to all ViewKind nodes
Summary:
changelog: [internal]

LayoutAnimations only animates changes inside View and Paragraph nodes. This diff extends it to any node that's ViewKind.

Reviewed By: JoshuaGross

Differential Revision: D30603138

fbshipit-source-id: 63ca1e5df420149c4ba66151e97fea419fdfe631
2021-09-08 04:19:09 -07:00
Samuel Susla dbda1917cc Make RuntimeScheduler module compile in C++ 14
Summary:
changelog: [internal]

Don't use C++ 17 features in RuntimeScheduler module as it needs to be imported into C++14 module.

Also removes redundant dependency.

Reviewed By: ShikaSD

Differential Revision: D30485642

fbshipit-source-id: 0a20f85c596eebe193affc815c8ca851fc72e46d
2021-09-01 11:26:27 -07:00
Samuel Susla 3e6eedaedb Use surfaceId type instead of int in PropsParserContext
Summary:
changelog: [internal]

Use surfaceId type instead of raw int type in PropsParserContext

Reviewed By: RSNara

Differential Revision: D30667540

fbshipit-source-id: 2bf890b892851e785318e3566692ac72ec782b91
2021-09-01 10:27:31 -07:00
Samuel Susla 7dc22116b0 Remove RTTI from LayoutAnimations
Summary:
changelog: [internal]

Remote use of dynamic_cast from LayoutAnimations.

Reviewed By: JoshuaGross, cortinico

Differential Revision: D30602864

fbshipit-source-id: ce23f9b4a8b4e28d17d2297d64d8e460a1e03472
2021-08-28 06:59:22 -07:00
Neil Dhar 1bc885b8b8 Make JSI a dynamic library
Summary:
Ship libjsi as a standalone dynamic library. This prevents problems
with exception handling caused by duplicate typeinfo across multiple
shared libs, and reduces bundle size by removing duplicate copies of
JSI.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D30599215

fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96
2021-08-27 17:16:49 -07:00
Genki Kondo f3e8ea9c29 Use hyphenationFrequency for text measurement
Summary:
Implements the calculation of measurement and position of Text attachments in Android

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D30586616

fbshipit-source-id: e9ecc002f03477e3465d746855e1dff2e5f0b321
2021-08-27 09:04:01 -07:00
Genki Kondo 3b2d541989 Set textBreakStrategy default to be HighQuality
Summary:
Android TextView's default for breakStrategy is BREAK_STRATEGY_HIGH_QUALITY (https://developer.android.com/reference/android/widget/TextView#setBreakStrategy(int))

RN docs also states that highQuality is default.

However, on Fabric, the default is 'simple'. This diff fixes the default to be 'highQuality'

Changelog:
[Android][Fixed] - Set textBreakStrategy default to be 'highQuality'

Reviewed By: JoshuaGross

Differential Revision: D30597085

fbshipit-source-id: 3bd7531afdaf980b342cc461dd449c3d3df12cb0
2021-08-27 00:19:27 -07:00
Phillip Pan ec92c85a15 introduce MockSurfaceHandler
Summary:
Changelog:
[ios][added] - introduce MockSurfaceHandler

following the recommendation in https://fb.workplace.com/groups/474291069286180/posts/6540719469309946

in order to unit test classes that use SurfaceHandler, we need to be able to mock it somehow - since the class is final we aren't able to do that. in this diff, we add the mock class.

Reviewed By: sammy-SC

Differential Revision: D30578927

fbshipit-source-id: 9b39b03ad0b55cecd9b482f9cce9630d7e7d5bda
2021-08-26 22:40:43 -07:00
Phillip Pan fe5a5dc878 virtualize setDisplayMode
Summary:
Changelog:
[internal]

following the recommendation in https://fb.workplace.com/groups/474291069286180/posts/6540719469309946

in order to unit test classes that use SurfaceHandler, we need to be able to mock it somehow - since the class is final we aren't able to do that. in this diff, we convert the function that we need to stub / listen to to a virtual function so we can mock it.

the alternative is to keep this class final, and create another abstract interface that this will extend from. however, this class is quite large and that would have a lot more boilerplate and updation of callsites, so this simpler approach seems better.

Reviewed By: sammy-SC

Differential Revision: D30578928

fbshipit-source-id: 4a63396f049c44753986d15f1ac64332b2a8393a
2021-08-26 22:40:43 -07:00
Genki Kondo ca60be8882 Add android_hyphenationStrategy to ParagraphAttributes
Summary:
Expose android_hyphenationFrequency in Fabric as part of ParagraphAttributes

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D30583215

fbshipit-source-id: f4e9e9d6ea8efcfc10db29e1fbd651462f442837
2021-08-26 18:52:18 -07:00
Dmitry Rykun 4a9621647c TextTransform prop implemented
Summary:
Changelog: [iOS] [Fixed]
TextTransform is applied when constructing NSAttributedString from C++ AttributedString in Fabric.

Reviewed By: sammy-SC

Differential Revision: D30515821

fbshipit-source-id: 8a824ff89919832f79ace693dfe3cf7ed35c3beb
2021-08-26 06:57:14 -07:00
Vincent Lee 25c5d194ad Compare strings by value instead of reference
Summary:
LLD, our new iOS linker, is an ongoing effort to migrate our old outdated ld64 linker. As part of our effort to rollout LLD to all apps, we are making sure LLD reaches parity with ld64.

Due to Identical Code Folding (ICF), LLD and ld64 handles strings differently. LLD treats each string as a separate object in memory even if the values of the strings are the same. ld64 happens to aggregate these values across files. This behavior creates a subtle difference on our codebase when we start comparing by value or by reference.

`char * ` fields from `RawPropsKey.h` are using `==` which compares by its address. Here, we cast the buffer to a string to make the comparison, while avoiding the cast if one happens to be null.

Changelog: [Internal]

Reviewed By: int3, JoshuaGross

Differential Revision: D30444176

fbshipit-source-id: 74216926803adbece05206ddd8478cc3c8e6812e
2021-08-25 13:25:42 -07:00
Jimmy Zhang 1a42bd6e97 Add UIAccessibilityTraitUpdatesFrequently to progressBar role
Summary:
Changelog:
Add UIAccessibilityTraitUpdatesFrequently when the AccessibilityRole is set to progressBar. This trait tells the accessibility system where content may change with every percentage point, but without annoying the user with constant announcements.

Reviewed By: ikenwoo

Differential Revision: D30510587

fbshipit-source-id: e75690a2a56ce42476dc999383cf58c0811fcbdf
2021-08-25 05:10:27 -07:00
Nicola Corti a6768bfd70 Remove usages of `dynamic_casts` that are used inside assertions
Summary:
This diff is part of a bigger effort to remove the RTTI flags.
To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime
type informations.

Changelog:
[Internal][Changed] - Removed extra asserts relying on dynamic_cast

Reviewed By: JoshuaGross

Differential Revision: D30483554

fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654
2021-08-24 09:53:04 -07:00
Jimmy Zhang d756d4394d Add support for AccessibilityValue
Summary:
Changelog:
[Fabric][iOS] Add support for AccessibilityState

Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue

Reviewed By: sammy-SC

Differential Revision: D30452786

fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3
2021-08-24 05:18:46 -07:00
Jimmy Zhang 11f8d9c7cd Add support for the UIAccessibilityTraitsTabBar
Summary:
Changelog:
Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar

Reviewed By: yungsters

Differential Revision: D30490752

fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3
2021-08-24 02:31:17 -07:00
Dmitry Rykun 8434177722 Added Selection prop to TextInputProps
Summary:
Changelog: [iOS][Added]
1. Added new primitive type "Selection" to C++
2. Added property "selection" to TextInputProps
3. Added parser for that

Reviewed By: sammy-SC

Differential Revision: D30043256

fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7
2021-08-23 06:04:01 -07:00
Samuel Susla 1036c14888 Provide logger to YGConfig
Summary:
Changelog: [internal]

Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log.

Reviewed By: fkgozali

Differential Revision: D30394676

fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973
2021-08-20 04:39:34 -07:00
Samuel Susla b7616242aa Remove redundant includes
Summary:
changelog: internal

Removing unused headers. Fewer headers = faster compilation

Reviewed By: p-sun

Differential Revision: D30398600

fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed
2021-08-20 03:02:02 -07:00
Chatura Atapattu 2c2b831716 Apply new buildifier fixes
Summary: Changelog: [Internal]

Reviewed By: zertosh

Differential Revision: D30407205

fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c
2021-08-19 20:01:02 -07:00
Chatura Atapattu 8258f5e271 Remove BUILD FILE SYNTAX from build files
Summary: Changelog: [Internal]

Reviewed By: zertosh

Differential Revision: D30410441

fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d
2021-08-19 15:25:19 -07:00
Sota Ogo b29a78732d Emit soft error for warning
Summary:
This diff adds a default behavior for the unified logger on Android.

Added the call site in the CXXNativeModule.

Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D30377767

fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536
2021-08-18 23:38:01 -07:00
Sota Ogo 3e0d77834a Move react_native_log out of utils (#32042)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32042

This diff moves react_native_log out of utils to make it easier/possible to import from modules.
Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D30411247

fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230
2021-08-18 20:14:47 -07:00
Joshua Gross 4804e68238 Expose "unreserved" trait constants that can be mapped per-component
Summary:
Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits.

It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components.

Changelog: [Internal]

Reviewed By: cortinico, RSNara

Differential Revision: D30401743

fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066
2021-08-18 13:23:17 -07:00
Sota Ogo c317a709d5 Add a way to bind log function to the unified react native logger.
Summary:
In this diff:
1. Convert the ReactNativeLogger to c function for the future compatibility.
2. Bind the log function from Catalyst app
3. Update the call site

Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D30271863

fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884
2021-08-16 16:41:32 -07:00
Samuel Susla 5b5ece7980 Clean up unbatched only experiment
Summary:
changelog: [internal]

The experiment isn't shipping.

Reviewed By: JoshuaGross

Differential Revision: D30303379

fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04
2021-08-16 04:35:02 -07:00
Ramanpreet Nara f536f82e12 Warn whenever CxxNativeModules are used
Summary:
After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used.

Changelog: [Internal]

Reviewed By: p-sun

Differential Revision: D30272695

fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070
2021-08-13 13:53:44 -07:00
Paige Sun d45d4eafa8 iOS: Log image url in test environment when image times out
Reviewed By: fkgozali

Differential Revision: D30280757

fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9
2021-08-12 10:58:16 -07:00
Luna Wei 18132c1597 Remove autoCompleteType as a native component prop
Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component.

Reviewed By: charlesbdudley

Differential Revision: D30057497

fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b
2021-08-11 17:53:37 -07:00
Paige Sun 637ab46e9e iOS: When RCTSyncImageManager image times out, log warning instead of error
Reviewed By: fkgozali

Differential Revision: D30255710

fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff
2021-08-11 13:16:44 -07:00
Sota Ogo 307f54832d General Logging Util (stab) class for native errors (#31998)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/31998

Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app).

This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps.

Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D30174404

fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada
2021-08-10 21:31:26 -07:00
Phillip Pan 7c68cf43c4 replace SharedColor alias with class for more reliable template deduction
Summary:
Changelog: [Internal]

when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following:

https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132

this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`.

there was a number of options i considered, but didn't feel the most correct:
- wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper.
- writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors.
- coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds.

i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above.

Reviewed By: sammy-SC

Differential Revision: D30149880

fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd
2021-08-10 11:30:58 -07:00
Phillip Pan e10c222dee hook up PlatformColorParser to RCTPlatformColorUtils
Summary:
Changelog: [Internal]

in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor

Reviewed By: sammy-SC

Differential Revision: D30110297

fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28
2021-08-10 11:30:58 -07:00
Phillip Pan df65dbb37f introduce RCTPlatformColorUtils
Summary:
Changelog: [Internal]

in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors.

functionality not covered yet:
- customColor
- iOS Dynamic Colors
- Variant Colors

Reviewed By: sammy-SC

Differential Revision: D30103451

fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574
2021-08-10 11:30:58 -07:00
Nicola Corti ffb183174b Cleanup warnings in the NDK build
Summary:
This diff is cleaning up some configurations in the `Android.mk` files
of the native build. Specifically I simplified some of the rules and removed
a duplicate file specification.

Changelog:
Internal - Cleanup warnings in the NDK build

Reviewed By: ShikaSD

Differential Revision: D30220715

fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774
2021-08-10 09:44:14 -07:00
David Vacca 91437d65d5 Replace Paper -> old renderer
Summary:
Replace Paper -> old renderer

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D30139941

fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c
2021-08-05 18:35:52 -07:00
David Vacca cf717ffc19 Add TODOs to unify component names between JS - Android - iOS - C++
Summary:
EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++
see task: T97384889

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D30139942

fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d
2021-08-05 18:35:52 -07:00
Moti Zilberman b26ae3e0c9 Move RCT* Buck targets to GitHub
Summary: Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D30030454

fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01
2021-08-04 13:03:21 -07:00
David Vacca 43a91d03eb Extend getInspectorDataForInstance to return props
Summary:
This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter.

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D30095406

fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04
2021-08-04 11:39:17 -07:00
David Vacca f1b49f7df8 Fix NPE when hierarchy return null values
Summary:
This diff fixes a NullPointer that was being thorwn when hierarchy values are null

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D30095407

fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972
2021-08-04 11:39:17 -07:00