Paige Sun
6be46b0bb5
Comments only. Clarify a few Venice and SVC methods
...
Summary: Changelog: [Internal]
Reviewed By: fkgozali
Differential Revision: D33468276
fbshipit-source-id: bcc62ba1e728bba2492dbbbb0e4569285effeca7
2022-01-07 17:41:55 -08:00
Paige Sun
9daae5a5f2
For Fabric with StaticViewConfigs, fix UIManager to use LazyUImanager, not PaperUIManager
...
Summary: Changelog: [JS] For Fabric with StaticViewConfigs, fix UIManager to use LazyUImanager, not PaperUIManager
Reviewed By: fkgozali
Differential Revision: D33459937
fbshipit-source-id: 4298be7e1e455856cbcf3162b100099cd8c9ce09
2022-01-07 16:16:16 -08:00
Lulu Wu
705236e363
Remove unused import of JMessageQueueThread.h
...
Summary:
As title.
Changelog:
[Android][Changed] - Remove unused import of JMessageQueueThread.h
Reviewed By: philIip
Differential Revision: D33477760
fbshipit-source-id: a62bd9bb34f5a08446a59fbd7fd1b0cd27dd6606
2022-01-07 15:54:18 -08:00
Ramanpreet Nara
ca5aaa7663
Remove {eventName}: true from ViewConfig validAttributes
...
Summary:
For every direct and bubbling event, RCTComponentData (iOS-only) creates a {eventName}: true entry in the component's ViewConfig validAttributes. This entry is unnecessary, and creates a discrepancy between ViewConfigs on iOS vs Android.
This diff removes this entry for all events to:
1. Reduce bloat in native ViewConfigs
2. Create consistency betweeen Android and iOS.
Changelog: [Internal]
Reviewed By: yungsters
Differential Revision: D33303950
fbshipit-source-id: 870c8a2a6d41156ac89bd8554eb09f292bb6108e
2022-01-06 19:09:53 -08:00
Nicola Corti
252b2a63c5
Updating Yarn Cache path to fix broken CI ( #32834 )
...
Summary:
The CI is currently failing with:
```
Error extracting tarball /tmp/cache1419328940 : tar: root/.cache/yarn: Cannot mkdir: Permission denied tar: root/.cache/yarn/v6
```
The problem is that we're sharing the Yarn cache between two jobs (`test_js` and `test_ios_unit_jsc`) which are executed on two difference executors (a Machine vs a Docker container).
I've update the cache key to be `v5-yarn-cache-{{ .Environment.CIRCLE_JOB }}-{{ arch }}-{{ checksum "yarn.lock" }}` so the job name is accounted when computing the Cache Key.
Moreover the `test_js` test was also failing on `flow check` as one of the library we depend on (`resolve`) added a test with a malformed JSON. I'm fixing this failure as well so the CI is back green.
## Changelog
[Internal] - Updating Yarn Cache path to fix broken CI
Pull Request resolved: https://github.com/facebook/react-native/pull/32834
Test Plan: Verified that the external CI is green: https://github.com/facebook/react-native/pull/32834
Reviewed By: lunaleaps
Differential Revision: D33453702
Pulled By: cortinico
fbshipit-source-id: 52bf42db583eaf6aa913f1bb164566f8c3563d36
2022-01-06 10:46:15 -08:00
Nicola Corti
cd4c6659d3
Bump Gradle, AGP and Download plugins
...
Summary:
Let's keep our Gradle infra deps up to date.
I'm bumping Gradle to 7.3.3 which fixes several Log4j CVEs,
AGP to 7.0.4 and the Download Task plugin to 4.1.2
Changelog:
[Android] [Changed] - Bump Gradle to 7.3.3 and AGP to 7.0.4
Reviewed By: mdvacca
Differential Revision: D33430789
fbshipit-source-id: b8f260beb4a9cc962ea3743610bfb4ead004d6cb
2022-01-06 10:37:28 -08:00
Mengke Ding
a03bd2f13e
A quick fix for inital fb4a_debug launch crashes due to fetching string com.facebook.react.R.string.catalyst_sample_profiler_enable
...
Summary: Changelog: [Android][Internal] - a quick fix for inital fb4a_debug launch crashes due to fetching string `com.facebook.react.R.string.catalyst_sample_profiler_enable`
Reviewed By: paveldudka
Differential Revision: D33410712
fbshipit-source-id: f63e4b7e9aba3e79d4aa11983d68fee7341972bb
2022-01-05 16:37:59 -08:00
Pieter De Baets
78614de1cb
Revert D32559015: Support setting hitSlop with single value (JS changes)
...
Differential Revision:
D32559015 (https://github.com/facebook/react-native/commit/589b129581903a737a64e14eab3f2e29620831d5 )
Original commit changeset: c0409e6e5dd9
Original Phabricator Diff: D32559015 (https://github.com/facebook/react-native/commit/589b129581903a737a64e14eab3f2e29620831d5 )
fbshipit-source-id: 91cfcc86582c4716fc531a73bd8e06dea1406abd
2022-01-05 14:06:54 -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
Ramanpreet Nara
d016766303
Attach "default events" to all ViewConfigs
...
Summary:
## Context
Default events are only attached to the first-loaded component.
## Problem
This complicates SVC == NVC reconciliation:
- The Static ViewConfigs of all components contain these default events.
- The native ViewConfig of *only the first component that loads* has these default events.
## FAQ
**Question:** If default events were only attached to the first loaded component, how come all components could emit these default events?
In short, if one component declares an event, React Native can dispatch that event to **all** components:
1. The ReactFabric-dev renderer invokes [ReactNativeViewConfigRegistry.get](https://fburl.com/code/468l3zp7 ) to get the ViewConfig of a component.
2. ReactNativeViewConfigRegistry.get inserts a component's the Bubbling/Direct events into [two **global** maps: ReactNativeViewConfigRegistry.customBubblingEventTypes, ReactNativeViewConfigRegistry.customDirectEventTypes](https://www.internalfb.com/code/fbsource/[00ccc3c7a1b76e55986a6d753b8748327397e5eb]/xplat/js/react-native-github/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js?lines=20-34%2C57-72%2C117 ).
3. When the ReactFabric-dev renderer needs to dispatch events, it just [does a lookup on these two **global** maps](https://www.internalfb.com/code/fbsource/[2de1e1d59f6e0316868a6c4d9bca5fe673210106]/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.js?lines=2426%2C2439-2440 ) to create/dispatch the SyntheticEvents.
**Question:** Should we gate these changes?
This change should be safe to land without gating. This diff just creates duplicate entries for bubbling/direct events across components, which should [just get ignored by ReactNativeViewConfigRegistry](https://www.internalfb.com/code/fbsource/[4c57b02a0edccfd8a5fcc3a63ed2dd622efea320]/xplat/js/react-native-github/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js?lines=42%2C57-72%2C117 ).
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D33303417
fbshipit-source-id: fa777ca92e57b82eafb94f7d05ef4064ed5060ed
2022-01-04 16:04:16 -08:00
Ramanpreet Nara
4b9e4fa1ef
Codemod: Make Android native ViewConfigs inherit parents' bubbling/direct events
...
Summary:
# Problem
1. Static ViewConfigs on **both platforms** contain their parent component's inherited bubbling/direct events (and props).
2. On Android, native ViewConfigs for child components **do not** inherit bubbling/direct events from their parent. (They do inherit the props, however).
# Cause
How child components inherit props from their parent component on Android:
1. A ViewManager's native props are calculated by [calling ViewManager.getNativeProps()](https://www.internalfb.com/code/fbsource/[5769b6d6ca123b2bed31dc2bc6bc8e4701581891]/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelper.java?lines=139 )
2. Which [calls into ViewManagerPropertyUpdater.getNativeProps()](https://www.internalfb.com/code/fbsource/[11f0031c5e83d4d8903112d7d720b58981d3613f]/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManager.java?lines=278-280 )
3. Which [calls into a code-generated $$PropsSetter object](https://www.internalfb.com/code/fbsource/[11f0031c5e83d4d8903112d7d720b58981d3613f]/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagerPropertyUpdater.java?lines=73-74%2C112 )
4. The ReactProp annotation processor [code-generates a $$PropsSetter object](https://www.internalfb.com/code/fbsource/[cbc8ca6036219069ad52fb6aec66488b7a06a879]/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/processing/ReactPropertyProcessor.java?lines=265 ) by [visiting the ViewManager’s *entire class hierarchy* in search of ReactProp annotations](https://www.internalfb.com/code/fbsource/[cbc8ca6036219069ad52fb6aec66488b7a06a879]/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/processing/ReactPropertyProcessor.java?lines=203-230 ).
Why child components don't inherit direct/bubbling events from their parents:
1. When we get the bubbling/direct events for a component on Android, we just call into the child ViewManager, which didn't forward its parent's props (until this diff):
https://www.internalfb.com/code/fbsource/[5769b6d6ca123b2bed31dc2bc6bc8e4701581891]/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelper.java?lines=113%2C122
# Fix
Codemod all components to manually forward the bubbling/direct events from their parents.
Why Not:
- Leads to a lot of boilerplate code.
- Feels like a bandaid solution.
- Doesn’t scale to open source. There’s more process when authoring new components.
- Are thre more idiomatic alternative solutions? (See alternatives considered).
Why:
- It’s a bandaid solution, yes. And it doesn’t scale well to other components, true. But, we’re only bloating deprecated APIs. Long term, we’re going to kill off getExportedCustomBubblingEventTypeConstants() and getExportedCustomDirectEventTypeConstants().
- Our goal is to just unblock Static ViewConfigs. This is the simplest/safest/least intrusive way to accomplish our goal.
# FAQ
**If child components don't contain their parents bubbling/direct events, how can they can respond to their parent's bubbling/direct events?**
- Bubbling/direct events are stored in a [global map](https://www.internalfb.com/code/fbsource/[2de1e1d59f6e0316868a6c4d9bca5fe673210106]/xplat/js/react-native-github/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js?lines=20-34 ). Once *one* component registers a bubbling/direct event, all components [can respond to that event](https://www.internalfb.com/code/fbsource/[2de1e1d59f6e0316868a6c4d9bca5fe673210106]/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.js?lines=2439-2440 ).
**How does this component prop/event inheriting work on iOS?**
1. On iOS, ViewConfigs have a baseViewConfig property.
2. All components at least have baseViewConfig = RCTViewManager.
3. To create the native ViewConfig for the component, JavaScript runs this loop:
https://www.internalfb.com/code/fbsource/[058bc6c4976d4cebb442dd2675a2a0570a214403]/xplat/js/react-native-github/Libraries/ReactNative/getNativeComponentAttributes.js?lines=42-61
# Alternative Solutions
***Solution 1:** Make Android components leverage baseViewConfig, like iOS.*
Why Not:
- baseViewConfig leads to unnecessary round trips from JS → Native (see [this TODO](https://www.internalfb.com/code/fbsource/[a88c9751494f1ee863a76238b532fca2b134032d]/xplat/js/react-native-github/Libraries/ReactNative/getNativeComponentAttributes.js?lines=34-35 ) that tells us we should avoid this on iOS).
***Solution 2:** In [UIManagerModuleConstantsHelper](https://www.internalfb.com/code/fbsource/[6717cba1e0db71777cf11dcf7b861b171bfd0c84]/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelper.java?lines=105-145 ), which generates the native ViewConfig for Android components, use Java reflection APIs to visit the class hierarchy of all ViewManagers when collecting bubbling/direct events.*
Complications:
- **Challenging to Implement**: Have to rely on advanced Java reflection APIs. You can’t just do getSuperclass().getDeclaredMethod(...).invoke(object) to invoke an overridden method.
- **Challenging to Ship**: Would lead to a penalties when creating native view configs: either performance, or memory. This negatively impacts VR and legacy React Native android.
***Solution 3:** Create a deprecated ReactProp-like annotation (e.g: ReactEvent) but for declaring bubbling/direct events in Java ViewManagers for zero runtime cost event declaration.*
Details:
- Legacy React Native infra will be code-modded to newer ReactEvent annotation infra.
- The ReactEvent annotation processor will navigate the ViewManager’s class hierarchy at build-time to generate a class that returns the ViewManager’s bubbling/direct events.
- UIManagerModuleConstantsHelper will call into this class to get the bubbling/direct events.
- **Aside:** The component codegen can also generate these annotations. This way, all you need to do is hook up your ViewManagers to codegen to guarantee that your native component exports the right bubbling/direct events to JavaScript.
Why Not:
- This is a lot of throwaway work for just making the SVC === NVC check pass, which we're only doing to unblock the SVC migration.
Why is this throwaway work?
- Java ViewManagers don’t do anything special in native with the Bubbling/Direct events. They declare the Bubbling/Direct events for JavaScript consumption. If JavaScript is the source of truth, then there’s no value in sending these Bubbling/Direct events to Java ViewManagers.
Changelog: [Internal]
Reviewed By: JoshuaGross
Differential Revision: D33303418
fbshipit-source-id: 8d99fe80f83244443406bcfdc6cfea43b26f9c75
2022-01-04 16:04:16 -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
Pieter De Baets
589b129581
Support setting hitSlop with single value (JS changes)
...
Summary:
JS changes to support D32138347 (https://github.com/facebook/react-native/commit/a96bdb7154b0d8c7f43977d8a583e8d2cbdcb795 )
Changelog: [Android][Fixed] Enable hitSlop to be set using a single number.
Reviewed By: yungsters
Differential Revision: D32559015
fbshipit-source-id: c0409e6e5dd95b35a2a4605b16cfb48104be2858
2022-01-04 10:39:43 -08:00
Krzysztof Piaskowy
c68c47d2ba
Added missing constructor to WritableNativeArray ( #32796 )
...
Summary:
`WritableNativeMap` has two constructors:
```c++
WritableNativeMap();
WritableNativeMap(folly::dynamic &&val);
```
but `WritableNativeMap` has only one constructor:
```c++
WritableNativeMap();
```
Without a second constructor, I am not able to create `WritableNativeMap` from the existing array. I added this second constructor because I need it for `react-native-reanimated`.
## Changelog
[Android] [Added] - Added missing constructor to WritableNativeArray
Pull Request resolved: https://github.com/facebook/react-native/pull/32796
Test Plan:
```c++
std::shared_ptr<jsi::Runtime> rt = facebook::hermes::makeHermesRuntime();
jsi::Value value;
WritableNativeMap::newObjectCxxArgs(jsi::dynamicFromValue(*rt.get(), value));
```
Reviewed By: cortinico
Differential Revision: D33285316
Pulled By: lunaleaps
fbshipit-source-id: 1bbd816892f34ae6fef747066893fe3b803c088d
2022-01-02 16:17:05 -08:00
Andres Suarez
e22b760e59
Update copyright headers from Facebook to Meta
...
Reviewed By: aaronabramov
Differential Revision: D33372796
fbshipit-source-id: 51a515be3d570b53b238302a22975ec91099df06
2021-12-31 14:42:42 -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
David Vacca
f3d0a67a73
Add logs in RN Android
...
Summary:
Easy diff that adds logs in RN Android
changelog: [internal] internal
Reviewed By: sammy-SC
Differential Revision: D33350749
fbshipit-source-id: 301702ce94b684431de3c0a1bafcf318be7aecd6
2021-12-29 10:32:52 -08:00
CodemodService FBSourceClangFormatLinterBot
725bffce51
Daily arc lint --take CLANGFORMAT
...
Reviewed By: zertosh
Differential Revision: D33316567
fbshipit-source-id: cfeb96eb2adc7539b97d3a8f0de6710cd5f6ce5b
2021-12-25 08:28:35 -08:00
Richard Howell
e60f0f5034
cast implicit int to CGFloat conversions [3/3]
...
Summary: Insert casts for implicit int -> CGFloat conversions. This warning category is generally benign and explicitly casting will preserve existing behavior.
Reviewed By: NSProgrammer
Differential Revision: D33303887
fbshipit-source-id: b21adbcf754e707adfe3f8eaa0fe9c3a65380cc5
2021-12-24 09:19:42 -08:00
Andrei Shikov
a7104b03e7
Remember preallocated views on mounting layer
...
Summary:
Adds an experimental replacement for preallocation revision checks on Android mounting layer. Instead of checking revisions of props, we remember tags of preallocated/previously allocated views and use this as a filter to avoid issuing extra create and preallocate commands on copy.
This method is a bit more expensive on memory, but is more precise than relying on revisions.
Changelog: [Internal]
Reviewed By: sammy-SC, mdvacca
Differential Revision: D33038768
fbshipit-source-id: fc98c2a7912e162a3845ca80488635bffaf8cc7f
2021-12-23 18:56:51 -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
David Vacca
3e8934b49b
Enable ConcurrentRoot in RN VR apps
...
Summary:
This diff is a prototype to enable ConcurrentRoot in RN VR apps
changelog: [internal] internal
Reviewed By: sammy-SC
Differential Revision: D33200238
fbshipit-source-id: 45f700808cdc3a970bcddef858944e764a7260bd
2021-12-22 03:00:45 -08:00
David Vacca
05ce2cf259
Refactor duplicated code in ReactRootView
...
Summary:
Quick refactor of ReactRootView where I extract 'Fabric' check into a method
changelog: [internal] internal
Reviewed By: fkgozali
Differential Revision: D33269025
fbshipit-source-id: 2647d5870f3b5fcc5a940a5924a39ca43b5bebac
2021-12-22 02:57:56 -08:00
Luna Wei
679e131972
Fix remaining CircleCI eslint warnings
...
Summary: Changelog: [Internal] Fix up remaining eslint warnings
Reviewed By: TheSavior
Differential Revision: D33259372
fbshipit-source-id: 5032e64d16a67297068fb8aa8899a07382e944cd
2021-12-21 12:34:28 -08:00
Luna Wei
a63fccc259
Remove unused eslint-disable
...
Summary: Changelog: [Internal] - Fix the eslint warning of an unused disable
Reviewed By: philIip
Differential Revision: D33201539
fbshipit-source-id: a0ad449f77facaacf85ecfdc6a95cf19100f1e77
2021-12-21 12:34:28 -08:00
Xin Chen
86001da7bd
Use hit test algorithm updates for fabric only
...
Summary:
This diff gates the useage of overflowinset to hit test algorithm to fabric renderer only.
Changelog:
[Internal][Android] - Use overflowInset for fabric only
Reviewed By: JoshuaGross, mdvacca
Differential Revision: D33237281
fbshipit-source-id: e5cd78ee97f62f100d42d016241d1544fb0953ad
2021-12-21 11:56:11 -08:00