Commit Graph

2104 Commits

Author SHA1 Message Date
Nick Gerleman
29bb669adf Rebuild yarn lockfiles
Summary:
Yoga has 35 open dependabot PRs targeting these two packages. This change generates fresh lockfiles for each version, which should close most of them I think.

For each lockfile:
1. Delete lockfile
2. Run `yarn --ignore-scripts`

Full-fat rebuilds of lockfiles are normally bit dangerous compared to more targeted dependency upgrades, but rebuilding the lockfile felt like a better option because of the duration since last update, number of pending updates, and the low risk due to neither package being installable on Node 12+ at the moment.

allow-large-files

Reviewed By: mdvacca

Differential Revision: D39987360

fbshipit-source-id: 86febac73b90b6c9f1fe2345325b59d14463d28b
2022-10-03 08:03:09 -07:00
Nick Gerleman
206bf414ec Add YGGutter Enum
Summary:
This adds the YGGutter enum, used to choose between row/column gap variants (row-gap, column-gap, gap).

This used later in changes from https://github.com/facebook/yoga/pull/1116, in the APIs which deal with setting gap on style on yoga node.

Note the original PR called this `YGGap`, but this ending up leading to a couple public method signatures that could appear ambiguous:
1. `SetGap(YGGap gap, float gapLength)`: Enums like `YGAlign` are the vaues for an `align` prop. `YGGap` controls the variant of the gap (like `YGEdge` does for left/right/top/bottom variants). So the enum reads as if it is the `gapValue`, and it looks like we have two of the same parameter.
2. `SetGap(YGGap gapDirection, float gap)`: This is misleading, because the direction gaps flow is the cross-axis of flex-direction.
3. `GetGap(YGGap gap)`: `gap` is the variant, but looks like an out param.

The [CSS Box Alignment](https://www.w3.org/TR/css-align-3/#column-row-gap) spec refers to these gaps as "Gutters", which removes the ambiguity.

Changelog:
[General][Added] - Add YGGutter Enum

Reviewed By: yungsters

Differential Revision: D39922412

fbshipit-source-id: 4b0baf800fecb3d03560a4267c7fb4c4330fd39e
2022-09-29 22:25:24 -07:00
Nick Gerleman
5a18ccdbe2 Fixup Enum Generator
Summary:
https://github.com/facebook/yoga/pull/1116 adds a new enum. The enum generator is out of date with copyright header, and some codemods, but it also looks like there were manual changes, types added, etc since generation. I fixed up the script to incorporate generating the changes folks made manually, and also added an enum that was previously only added manually to the C ABI.

Changelog:
[General][Fixed] - Fixup Yoga Enum Generator

Reviewed By: yungsters

Differential Revision: D39922252

fbshipit-source-id: b678fa9a43a896873d8c434745bdaf3f16fd991f
2022-09-29 22:25:24 -07:00
Nick Gerleman
fd180de774 Fix Generation of Tests from Fixtures
Summary:
https://github.com/facebook/yoga/pull/1116 added a change to the test generator "gentests.rb" to support a newer version of chromedriver, along with a change to the enum generator (not touched in this diff) to produce code consistent with the current tests, which seem to have been manually edited since last generation.

I had trouble running the test generator locally, because it relies on unversioned third-party dependencies, whose APIs change. Looking at source history, it seems like each time someone wants to run the script, they end up updating its syntax to match whatever versions they pull in.

This change adds a Gemfile and lock so that that the version of "watir" is locked, and so that we will also automatically pull in a consistent "chomedriver" version via the "webdrivers" gem. It includes the updates from the PR to be consistent with already output tests, and I have also updated the copyright header generation to no longer create lint warnings on newly generated tests (some of the previous ones were fixed manually it looks like).

The test generator would still produce bodies which would fail clang-format, and were manually edited (causing generation to emit new lint warnings), so I updated the generator to suppress clang-format in the body of the generated files.

Three tests, around the interaction of minimum dimensions and flexible children produce different results in Chrome now compared to when the tests were added, so running `gentests.rb` creates tests which break UTs. This doesn't seem like any sort of rounding, or device specific difference, so I have disabled these tests for now. While digging around, it does look like Chrome periodically will fix bugs in its own layout implementation which cause differences, like https://bugs.chromium.org/p/chromium/issues/detail?id=927066

Reviewed By: rozele, Andrey-Mishanin

Differential Revision: D39907416

fbshipit-source-id: f88714ff038b42f935901783452df25eabb6ebb1
2022-09-29 22:25:24 -07:00
Shiping Yi
7d37b2e84b Merge TestTranscoder and TestUploader Activity into TargetedTesting Activity
Summary: move testTranscoder and TestUploader functions to TargetedTesting so that they can run batch testing for those as well, add listener for upload media composition

Differential Revision: D39299097

fbshipit-source-id: ed40a876875fdc6a0d1db8f283082da8d8dc20f7
2022-09-23 17:27:50 -07:00
Evan Charlton
97c8bbde12 fix: Correctly resolve classes with FindClass(..) (#34533)
Summary:
`JNIEnv`'s `FindClass(..)` function takes the classes in the standard
`foo/bar/Baz` class specification (unless they're special, like arrays).
Specifying them with `Lfoo/bar/Baz;` results in a
`ClassNotFoundException` being raised -- which is especially unhelpful
when intending to re-throw an exception.

The docs for `JNIEnv#FindClass(..)` can be found [here][jnienv].

[jnienv]:
  https://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/functions.html#:~:text=The%20name%20argument,java/lang/String%22

## Changelog

[Android] [Fixed] - Correctly resolve classes with FindClass(..)

X-link: https://github.com/facebook/react-native/pull/34533

Reviewed By: amir-shalem

Differential Revision: D39133326

Pulled By: jacdebug

fbshipit-source-id: 86283b7d21aed49ed0e9027b2aef85f0108cdf9a
2022-08-30 18:49:10 -07:00
Harold Pratt
fbf7a6feb5 Rewrite CompactValue to avoid undefined behavior from the use of a union for type-punning (#1154)
Summary:
C++ does not, pedantically, allow the use of unions for type-punning in the way that C does. Most compilers, in practice, do support it; however, recent versions of MSVC appear to have a bug that cause bad code to be generated due to this U.B. (see: https://developercommunity.visualstudio.com/t/Bad-code-generated-for-std::isnan-compil/10082631). This led to a series of issues in the react-native-windows project, see:
* https://github.com/microsoft/react-native-windows/issues/4122
* https://github.com/microsoft/react-native-windows/issues/8675

In C++20, the `<bit>` header and `bit_cast` function provide a pleasant API for type-punning. Since C++20 is not universally available, if the feature-test macro for `bit_cast` is not defined, memcpy is used instead.

Pull Request resolved: https://github.com/facebook/yoga/pull/1154

Reviewed By: Andrey-Mishanin

Differential Revision: D38082048

Pulled By: rozele

fbshipit-source-id: a5da08cfb7d4296c725fb44871c55dbb12dc71e5
2022-07-25 15:35:25 -07:00
Michael Sokolnicki
64f865a639 Remove MaskedViewIOS from react-native-github
Summary:
Remove MaskedViewIOS from react-native-github, update deprecation warnings, rebuild CocoaPods.

Changelog:
[General][Removed] - Remove MaskedViewIOS

Reviewed By: lunaleaps

Differential Revision: D37860775

fbshipit-source-id: 963b4b9891eecf5610cfad1e93ac8bf83f29f521
2022-07-22 17:07:26 -07:00
Sim Sun
c5a8f447b1 Bump SoLoader version to 0.10.4
Differential Revision: D37988585

fbshipit-source-id: 586bf12c76ac6d44c5d46d3e2b5551e46dbc2112
2022-07-20 15:18:18 -07:00
Ron Edelstein
a9a21d0aa6 Explicitly set language to JAVA where it is missing [xplat] (round 1)
Reviewed By: IanChilds

Differential Revision: D37594044

fbshipit-source-id: 0bbcaaed951a212651d3cc0fc3371751ced13852
2022-07-06 09:07:07 -07:00
Privacy Ownership Team
88c9b046ed Asset Ownership Update For asset://code.third_party_library/fbsource/xplat%2Fyoga%2Flib%2Fappcompat
Reviewed By: SidharthGuglani

Differential Revision: D37225485

fbshipit-source-id: 2c565d2e373ec50f69a7b8c83e56702b89ea4b68
2022-06-17 07:58:15 -07:00
Privacy Ownership Team
22eb898e8c Asset Ownership Update For asset://code.third_party_library/fbsource/xplat%2Fyoga%2Flib%2Fjunit
Reviewed By: SidharthGuglani

Differential Revision: D37141168

fbshipit-source-id: 02c2f3b58819cc8f174e5c136e1ad2e40464bcc4
2022-06-14 09:12:55 -07:00
Janic Duplessis
bfcd15e4a9 Make all headers public and add #ifdef __cplusplus (#1150)
Summary:
This change is mostly needed to support the new react-native architecture with Swift. Some private yoga headers end up being included in the swift build and result in compilation failure since swift cannot compile c++ modules. See https://github.com/facebook/react-native/pull/33381.

The most reliable fix is to include all headers as public headers, and add `#ifdef __cplusplus` to those that include c++. This is already what we do for other headers, this applies this to all headers.

Tested in the YogaKitSample, and also in a react-native app.

Changelog:
[iOS] [Changed] - Make all Yoga headers public and add #ifdef __cplusplus

Pull Request resolved: https://github.com/facebook/yoga/pull/1150

Reviewed By: dmitryrykun

Differential Revision: D36966687

Pulled By: cortinico

fbshipit-source-id: a34a54d56df43ab4934715070bab8e790b9abd39
2022-06-07 07:42:49 -07:00
Richard Howell
4d089ecc79 add missing sdk_modules
Summary: Add SDK modules that cannot be inferred from `frameworks`.

Reviewed By: jayhickey

Differential Revision: D35651890

fbshipit-source-id: 3e6dcdf3ff5db9ef9e1e05e3d4cbe3ff7e0189e3
2022-04-14 17:43:52 -07:00
Adam Ernst
2e1fa58ea5 Fix up more uses of Wno-error=
Summary: This results in compiler warnings. At the scale of our builds, warnings are useless; no one feels empowered to fix thousands of noisy warnings, so they are just noise. Turn them off.

Reviewed By: Daij-Djan, nlutsenko

Differential Revision: D35579825

fbshipit-source-id: cffb7b4ae94299b78aec057e43e87e756efd2d63
2022-04-13 10:04:19 -07:00
Hugo Cuvillier
f174de70af Use logical operator instead of bit operation
Summary:
I guess it's the same since we're working on a `bool` but... this causes some compilation error.

Changelog:
[General][iOS] - Fix compilation warning in yoga

Reviewed By: Andrey-Mishanin

Differential Revision: D35438992

fbshipit-source-id: 22bb848dfee435ede66af0a740605d4618585e18
2022-04-12 09:27:25 -07:00
caioagiani
44d8da2520 fix: typos (#33040)
Summary:
Fix typos in:

- `Libraries/Renderer/implementations/ReactFabric-dev.js`: transfered -> **transferred**
- `Libraries/Renderer/implementations/ReactNativeRenderer-dev.js`: transfered -> **transferred**
- `ReactAndroid/src/main/java/com/facebook/react/modules/network/ProgressiveStringDecoder.java`: remainderLenght -> **remainderLength**
- `ReactAndroid/src/main/jni/first-party/yogajni/jni/ScopedGlobalRef.h`: Transfering -> **Transferring**
- `ReactCommon/react/renderer/graphics/Transform.h`:  tranformation -> **transformation**
- `packages/rn-tester/js/examples/ToastAndroid/ToastAndroidExample.android.js`: occured -> **occurred**

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Internal] [Fixed] - fix typos

X-link: https://github.com/facebook/react-native/pull/33040

Reviewed By: cortinico, pasqualeanatriello

Differential Revision: D34003812

Pulled By: dmitryrykun

fbshipit-source-id: 5c8699f8efcc4354854190a9aade30dbc5c90fdb
2022-03-08 03:58:58 -08:00
Dmitry Vinnik
b4d144a546 docs: add GH button in support of Ukraine (#1134)
Summary:
Our mission at Meta Open Source is to empower communities through open source, and we believe that it means building a welcoming and safe environment for all. As a part of this work, we are adding this banner in support for Ukraine during this crisis.

Pull Request resolved: https://github.com/facebook/yoga/pull/1134

Reviewed By: cortinico

Differential Revision: D34635677

Pulled By: dmitryvinn-fb

fbshipit-source-id: 492fb66b9d4cb218f422564dcef24089c2847603
2022-03-04 11:41:41 -08:00
Keshav Kolur
fba952d5ec Remove platform specific behavior for fb_xplat_platform_specific_rule where rule = fb_prebuilt_jar
Summary: Same as title and added aliasing

Reviewed By: aniketmathur

Differential Revision: D34216617

fbshipit-source-id: 99de98d2c8264a02a8d6f7ff065adff924dd8060
2022-02-15 08:54:22 -08:00
Keshav Kolur
4d4918cdaf Replace fb_xplat_platform_specific_rule call in yoga_defs with fb_native.android_resource and add aliasing
Summary: Replace fb_xplat_platform_specific_rule call in yoga_defs with fb_native.android_resource and add aliasing

Reviewed By: alexmalyshev

Differential Revision: D34107731

fbshipit-source-id: c4d192e24cb3b86bedaa316b735c43387f6e36d4
2022-02-15 07:31:19 -08:00
Aniket Mathur
477fedd1b6 Rollout to xplat/{t..z}
Reviewed By: mzlee

Differential Revision: D33810211

fbshipit-source-id: c1a437a3834701d79461365ef503eee9fa4e75bd
2022-01-31 17:02:01 -08:00
Nolan O'Brien
bd95b3d243 Yoga: suppress warnings
Summary: There are two `yoga_defs.bzl` files... both need to be updated to suppress warnings

Differential Revision: D33393056

fbshipit-source-id: 752416af5386fc0d519689b554d2d6629d186d88
2022-01-04 10:51:28 -08:00
Andres Suarez
acbffc8485 Update copyright headers from Facebook to Meta
Reviewed By: aaronabramov

Differential Revision: D33367752

fbshipit-source-id: 4ce94d184485e5ee0a62cf67ad2d3ba16e285c8f
2021-12-30 15:11:00 -08:00
Nolan O'Brien
8123124c80 Suppress errors in xplat/yoga
Summary: Yoga (open source) has errors when `-Wconversion` is enabled.  Suppress those to be just warnings.

Differential Revision: D33330019

fbshipit-source-id: f5fad5581985942d469cb0689e706403d869323b
2021-12-29 09:24:00 -08:00
Richard Howell
b6c71ae58b disable submodules when exporting non-modular deps for ig deps
Summary:
This diff disables submodules for dependencies of IG that are not `ig_apple_library` and are exporting non-modular dependencies. This will allow for migration to using submodules as a default.

The list of targets was obtained with:
```
% buck query 'kind(apple_library, attrfilter(labels, skip_module_validation, deps(igios)) - attrfilter(labels, ig_apple_library, deps(igios)))'
```

Reviewed By: ebgraham

Differential Revision: D32399636

fbshipit-source-id: f3ba55def8001e8595fe3b1611d2de8ec38c8622
2021-11-16 09:07:39 -08:00
Jiaxi He
a6a2209902 Fix perf test path in CI job
Reviewed By: MarcioPorto

Differential Revision: D32287081

fbshipit-source-id: a856b266f986365cdb1f5006576555a28ad7a796
2021-11-09 19:04:10 -08:00
Hannes Friederich
ef490a9921 fixes to make Buck graph parse with arvr build modes
Reviewed By: javache

Differential Revision: D31990291

fbshipit-source-id: 14c7c6d16d2521f4d96b8271b371a0dd2f5ce159
2021-10-28 10:17:19 -07:00
Richard Howell
cfe21e1a60 add skip_module_validation label
Summary:
Add a label to modular libraries that are exporting non-modular deps. This will allow the upcoming tests to skip these targets for now.

#nocancel #retry_on_user_failure #notimeout #retry_on_timeout

Reviewed By: ebgraham

Differential Revision: D31320728

fbshipit-source-id: b1776d71168c282ff791030e530669a2341a9ac8
2021-10-06 14:19:15 -07:00
Athipat Pipatpinyopong
8a95fbe878 Add FBCODE specification to some targets in nonrecursive allowlist #4
Summary:
- Right now, it is only implied that fbcode can rely on these targets via the [fbcode_allowed_list_rules]((https://www.internalfb.com/code/fbsource/tools/build_defs/xplat/fbcode_allowed_list_rules.bzl))
- So, I'm making it explicit that fbcode can rely on these targets
- These targets aren't all related (just going in order of allowlist)

Reviewed By: aniketmathur

Differential Revision: D30405951

fbshipit-source-id: ad324c6d346d77d60fade9cabeae4b5622f0dab7
2021-08-24 16:30:56 -07:00
Pascal Hartig
5c3837f5f3 Default branch renames (#1102)
Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1102

Test Plan: _eyes

Reviewed By: timur-valiev

Differential Revision: D30302214

Pulled By: passy

fbshipit-source-id: 5b232136c20553883e148d10c99f9e73b8f36757
2021-08-13 08:24:14 -07:00
Lauren Bentley
578d197dd6 remove .buckversion files from fbsource/xplat
Summary: Buck has not relied on the .buckversion file for a while now. I am trying to clean up the number of configs at the root of the cell for buck. This diff attempts to remove .buckversion code referecnes from fbsource/xplat Instead of calling cat .buckversion to get the buckversion hash, you can call buck --fast-version which parses the buck-java11 file without downloading buck. Alternatively, you can also do something like cat .buck-java11 | grep -o -E -e "[0-9a-f]{40}" | head -1  to get the buckversion hash.

Reviewed By: stepancheg

Differential Revision: D28579639

fbshipit-source-id: 6231e16df41f3e403098576e4bfd5d5a2fd38a14
2021-06-18 12:20:32 -07:00
Amir Shalem
e5acf77eea Don't allocate large arrays on stack when copying native pointers, use heap based array
Summary:
Don't allocate large arrays on stack when copying native pointers, use heap based array.

Today the code copies the native pointers on the stack, since it may be too big, lets make sure to use heap based allocating using std::vector.

This array is afterwards converted into a reversed map from index to pointer, so it is heap based anyhow.

Changelog: [Internal] Don't allocate large arrays on stack when copying native pointers, use heap based array

Reviewed By: Andrey-Mishanin

Differential Revision: D28747213

fbshipit-source-id: da69b4b2d0960fdade9f07f44654b30d6dacc43a
2021-06-03 07:04:01 -07:00
Pascal Hartig
f03129728f Disable snapshot publishing (#1089)
Summary:
Currently broken. Will reenable this separately.

Pull Request resolved: https://github.com/facebook/yoga/pull/1089

Reviewed By: mweststrate

Differential Revision: D28609885

Pulled By: passy

fbshipit-source-id: 380359d09ee96d321d49c6440bde358c3e791c1a
2021-05-23 11:38:27 -07:00
Pascal Hartig
8a65d8b6dc Release GitHub actions workflow (#1088)
Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1088

Reviewed By: mweststrate

Differential Revision: D28604872

Pulled By: passy

fbshipit-source-id: e77578d44557420be9b782dc90f047af697b7cb9
v1.19.0
2021-05-21 11:41:13 -07:00
Pascal Hartig
0fcef77d7b Maven release docs (#1087)
Summary:
*Context: The Yoga OSS build has not been given a lot of attention over the past couple of years and is in serious disrepair. I'll try to get the release pipeline going again to publish to Maven Central as JCenter is shutting down. A bunch of intermediate commits may still have broken builds but will be inching closer to a working one.*

Adds some docs on how to use the release workflow.

Pull Request resolved: https://github.com/facebook/yoga/pull/1087

Reviewed By: priteshrnandgaonkar

Differential Revision: D28604686

Pulled By: passy

fbshipit-source-id: 44cac2cd0593a4f71d80df1ec5324c3c27fbe888
2021-05-21 11:41:13 -07:00
Pascal Hartig
e3a59aa50e Maven central publish (#1086)
Summary:
Sets up the plugins necessary to publish to Maven Central.

Pull Request resolved: https://github.com/facebook/yoga/pull/1086

Test Plan: ./gradlew publishToMavenLocal -PRELEASE_SIGNING_ENABLED=false

Reviewed By: mweststrate

Differential Revision: D28604529

Pulled By: passy

fbshipit-source-id: 2c35b94ce0e254bc7a8bc80e449ac5dadb5def38
2021-05-21 11:41:12 -07:00
Pascal Hartig
13e079e8f3 Upgrade Gradle setup (#1084)
Summary:
Trying to dust off the build setup and make it work again with a modern Android Studio / JVM.

Removing all JCenter setup, too, as this is no longer supported.

Pull Request resolved: https://github.com/facebook/yoga/pull/1084

Test Plan:
`./gradlew :yoga-layout:assembleDebug` works already.
Looking if CI here likes this.

Reviewed By: mweststrate

Differential Revision: D28602272

Pulled By: passy

fbshipit-source-id: 0cb86f548cc6366ccefcc92c185d6e7772e75547
2021-05-21 11:15:18 -07:00
Pascal Hartig
508f4eacdf Fix env setting and Android setup (#1085)
Summary:
*Context: The Yoga OSS build has not been given a lot of attention over the past couple of years and is in serious disrepair. I'll try to get the release pipeline going again to publish to Maven Central as JCenter is shutting down. A bunch of intermediate commits may still have broken builds but will be inching closer to a working one.*

The current way env variables are set is no longer supported for security reasons: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/. The manual Android setup is also quite tricky to maintain and can mostly be done through GitHub Actions itself.

Please note that the actual build is still failing but that's because we're so far behind with the setup here that the Gradle version no longer works on a modern JVM. I'll fix that in subsequent diffs.

Pull Request resolved: https://github.com/facebook/yoga/pull/1085

Test Plan: CI

Reviewed By: mweststrate

Differential Revision: D28602084

Pulled By: passy

fbshipit-source-id: e334ed92d16a9baa185a84b23bb62801399e5650
2021-05-21 10:11:37 -07:00
Andres Suarez
a999150c19 Apply clang-format
Reviewed By: igorsugak

Differential Revision: D28477074

fbshipit-source-id: f15dfc45b9fb30c661ebe2899cd882676d0fdf2a
2021-05-20 21:24:14 -07:00
Aditya Sharat
cbf6495d66 Refactor YogaNode.Inputs freeze API
Summary:
`InternalNode` will eventually not have a pointer to its parent. This diff removes one of the usages of the `InternalNode#getParent()` API. `InternalNode` will also not host the `YogaNode` eventually; so this diff also removes one of the usages of the `InternalNode#getYogaNode()` api.

Now the `Inputs#freeze` api will pass the parent's `YogaNode` and the `YogaNode` of the node (this) being measured.

Changelog: [Internal] Passes The YogaNode and parent YogaNode in the Inputs.freeze API

Reviewed By: SidharthGuglani

Differential Revision: D27240229

fbshipit-source-id: efc4ec3249a963c3181111f9b989d8ed9e17feb4
2021-03-30 05:42:09 -07:00
Aditya Sharat
07eaeea7a4 Create YogaProps Interface
Summary:
Create YogaProps Interface; this interface represents the inputs to YogaNode for layout calculation.

Changelog: [Internal] Create YogaProps Interface; this interface represents the inputs to YogaNode for layout calculation.

Reviewed By: mihaelao

Differential Revision: D27229274

fbshipit-source-id: 5205caf2384661369d7a2d7e7f3e49ff831a1c92
2021-03-26 10:05:14 -07:00
Altaibayar Tseveenbayar
638690255c Yoga set as a static library also for debug+release builds in x64
Summary: Yoga set as a static library also for debug+release builds in x64

Reviewed By: SidharthGuglani

Differential Revision: D27230019

fbshipit-source-id: d77e2c4130cd8303d1585723bfad927b9ddba23e
2021-03-22 07:43:09 -07:00
Altaibayar Tseveenbayar
6c2ba945be Making yoga by default a static library
Summary: We are linking yoga as a static library in most of the places

Reviewed By: SidharthGuglani

Differential Revision: D27228933

fbshipit-source-id: 725d6551198c96925ae80b3a62ef9737ee7e3052
2021-03-22 04:32:44 -07:00
Altaibayar Tseveenbayar
db6be5286e C4244 possible precision loss warning fix
Summary:
Fixing `warning C4244: 'argument': conversion from 'double' to 'float', possible loss of data`

Changelog: [Internal]

Reviewed By: SidharthGuglani

Differential Revision: D27132355

fbshipit-source-id: 55ff35be368ef4f6093865eb88c17e753250d179
2021-03-19 19:23:54 -07:00
Altaibayar Tseveenbayar
67b6c24d7b Yoga Visual Studio project file fix
Summary: Yoga Visual Studio project file was outdated. Made it back working/compilable

Reviewed By: Andrey-Mishanin

Differential Revision: D27138942

fbshipit-source-id: 5d57e61dbb415db54e255e148739c2e670f3bd23
2021-03-18 03:44:00 -07:00
Pieter De Baets
b2095801ba Simplify YGNodeEmptyContainer / YGNodeWithMeasureFunc / YGNodeFixedSize
Summary:
These methods are only ever called just after setting the various YGStyle props. Therefore we can read any padding / margin / border state from there rather than recalculating it.

Changelog: [Internal]

Reviewed By: SidharthGuglani

Differential Revision: D27010098

fbshipit-source-id: a33f879b25c54cfdb0ffc724b6aa325858e97df5
2021-03-15 16:54:58 -07:00
Pieter De Baets
e87f429703 Simplify YGNodeCalculateAvailableInnerDim
Summary:
Avoid recalculating margin and padding by pre-subtracting the margin from `availableWidth` and inlining the calculation of `paddingAndBorderAxisCross`.

Changelog: [Internal]

Reviewed By: SidharthGuglani

Differential Revision: D27010094

fbshipit-source-id: afc3cf251a0306b9e5d7f0dc6856feee8d1dca6e
2021-03-15 16:54:58 -07:00
Pieter De Baets
41384fab7b Optimize edge value resolution
Summary:
Noticed in simpleperf this was a very hot method, showing 8ms spent in these methods in our sample application. By splitting the method out in a horizontal and vertical variant we can simplify cases enormously and check for begin/end in one go.

Changelog: [Internal]

Reviewed By: SidharthGuglani

Differential Revision: D27010008

fbshipit-source-id: 22fed58c7476e1d716b0191b55997c7a06e63223
2021-03-15 16:54:55 -07:00
Eric Rozell
342aebe1d7 Fixes layout of nodes with YGDisplayNone and YGPositionTypeAbsolute (#1068)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1068

There is an issue in react-native when the Yoga node position type is set to absolute and display: none is set where the node layout calculation gives the absolute dimensions, rather than the expected 0 x 0.

Here are some OSS issues tracking this:
https://github.com/facebook/react-native/issues/18415
https://github.com/microsoft/react-native-windows/issues/7289

## Changelog

[General] [Fix] - Fixes layout of nodes with YGDisplayNone and YGPositionTypeAbsolute

Reviewed By: Andrey-Mishanin

Differential Revision: D26849307

fbshipit-source-id: 197618aa3c4e1b3b7efeba7ea4efd30b2d1c982d
2021-03-10 13:10:32 -08:00
Andrew Coates
1745c23a12 Fix various C++ warnings (#31002)
Summary:
Fix warnings about implicit type truncation.

## Changelog

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

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

Test Plan:
Almost all the changes here are simply making explicit conversions which are already occurring.  With the exception of a couple of constants being changed from doubles to floats.

With these changes I am able to remove a bunch of warning suppressions in react-native-windows.

Reviewed By: shergin

Differential Revision: D26900502

Pulled By: rozele

fbshipit-source-id: d5e415282815c2212a840a863713287bbf118c10
2021-03-10 12:38:12 -08:00