Commit Graph

2008 Commits

Author SHA1 Message Date
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
Stiopa Koltsov
ccdea0f31b xplat: switch random files to Starlark
Summary:
We need to get rid of all `# BUILD FILE SYNTAX: PYTHON_DSL` to disable hybrid parser after we make Starlark default everywhere.

This is first bunch of changes.

Reviewed By: mzlee

Differential Revision: D26727784

fbshipit-source-id: 05c5f4d039feb4ce06169ac6d2fc5c49711125cd
2021-03-01 13:15:11 -08:00
Sidharth Guglani
c1a28f3f54 Add back snapshot in version for next release
Summary: Changelog: [Internal][Yoga] version bump

Reviewed By: pasqualeanatriello

Differential Revision: D26664063

fbshipit-source-id: ceb8d31a99f85db7d1fde20bd77584a537d356c6
2021-02-25 06:36:06 -08:00
Sidharth Guglani
0429704d5e version bump
Reviewed By: pasqualeanatriello

Differential Revision: D26664041

fbshipit-source-id: 5a4d0d176074c8831dd18681993463fe25e2642f
2021-02-25 06:36:05 -08:00
Sidharth Guglani
36e70c9ca0 Fix Yoga test
Summary: Changelog: [Internal][Yoga] Fixed unit test for default yoga style property

Reviewed By: pasqualeanatriello

Differential Revision: D26664040

fbshipit-source-id: 9c0af4e846ead3d90c75753e836570ccac760178
2021-02-25 06:36:02 -08:00
Aditya Sharat
de36e85004 Adds InternalNode#freeze() API
Summary:
Litho needs a new API which is called immediately before yoga begins layout calculations so that the InternalNode gets the opportunity to finalise itself; i.e. perform the last mutations and in effect avoid any more mutations to the hierarchy.

See D26373731 where the mutations from `Layout#collectResults` is moved back into the InternalNode.

Changelog: [Internal]  Adds new API to YogaNodeJNIBase

Reviewed By: SidharthGuglani

Differential Revision: D26373730

fbshipit-source-id: 471346d3444986ada91e86c95f5f9fb98bcd2fa6
2021-02-16 10:19:23 -08:00
Ruslan Serebriakov
651c527e94 CKDimension
Summary:
[rsrbk@devvm3461.lla0 /data/users/rsrbk/fbsource/fbobjc] fastmod --accept-all CKRelativeDimension RCRelativeDimension
[rsrbk@devvm3461.lla0 /data/users/rsrbk/fbsource/fbobjc] fastmod --accept-all CKRelativeSize RCRelativeSize
[rsrbk@devvm3461.lla0 /data/users/rsrbk/fbsource/fbobjc] fastmod --accept-all ComponentKit/RCDimension.h RenderCore/RCDimension.h

Reviewed By: kfirapps

Differential Revision: D26228615

fbshipit-source-id: 9c06128b324e1c6ece6fc21fbab1c041e5f5825a
2021-02-11 10:39:22 -08:00
Sidharth Guglani
2cb46cf3e2 instance of checks for YogaNodeJniBase
Summary:
Changelog:
[Internal][Yoga] - Added instance of checks in `YogaNodeJNIBase` class to prevent `ClassCastException`s. This was happening for some NT android tests - Mocked Yoga Node object was being passed in the `addChildAt` api

Stack Trace of exception
    java.lang.ClassCastException: com.facebook.yoga.YogaNode$MockitoMock$1408896622 cannot be cast to com.facebook.yoga.YogaNodeJNIBase
	at com.facebook.yoga.YogaNodeJNIBase.addChildAt(YogaNodeJNIBase.java:86)
	at com.facebook.litho.DefaultInternalNode.addChildAt(DefaultInternalNode.java:220)
	at com.facebook.litho.DefaultInternalNode.child(DefaultInternalNode.java:377)
	at com.facebook.litho.DefaultInternalNode.child(DefaultInternalNode.java:360)
	at com.facebook.litho.Column.resolve(Column.java:118)
	at com.facebook.litho.Layout.create(Layout.java:172)

Reviewed By: Andrey-Mishanin

Differential Revision: D26114992

fbshipit-source-id: 774a689609e67f9244b81c6788b62cd61cd96d14
2021-02-05 03:42:10 -08:00
Andres Suarez
584dfe961e Apply clang-format update fixes
Reviewed By: igorsugak

Differential Revision: D25861849

fbshipit-source-id: 840dc1061e557717c7f9ffcccbc09c24b96b78e0
2021-01-10 10:05:56 -08:00
Panagiotis Vekris
a38ec3d7a4 pin "classic" roots to v0.140
Summary:
In Flow v0.143 types-first will become the only supported mode in Flow.
As such the `types_first` configuration option will become invalid. To
prevent breaking roots that have `types_first=false` set and are **unversioned**,
this diff pins their version to v0.140, which is the last released version in fbsource.

## Repro

First compute the list of all `.flowconfig`s:
```
zbgf '.flowconfig$' | grep -v '^fbsource/fbcode/flow' | grep -v 'Binary file' | awk -F':' '{ print $1 }' | sort -u > all-flowconfigs.txt
```
Compute `.flowconfig`s that don’t have a version:
```
zbgs -f '\.flowconfig' '[version]' |  grep -v '^fbsource/fbcode/flow'  | grep -v 'Binary file' | awk -F':' '{ print $1 }' | sort -u > versioned-flowconfigs.txt
comm -23 all-flowconfigs.txt versioned-flowconfigs.txt > unversioned-flowconfigs.txt
```
Compute `.flowconfig`s that have `types_first=false`:
```
zbgr -f '\.flowconfig' '^types_first=false$' |  grep -v '^fbsource/fbcode/flow'  | grep -v 'Binary file' | awk -F':' '{ print $1 }' | sort -u > types_first-false-flowconfigs.txt
```
**and** no pinned version:
```
comm -12 unversioned-flowconfigs.txt types_first-false-flowconfigs.txt | grep 'fbsource' > pin-version-flowconfigs.txt
```
Update the `.flowconfig`s:
```
cat ~/scratch/flowconfigs/pin-version-flowconfigs-fbsource.txt | xargs -I{} bash -c 'printf "\n[version]\n^0.140.0\n" >> {}'
```

Reviewed By: mroch

Differential Revision: D25771452

fbshipit-source-id: 876d6310e4e1aafb81d3ef3051f4e9e9e838a633
2021-01-04 21:06:15 -08:00
Ron Edelstein
b043669972 Explicitly set autoglob (long tail)
Reviewed By: fbanurag, strulovich

Differential Revision: D25620908

fbshipit-source-id: 1dd737d451ddfd07baa427902bdf1c96d7e67e64
2020-12-17 19:34:48 -08:00
Kris Georges
e65b1ef654 Fix Yoga Playground website Litho codegen bugs
Summary:
Yoga Playground website

changing direction results in no change to Litho code because of this typo

Reviewed By: SidharthGuglani

Differential Revision: D24818769

fbshipit-source-id: 1633513d4a25aead2008b59d52f669293214c598
2020-11-10 08:22:42 -08:00
Pasquale Anatriello
07eac0c6e2 Fix clone issue in YogaNodeJNIBase
Summary:
Changelog:
Fix the cloneWithChildren implementation that was not copying the list of children on the java object.

We were missing on copying the list of children when cloning. This is pretty bad as it means that the clone operation was mutating the old node as well as the new. When multiple threads were involved this could cause crashes.

Reviewed By: SidharthGuglani

Differential Revision: D24565307

fbshipit-source-id: 4e2e111db389e25c315ce7603b4018ac695bb0f1
2020-10-29 09:25:03 -07:00
simek
64e2459427 remove most of tvOS remnants from the code (#29407)
Summary:
Refs: [0.62 release](https://reactnative.dev/blog/#moving-apple-tv-to-react-native-tvos), https://github.com/facebook/react-native/issues/28706, https://github.com/facebook/react-native/issues/28743, https://github.com/facebook/react-native/issues/29018

This PR removes most of the tvOS remnants in the code. Most of the changes are related to the tvOS platform removal from `.podspec` files, tvOS specific conditionals removal (Obj-C + JS) or tvOS CI/testing pipeline related code.

In addition to the changes listed above I have removed the deprecated `Platform.isTVOS` method. I'm not sure how `Platform.isTV` method is correlated with Android TV devices support which is technically not deprecated in the core so I left this method untouched for now.

## 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] [Removed]** - remove most of tvOS remnants from the code:
  * `TVEventHandler`, `TVTouchable`, `RCTTVView`, `RCTTVRemoteHandler` and `RCTTVNavigationEventEmitter`
* **[Internal] [Removed]** - remove `TARGET_TV_OS` flag and all the usages
* **[iOS] [Removed]** - remove deprecated `Platform.isTVOS` method
* **[iOS] [Removed]** - remove deprecated and TV related props from View:
  * `isTVSelectable`, `hasTVPreferredFocus` and `tvParallaxProperties`
* **[iOS] [Removed]** - remove `BackHandler` utility implementation

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

Test Plan: Local tests (and iOS CI run) do not yield any errors, but I'm not sure how the CI pipeline would react to those changes. That is the reason why this PR is being posted as Draft. Some tweaks and code adjustment could be required.

Reviewed By: PeteTheHeat

Differential Revision: D22619441

Pulled By: shergin

fbshipit-source-id: 9aaf3840c5e8bd469c2cfcfa7c5b441ef71b30b6
2020-09-28 21:26:01 -07:00
Panagiotis Vekris
f350c7a58e explicitly set types_first=false in flowconfigs
Summary:
In Flow version 0.134, [types-first](https://flow.org/en/docs/lang/types-first/) will become the default mode for Flow.
Given that this mode might introduce some errors due to missing annotations,
we're pinning the previously default mode, to avoid introducing new errors.

Note that in Jan 2021 we will be removing support for Flow classic mode.

* Documentation for properly upgrading to types-first: https://flow.org/en/docs/cli/annotate-exports/
* Announcement post: https://medium.com/flow-type/types-first-a-scalable-new-architecture-for-flow-3d8c7ba1d4eb

Reviewed By: mroch

Differential Revision: D23606450

fbshipit-source-id: f849275269974e17c0ebe00885e387ccd9956b6d
2020-09-10 16:13:45 -07:00
Paco Estevez Garcia
e0ae96368c Add DoNotStripAny
Summary:
This diff adds an annotation that also prevents stripping methods, fields and static blocks.

This is necessary for D23373168 to be OSS'd

Reviewed By: SidharthGuglani

Differential Revision: D23395925

fbshipit-source-id: 8456234cb75b15ae87580835e76f8e251ba09a9b
2020-08-28 06:44:45 -07:00
Jiawei Lv
e1c9d8800e Assign test_ownership_2020 as owner for unowned java tests in fbandroid
Summary: Changelog: [Internal]

Reviewed By: IanChilds

Differential Revision: D22980855

fbshipit-source-id: d5e394f16eaf0e50367b95b1eec98024b906d3d9
2020-08-11 17:19:05 -07:00
Thomas Nardone
084d5935e6 Tweak stdlib imports in event, utils
Summary:
Changelog:
[Internal][Fixed] - Tweaked stdlib imports

Reviewed By: SidharthGuglani

Differential Revision: D22860196

fbshipit-source-id: fc0fc1bf05ebbfae7e86bce5e960e58d5944ee5c
2020-08-03 09:39:32 -07:00
Valentin Shergin
fc88b2f774 Introducing YGPositionTypeStatic
Summary:
Changelog: [Internal] Fabric-specific internal change.
This diff introduces a new value for `YGPositionType`: `YGPositionTypeStatic`.
No part of Yoga, RN, Litho or CK uses this value yet. `relative` and `static` values behave the same way for now. We also do not change any defaults. So, it should be fine.

Reviewed By: SidharthGuglani

Differential Revision: D22386732

fbshipit-source-id: 39cd9e818458ac2a91efb175f24a74c8c303ff08
2020-07-20 00:33:02 -07:00
Stanislau Hlebik
5ac5624e3f remediation of S205607
fbshipit-source-id: 798decc90db4f13770e97cdce3c0df7d5421b2a3
2020-07-17 17:23:52 -07:00
Stanislau Hlebik
16f676eccf remediation of S205607
fbshipit-source-id: 5113fe0c527595e4227ff827253b7414abbdf7ac
2020-07-17 17:23:51 -07:00
Valentin Shergin
0767f4d105 Using YGPositionTypeAbsolute value where we compare absolute vs relative
Summary:
Now Yoga.cpp does not use the `YGPositionTypeRelative` value/constant, it uses `YGPositionTypeAbsolute` instead.
Now `YGPositionType` can only be `YGPositionTypeRelative` or `YGPositionTypeAbsolute`, so expressions `x == YGPositionTypeRelative` and `x != YGPositionTypeAbsolute` are equivalent.
The reasoning behind the change is that in all cases we actually check a node to be (or not to be) `absolute`, not `relative`. This will make a difference in the coming diffs in the stack when we will introduce a new value for the type: `static`.

We need to differentiate `static` and `relative` values t implement the `stacking context` feature in the W3C-compliant way (to fix bugs and avoid developer confusion). Read more here:
https://developer.mozilla.org/en-US/docs/Web/CSS/position

Changelog: [Internal] Internal change in Yoga.

Reviewed By: SidharthGuglani

Differential Revision: D22386733

fbshipit-source-id: 8e2c2b88b404660639f845783c8f93f0c62c0fbb
2020-07-14 15:31:07 -07:00
Amir Shalem
a93e5d63c9 Don't call config->setLogger(nullptr) directly to avoid having no logger at all
Summary:
Changelog: [Internal][Yoga] Don't call config->setLogger(nullptr) directly to avoid having no logger at all

Broken in D14151037 (05f36a835a) when it started calling
```
config->setLogger(nullptr);
```
instead of going thru
```
YGConfigSetLogger(config, nullptr);
```
which does the right thing by setting the logger to its default value:
https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/yoga/yoga/Yoga.cpp?commit=835911317e8b3cf7da1866e40e1c79cda0690136&lines=4320-4330

Also by default YogaConfig always have a logger:
https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/yoga/yoga/Yoga.cpp?commit=835911317e8b3cf7da1866e40e1c79cda0690136&lines=335-343

Reviewed By: SidharthGuglani

Differential Revision: D22387459

fbshipit-source-id: 4da91da87a696d38cc9d8db2acb5845d29398adb
2020-07-06 03:53:19 -07:00
Stiopa Koltsov
d74a1069a0 xplat: Disable Starlark in several files
Summary: Disable Starlark in several files which are not trivial to fix.

Reviewed By: scottrice

Differential Revision: D22202463

fbshipit-source-id: a3ff717f0f4b9cd7f492b8fcebdb91f232207222
2020-06-24 12:29:48 -07:00
Sidharth Guglani
633cdc9088 use fmod and YGDoubleEquals for double operations instead of float
Summary: Changelog: [Internal][Yoga] Use double operations during rounding

Reviewed By: mdvacca

Differential Revision: D21840018

fbshipit-source-id: c5d17fcb8984b1da9832a15ccd4d628e8d742c6a
2020-06-08 08:11:18 -07:00
Steven Koeber
ede65bbce4 Buckification of Yoga build script
Reviewed By: liorisraeli87, k21

Differential Revision: D21429174

fbshipit-source-id: f12c8349cc59398553773df7bc15f0f83bd571b4
2020-06-04 06:54:18 -07:00
Jon Janzen
4135420cba Fix GitHub Actions secrets access (#1005)
Summary:
Ref: [Secrets documentation](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#using-encrypted-secrets-in-a-workflow)

In combination with setting the secrets in the GitHub settings, this should fully migrate yoga to GH actions.

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

Test Plan: GitHub Actions CI on the PR attached to this diff

Reviewed By: SidharthGuglani

Differential Revision: D21574995

Pulled By: bigfootjon

fbshipit-source-id: e9ee6d7cf1ae131afdc3aa3778667f1e9b9de833
2020-05-14 12:21:28 -07:00
Sidharth Guglani
07c0d539bd throw std::logic_error instead of aborting the process and convert to java exception
Summary: Changelog: [Internal][Yoga] throw std::logic_error instead of aborting the process and convert to java exception for jni layer

Reviewed By: pasqualeanatriello

Differential Revision: D21301235

fbshipit-source-id: 148b27920e62990a271e1d0df8c85a2cc42f4fd4
2020-05-14 06:39:25 -07:00
Jon Janzen
ac7c85c0a6 Migrate CI from TravisCI to GitHub Actions (#1004)
Summary:
Migrate from TravisCI to GitHub Actions. Facebook employees can read about this migration [here](https://fburl.com/rfp033ou).

CC: wittgenst
Pull Request resolved: https://github.com/facebook/yoga/pull/1004

Test Plan: GitHub Actions CI on my personal GitHub: https://github.com/bigfootjon/yoga/runs/653755729

Reviewed By: passy

Differential Revision: D21431309

Pulled By: bigfootjon

fbshipit-source-id: 490a8679bc0cfec26b13c8c584a928f03c6e26e7
2020-05-12 12:01:53 -07:00
Sidharth Guglani
83b27417ae Fix rounding error using double instead of float
Summary: Changelog: [Internal] [Yoga] Use double instead of float during rounding process to prevent loss of precision.

Reviewed By: mdvacca

Differential Revision: D21227565

fbshipit-source-id: 380b57535a356624cda8dc2017871a4ef3c882d1
2020-04-27 14:48:15 -07:00
Valentin Shergin
884f147742 Fixed incorrect owner assignment in YGNode move constructor
Summary:
Assigning self as an owner makes a cycle which is obviously a bug.

Changelog: [Internal] Small change in Yoga (should not affect RN).

Reviewed By: SidharthGuglani

Differential Revision: D21111423

fbshipit-source-id: 1835561c055ac827f5ce98a044f25aed0d1845a5
2020-04-20 12:05:55 -07:00
Gavin Weng
a96a36ef59 Link yogacore statically into yoga
Summary: A revert of D20879886.

Reviewed By: iliagore

Differential Revision: D20979490

fbshipit-source-id: cb37f931654450c408e72578abcc549f35727b07
2020-04-17 17:34:17 -07:00
acton393
1bd4123df1 fix typo as there is no file called YGJNI.cpp (#990)
Summary:
fix typo in `YogaJNIBase.java` as there is no such file called `YGJNI.cpp`
Pull Request resolved: https://github.com/facebook/yoga/pull/990

Reviewed By: pasqualeanatriello

Differential Revision: D20735102

Pulled By: SidharthGuglani

fbshipit-source-id: 3f9f4d78ba390feae3451330f997a221ab4ec70e
2020-04-17 05:45:41 -07:00
Sidharth Guglani
92b76447b7 use default value of enums YGDirection and YGMeasureMode instead of -1
Summary:
Changelog:
[Internal][Yoga] YGDirection variable was initialized incorrectly by casting -1 to YGDirection. Changing it to default value of direction

Same for YGMeasureMode.

Reviewed By: pasqualeanatriello

Differential Revision: D20869042

fbshipit-source-id: 7bfe490193321baae875ef6fb49a938851950c9f
2020-04-17 05:32:05 -07:00
Sidharth Guglani
e637cf2d72 Add Yoga also as a dependency of testutil-jni
Summary:
`scripts/deploy_jcenter.sh` was failing

{F234018047}

Added `yoga` also as a dependency of `testutil-jni`

Reviewed By: gavinweng

Differential Revision: D21017796

fbshipit-source-id: 0c34e7fc2373906441bd7805f5687b2c5dab6242
2020-04-15 00:49:53 -07:00
empyrical
9b96a5362a Yoga Podspec: Export YGNode and YGStyle headers (#997)
Summary:
This pull request adds `YGNode.h` and `YGStyle.h` to the headers exported by Yoga's podspec. They are required by the new Fabric architecture of React Native.

The modulemap and its umbrella header automatically generated by Cocoapods adds all exported headers to the `modulemap`. Having YGNode and YGStyle exported through here has problems, because they are only available in environments that have C++ available, and will produce errors otherwise.

This pull request fences off the contents of those headers in an `#ifdef __cplusplus` block, so they will not cause errors when imported into environments where C++ isn't available.

I had considered adding a custom modulemap to the podspec as part of this pull request, but this way seems the least "invasive", and this way you are able to add and remove exported headers in the podspec without needing to worry about updating the umbrella header at the same time.

Changelog:

[Internal] - Yoga Podspec: Export YGNore and YGStyle headers

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

Reviewed By: hramos

Differential Revision: D20966075

Pulled By: mdvacca

fbshipit-source-id: 5f5caa6b639d11e660b968d681da9a4de6c0eb8e
2020-04-14 16:42:27 -07:00
Sidharth Guglani
e5743e851b Set width/height also to Undefined when we change the measure mode to Undefined
Summary:
Make sure width/height is always passed as Undefined when measure mode is changed to Undefined.

Changelog: [Internal][Yoga] Set width and height as Undefined when we change measure mode to Undefined

Reviewed By: alickbass

Differential Revision: D20029838

fbshipit-source-id: b9931f6ddb13ffd1565889535ade5bbffbe0c304
2020-04-14 02:09:29 -07:00
George Zahariev
f7bc0ad248 Upgrade Prettier in Xplat to version 1.19.1: format files
Summary:
Part two of D20879147 where we update the versions of Prettier used in Xplat. I will stack land the diffs.
Here, we format all the files, and use the drop conflicts flag. After this lands, I will go and format the files which had conflicts again.

Changelog: [Internal]

drop-conflicts
bypass-lint
allow-large-files

Reviewed By: gkz

Differential Revision: D20929844

fbshipit-source-id: 2c1df8966a48b5db4f890e2cc494cb1c69422b7d
2020-04-09 11:06:06 -07:00
George Zahariev
8c53c2dcca Upgrade Prettier in Xplat to version 1.19.1
Summary:
Upgrades Prettier in Xplat to 1.19.1
Ignores upgrading packages on already on versions greater than 1.19.1

Changelog: [Internal]

allow-large-files
bypass-lint

(Note: this ignores all push blocking failures!)

Reviewed By: gkz, cpojer

Differential Revision: D20879147

fbshipit-source-id: 0deee7ac941e91e1c3c3a1e7d3d3ed20de1d657d
2020-04-09 11:06:04 -07:00
Gavin Weng
be51bc44a4 Revert Name Change for FBLite
Summary: To unblock

Reviewed By: Arieg419

Differential Revision: D20879886

fbshipit-source-id: 428f9147e540b94dec7f72a7f844949722165a07
2020-04-06 19:53:50 -07:00
Gavin Weng
5eba2d42bd Enhance build process (#994)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/994

After building yoga aar, we found several issues:
1. More dynamic so files. This is bad as lower-end Android devices cannot load that many sos.
2. Size increase.
3. (Minor) The libs are stored in asset folder rather than "libs/".

We apply the following optimizations:
1. Remove dependency on memalign16 (this is brought in by a pure header dependency jni-hack);
2. Enable native relinker to remove unused symbols in the so files.
3. Link yogacore statically to reduce size churn.

Reviewed By: SidharthGuglani

Differential Revision: D20808623

fbshipit-source-id: 6c6bbd4f71b6bf6ad272ec05dd56696ddb14a8e0
2020-04-06 11:51:16 -07:00
Sidharth Guglani
2049c85a6c Unit tests for flexshrink min width cases
Reviewed By: pasqualeanatriello

Differential Revision: D20219428

fbshipit-source-id: 8cbd028627095d9f7b393489ddba1f31c3207b67
2020-04-01 14:56:49 -07:00
Sidharth Guglani
ecd7790dd8 Fix Yoga flexshrink with min-width sizing issue
Summary:
While resolving the flexible items we calculate totalFlexShrinkScaledFactors which uses the flexBasis or initial width of node (Not min-width).

At a later stage during distribution of space we are subtracting value from this which also takes care of min-width.

For example
If node has flexShrink 1 and width 100 and min-width 301  then totalFlexShrinkScaledFactors will become -1*100 = -100
but later we are subtracting -1 * 301 (min-width) = -301 which is ambiguous and causing layout inconsistencies with how web behaves.

Fixed this by only using the flexBasis or width for these calculations.

Changelog:
[Internal][Yoga] Fix layout issue when flexShrink and min-width are used together

Reviewed By: pasqualeanatriello

Differential Revision: D20219419

fbshipit-source-id: 948fbc06ca541d4ad307c88c8a2df65d157778b1
2020-04-01 14:56:45 -07:00
Michael Bolin
0f08aa53da Back out "Upgrade Prettier from 1.17 to 2.0.2."
Differential Revision: D20639755

fbshipit-source-id: 5028563f9cf0527a30b4259daac50cdc03934bfd
2020-03-24 21:41:08 -07:00
Michael Bolin
5bf93e81ba Upgrade Prettier from 1.17 to 2.0.2.
Summary:
This gets us on the latest Prettier 2.x:
https://prettier.io/blog/2020/03/21/2.0.0.html

Notably, this adds support for TypeScript 3.8,
which introduces new syntax, such as `import type`.

Reviewed By: zertosh

Differential Revision: D20636268

fbshipit-source-id: fca5833d003804333a05ba16325bbbe0e06d6c8a
2020-03-24 20:26:19 -07:00
Lior Israeli
4f1231f411 Fix typo in buck targets
Summary: Proguard is spelled wrong

Reviewed By: SidharthGuglani

Differential Revision: D20619173

fbshipit-source-id: 463788454ad7e72337121ed63ab79129db45113e
2020-03-24 05:37:47 -07:00
Adam Ernst
b280a19b0a Run 'arc lint-deps'
Reviewed By: d16r

Differential Revision: D20362505

fbshipit-source-id: f3b7e62f7665d20a32788042772b731d6ed53f36
2020-03-10 10:58:46 -07:00