Commit Graph

1479 Commits

Author SHA1 Message Date
David Vacca
f4d29e6f11 Avoid cleaning up Owner of YGNode during clonning
Summary:
This diff refactors the cloning mechanism for YogaNode used from Fabric UI renderer and RN iOS graphs.
Previously, we were cleaning the owner of the child's cloned node inside the C++ implementation of YogaNode. This was a mistake because this modified the last commited YogaTree, causing side effect in RN iOS graphs.

Reviewed By: shergin

Differential Revision: D8672627

fbshipit-source-id: c9902d00690e0361fd58aed84b506c42258bd995
2018-06-28 22:47:50 -07:00
Peter van der Zee
77ea79490f Upgrade Prettier to 1.13.6 on fbsource
Reviewed By: zertosh

Differential Revision: D8638504

fbshipit-source-id: c6991b2e884e14868ddc1d9047a78191219d673f
2018-06-27 03:28:16 -07:00
Pascal Hartig
46c96ee2cb Upgrade fbjni
Summary:
Sync fbjni with `libaries/fbjni`.

This includes a hack to fix a deadlock we found for cmake-debug variants only. This still gets us back in sync with other fbjni consumers which is going to save us trouble in the future if Yoga ever wants to make use of a newer feature.

Manual changes made in addition to the hand-crafted CMakeLists and cxx buck rules:

- `jni::isObjectRefType` has SDK lookup disabled.
- `fbjni/` path is changed back to `fb/` to retain compatibility with Yoga.

Reviewed By: priteshrnandgaonkar

Differential Revision: D8531991

fbshipit-source-id: 776f519e2e5f9bea37f55990348f7ed81c4860b4
2018-06-26 04:58:58 -07:00
Taras Tsugrii
a67c555320 Fix deprecated glob usage.
Summary: https://our.intern.facebook.com/intern/wiki/Buck/python-to-skylark/

Differential Revision: D8595731

fbshipit-source-id: 0e3046a7fd2a25e9b13462713ae9a008ad546770
2018-06-23 18:27:38 -07:00
David Vacca
cdb1ee21a0 Clean-up parent / owner reference of children during clonning
Summary: This diff cleans up the parent / owner references for children of ReactShadowNode / YogaNode during cloning. The reason of this behavior is to avoid retaining every generation of trees during cloning. This fixes a memory leak detected when running the ProgressBarExample.android.js in catalyst app

Reviewed By: fkgozali

Differential Revision: D8019894

fbshipit-source-id: b0d38f0c836ffec534f64fa1adbd7511ecf3473d
2018-06-22 11:44:14 -07:00
Oleksii Dykan
2ce219ef42 Fix componentkit generator (#785)
Summary:
Fixes some inconsistencies in yoga playground
Closes https://github.com/facebook/yoga/pull/785

Reviewed By: danielbuechele

Differential Revision: D8480993

Pulled By: alickbass

fbshipit-source-id: 395d77bae28462d3e03d666287bdc64137b84c68
2018-06-18 09:12:49 -07:00
Simon Egersand
c5f826de83 Use correct spelling ('then' -> 'than') (#782)
Summary:
Might be the smallest PR in the world, but it caught my eye reading the
docs so I figured I should fix it.
Closes https://github.com/facebook/yoga/pull/782

Reviewed By: emilsjolander

Differential Revision: D8351525

Pulled By: jknoxville

fbshipit-source-id: fc7a881f062e07d2e28b5ca2da8c52f20bad53be
2018-06-12 04:12:23 -07:00
Vince Mi
526ca42d04 Add back deprecated getParent methods for non-breaking API change (#775)
Summary:
I'm not totally sure what I'm doing so if this needs changes let me know.
Closes https://github.com/facebook/yoga/pull/775

Reviewed By: emilsjolander

Differential Revision: D8331892

Pulled By: passy

fbshipit-source-id: eb1023e666322d2472e4081fd4a4e72a7b43d049
2018-06-11 04:12:26 -07:00
Peter van der Zee
b47f0ce41a Bump Prettier to 1.13.4 on xplat
Summary:
@public

Bump Prettier to use version 1.13.4
All code changes are caused by running Prettier and should only affect files that have an `format` header.
All other changes caused by yarn.

Reviewed By: ryanmce

Differential Revision: D8251255

fbshipit-source-id: 0b4445c35f1269d72730f2000002a27c1bc35914
2018-06-06 05:44:55 -07:00
Andres Suarez
eb7cb11ffd Run buildifier over BUCK and TARGETS files
Reviewed By: scottrice

Differential Revision: D8163151

fbshipit-source-id: 700a77c09c6ab1bef8fd24a2a3133a4b50e3b3a3
2018-05-25 11:25:46 -07:00
Daniel Büchele
f9df990177 link to playground in embedded playgrounds
Summary:
The "copy share URL" button only works in the standalone playground, not the ones embedded on the landing page or the documentation, because, we don't want people to share a link to a modified documentation page.

This diff replaces the share URL button with a link to a standalone playground which then can be shared.

Reviewed By: astreet

Differential Revision: D8125135

fbshipit-source-id: 8b69b69caeadf5d598ed89b0abd9b742f5f07a9c
2018-05-24 12:25:52 -07:00
Andres Suarez
684dccb7b9 Run buildifier over all bzl files
Reviewed By: yfeldblum, ttsugriy

Differential Revision: D8087092

fbshipit-source-id: 3b298d0a81ed65454649df8c80bffca2ec5651de
2018-05-22 07:33:43 -07:00
Taras Tsugrii
6c51eb4f72 Re-format BUCK to use recommended style.
Summary:
This uses the latest version of `buildifier` that supports many
more Skylark syntax features.

Reviewed By: yfeldblum

Differential Revision: D8073585

fbshipit-source-id: 12322aebc09b89d5af9cc257b16c1bc0fbb066c1
2018-05-20 23:40:18 -07:00
Taras Tsugrii
ca485dfb50 Re-format .bzl to use recommended style.
Summary:
This is to make them `buildifier` compatible in order to start using
`buildifier` for all .bzl files.

Differential Revision: D8069457

fbshipit-source-id: f5bce02a3e6ba8dc4ccbf5bae70de224c30cbd64
2018-05-19 18:12:01 -07:00
Emil Sjölander
50e3714b21 bump pod version
Reviewed By: priteshrnandgaonkar

Differential Revision: D8025017

fbshipit-source-id: 187c4a3b0ec47bc7bcbc599049941bed069dc2f7
2018-05-16 08:44:29 -07:00
Pritesh Nandgaonkar
c52c7cdd1e Fix podspec issue
Summary: Fix yoga podspec issue. The newly released versiong of Yoga i.e 1.8.0 was not building on iOS. So fixing the bug. Want to use this pod in SonarKitLayout

Reviewed By: emilsjolander

Differential Revision: D8024641

fbshipit-source-id: c8d7279e654145199fbee6655909e1c10d8b2114
2018-05-16 07:19:15 -07:00
Daniel Büchele
11200f3d75 fixing playground responsive bahavior
Summary: The error message saying the playground is only available on bigger screens also was shown on big screens.

Reviewed By: emilsjolander

Differential Revision: D7989482

fbshipit-source-id: f444ca2d6608b868c4ff4d38fa6798d80b57c047
2018-05-14 10:22:41 -07:00
Daniel Büchele
5dbe3c128b adding support for min/max-width/height
Summary: Adding controls for min/max height/width to the playground

Reviewed By: emilsjolander

Differential Revision: D7988400

fbshipit-source-id: bae487e2504906788552d6c1a29ed74c39cb5ac0
2018-05-14 07:46:21 -07:00
Jonathan Kim
3564ccf6e4 Use wrapped cxx_binary
Summary: Introduce `yoga_cxx_binary`

Reviewed By: grzmiel

Differential Revision: D7809271

fbshipit-source-id: 1b66ce59a73e4a63b670f7d3bcadfbb6cbfbc220
2018-04-28 21:32:13 -07:00
Peter van der Zee
e1c19cecad Upgrade Prettier to v1.12.1 on fbsource
Summary:
Updates Prettier to v1.12.1, using `xplat/js/scripts/prettier-bump.js` based on the playbook by https://our.intern.facebook.com/intern/wiki/Prettier/upgrade-guide/

All changes related to upgrading or running Prettier

allow-many-files
allow-large-files
bypass-lint
drop-conflicts
ignore-conflict-markers
ignore-signed-source
ignore-nocommit

Reviewed By: benjaffe, ryanmce, yungsters

Differential Revision: D7652946

fbshipit-source-id: 396d45c675e93f2298cd2920d927630c81867447
2018-04-19 03:05:38 -07:00
Pascal Hartig
8e4f3a3084 Add getParent() method for easier migration
Summary:
External partners have asked us to provide an easier way to migrate and this was
a breaking change in the most recent release.

Reviewed By: emilsjolander

Differential Revision: D7654526

fbshipit-source-id: efe44807caa97f495c5e5691dedcf281760fa23e
2018-04-18 04:45:12 -07:00
Jakub Grzmiel
9b8323ff38 Clean up BUCK files for missing dependencies and tests
Summary: Several of dependencies and tests in repository are missing (e.g. because we don't support building certain library for MacOSX). Clean up those mistakes.

Differential Revision: D7625433

fbshipit-source-id: 332b7ff7eaed82cb52f459921f1ae67b702a1636
2018-04-14 15:35:24 -07:00
Jakub Grzmiel
5b7adda620 Unbreak the build
Summary: build-break

Differential Revision: D7629493

fbshipit-source-id: baf5ca7cec2078a8ba9e34afe84da76c2edbb3b3
2018-04-14 14:58:08 -07:00
Jakub Grzmiel
ba2a3b8c91 Clean up BUCK files for missing dependencies and tests
Summary: Several of dependencies and tests in repository are missing (e.g. because we don't support building certain library for MacOSX). Clean up those mistakes.

Differential Revision: D7618360

fbshipit-source-id: 421834892519998ad088a138b3fc3d96afe34d79
2018-04-14 13:17:59 -07:00
Jonathan Kim
eb15939c23 Make yoga wrapper macros start with yoga_
Summary: Rename macros

Reviewed By: mzlee

Differential Revision: D7606834

fbshipit-source-id: a2089260dbe46f30f49a207737c83472e2fb3c63
2018-04-14 12:43:03 -07:00
Pascal Hartig
b9fa60fd74 Re-enable matrix build for Java snapshots
Summary:
Change the travis platform to Java and install Node via nvm instead. This
manually reinstalls buck and then publishes a snapshot if it builds and tests
correctly.

Reviewed By: emilsjolander, danielbuechele

Differential Revision: D7567862

fbshipit-source-id: fabdbbb13117ab8ead4eb9f10402a71d30f29c12
2018-04-10 05:33:13 -07:00
Pascal Hartig
d397aa04d7 1.8.1-SNAPSHOT
Summary: Back to snapshot release.

Reviewed By: marco-cova

Differential Revision: D7550851

fbshipit-source-id: f98983799dc9ea2a44d658fd50a2676f1d6e31d5
2018-04-09 04:03:11 -07:00
Pascal Hartig
adb1b11055 1.8.0
Summary: New release.

Reviewed By: marco-cova

Differential Revision: D7550852

fbshipit-source-id: eac5662179daa88d9d62c55566b3a31428c4117a
v1.8.0
2018-04-09 02:41:21 -07:00
David Vacca
2e234473ca [yoga re-add assertion to check for owner reference before adding child.
Summary: this diff re-add the assertion to check for owner reference before adding child that was removed by mistake in previous diff

Reviewed By: emilsjolander

Differential Revision: D7495417

fbshipit-source-id: b81174aeea3f2796d76ccdae4a8eddd0beace0aa
2018-04-04 10:57:52 -07:00
Lukas Wöhrl
6b08db68bb Fix compilation on MSVC by moving YGConfig to C++
Summary:
This PR fixes the compilation on MSVC. I moved the `YGConfig` creation to a C++ constructor.

Addionally it removes the "dot" notation on `YGValue`, I didn't want to change that type to a C++ constructor, because I think this will break the ABI.
Closes https://github.com/facebook/yoga/pull/746

Differential Revision: D7498141

Pulled By: emilsjolander

fbshipit-source-id: 5f5308ff838dcd803065785ddc08b2404524acb9
2018-04-04 09:55:45 -07:00
Pritesh Nandgaonkar
9550126f76 clean up experimental setup and keep using ffast-math flag
Summary: Remove experimental setup of fast-math and add `-ffast-math` as a compiler flag for yoga.

Reviewed By: emilsjolander

Differential Revision: D7414228

fbshipit-source-id: 320e1b1953f6af867b13e617af7872eb8999160e
2018-04-04 08:29:43 -07:00
Pritesh Nandgaonkar
bad262b961 Change the return type of getMarginForAxis to YGFloatOptional
Summary: Change the return type of getMarginForAxis to YGFloatOptional

Reviewed By: emilsjolander

Differential Revision: D7350337

fbshipit-source-id: dd1ee2fcd295ccd14f7d414ab0c24090b24e91e0
2018-04-04 08:29:43 -07:00
Pritesh Nandgaonkar
3c6c10075a Change the return type of getTrailingMargin to YGFloatOptional
Summary: Change the return type of getTrailingMargin to YGFloatOptional

Reviewed By: emilsjolander

Differential Revision: D7350221

fbshipit-source-id: 61a67364c1975ec6dd1883bc2cb4968b830c73df
2018-04-04 08:29:43 -07:00
Pritesh Nandgaonkar
6a77a6939e Changed the return type of getLeadingMargin to YGFloatOptional
Summary: Changed the return type of getLeadingMargin to YGFloatOptional

Reviewed By: emilsjolander

Differential Revision: D7349907

fbshipit-source-id: b20894fbc33fd5b29a28f3c9174d1b5f406774ab
2018-04-04 08:29:43 -07:00
Pritesh Nandgaonkar
b725a4a140 Refactored relativePosition private method to YGFloatOptional return type
Summary: Refactored relativePosition private method to YGFloatOptional return type

Reviewed By: emilsjolander

Differential Revision: D7344939

fbshipit-source-id: 72443d38426a211d3e84be814e6a61baf4d26703
2018-04-04 08:29:43 -07:00
Pritesh Nandgaonkar
2b714a5b5d Change the type of getTrailingPosition to YGFloatOptional
Summary: Change the type of getTrailingPosition to YGFloatOptional

Reviewed By: emilsjolander

Differential Revision: D7344710

fbshipit-source-id: eb4c422b6e0f55d90b083221aa8ff1ab797d58a8
2018-04-04 08:29:43 -07:00
Pritesh Nandgaonkar
572546088f Changed the type of return value of getLeadingPosition to YGFloatOptional
Summary: Changed the type of return value of getLeadingPosition to YGFloatOptional

Reviewed By: emilsjolander

Differential Revision: D7344367

fbshipit-source-id: 0f5a667ca357b2ce056c86763aa3e9e4c54b82f0
2018-04-04 08:29:43 -07:00
Pritesh Nandgaonkar
5b109578d3 Changed the type of computedFlexBasis to YGFloatOptional in YGLayout
Summary: Changed the type of computedFlexBasis to YGFloatOptional in YGLayout

Reviewed By: emilsjolander

Differential Revision: D7340413

fbshipit-source-id: 39247b2b582a682e602f49f58b4bbd2bf0c995af
2018-04-04 08:29:43 -07:00
Pritesh Nandgaonkar
77b720f9a5 Fixed types of getLeadingPaddingAndBorder and getTrailingPaddingAndBorder to YGFloatOptional
Summary: Fixed types of getLeadingPaddingAndBorder and getTrailingPaddingAndBorder to YGFloatOptional

Reviewed By: emilsjolander

Differential Revision: D7339998

fbshipit-source-id: aa24335c2db1cd895b9711214b72195add718c32
2018-04-04 08:29:43 -07:00
Pritesh Nandgaonkar
de954eb9cc Changed the return type of trailing padding to YGFloatOptional
Summary: Changed the return type of trailing padding to YGFloatOptional

Reviewed By: emilsjolander

Differential Revision: D7339712

fbshipit-source-id: 483c5886838c14b17cb731c81abb9fc80f519956
2018-04-04 08:29:42 -07:00
Pritesh Nandgaonkar
3e322e60e4 Updated the implementation of leading padding
Summary: Changed the arguments for the getter of leading padding to avoid copies. Added an assetion in getter of leading padding, as padding would always be defined even in the case when the user has not explicitly defined the value. In these cases it would take the default value of 0. So changing the type of `getLayoutPadding` to `YGFloatOptional`, doesn't make sense.

Reviewed By: emilsjolander

Differential Revision: D7336690

fbshipit-source-id: b2a2f010026f26fc2cc9fb35ad921da8f7017c9f
2018-04-04 08:29:42 -07:00
Pritesh Nandgaonkar
a3642541d0 Make the return type of YGNodeBoundAxisWithinMinAndMax to YGFloatOptional
Summary: Make the return type of YGNodeBoundAxisWithinMinAndMax to YGFloatOptional

Reviewed By: emilsjolander

Differential Revision: D7323382

fbshipit-source-id: 8e3eb4f3744b5f3f9e2b353f56184905f7557191
2018-04-04 08:29:42 -07:00
Pritesh Nandgaonkar
bb139d3f91 Remove the use of YGUnwrapOptional from YGConstrainedMaxSizeForMode
Summary: Remove the use of YGUnwrapOptional from YGConstrainedMaxSizeForMode

Reviewed By: emilsjolander

Differential Revision: D7322743

fbshipit-source-id: d825c60bcdc9ecdc0c784a215dc6b1b8a7a7860e
2018-04-04 08:29:42 -07:00
Pritesh Nandgaonkar
08743a42e2 Made the acccessors method to return const references
Summary: Made the acccessors method to return const references

Reviewed By: emilsjolander

Differential Revision: D7321801

fbshipit-source-id: 9fc4da724bc2f58a0d95824ca3c0b5bf1690bccf
2018-04-04 08:29:42 -07:00
Lukas Wöhrl
cb6e76973d Fix float type mismatch on endOfLineIndex and inside rounding
Summary:
This PR fixes a type mismatch on `endOfLineIndex` where it should be of type `uint32_t` while it is of type `float`

Additonally it fixes some `double` casting in the rounding methods.
Closes https://github.com/facebook/yoga/pull/745

Differential Revision: D7494519

Pulled By: emilsjolander

fbshipit-source-id: 30a86574ce163458a6888f61a902d0640c1874fb
2018-04-04 07:04:23 -07:00
Pritesh Nandgaonkar
4b760fa9bc Changed the return type of YGResolveValueMargin to YGFloatOptional
Summary: Changed the return type of YGResolveValueMargin to YGFloatOptional

Reviewed By: emilsjolander

Differential Revision: D7304090

fbshipit-source-id: cbec03a9367cf34976d083ad475d4da0b736e6d2
2018-04-03 15:12:07 -07:00
Pritesh Nandgaonkar
5730be093e Move equaltiy function from utils to an operator on YGFloatOptional
Summary: Move equaltiy function from utils to an operator on YGFloatOptional

Reviewed By: emilsjolander

Differential Revision: D7303460

fbshipit-source-id: 41ec0076ace621ec1a5bdbab00b72eea57780fff
2018-04-03 15:12:05 -07:00
Pritesh Nandgaonkar
d85e2ee9c3 Change the type of aspect Ratio to YGFloatOptional
Summary: Change the type of aspect Ratio to YGFloatOptional

Reviewed By: emilsjolander

Differential Revision: D7302651

fbshipit-source-id: 53e3b4c9627207a379f927b1f3485e36a9c70601
2018-04-03 15:12:02 -07:00
Pritesh Nandgaonkar
fe433b012f Remove the usage of YGUndefined for kYGValueAuto and fix setter and getter of dimensions
Summary: Removes the use of YGUndefined from kYGValueAuto. Also fixed the setter and getter of dimensions. This diff also fixes a typo

Reviewed By: emilsjolander

Differential Revision: D7302453

fbshipit-source-id: e002a1ddd75bfc6fe142a7275e7913c064972e16
2018-04-03 15:11:58 -07:00
David Vacca
5e3ffb39a2 Extend Yoga to be able clone Yoga Node with new children
Summary:
This diff includes the following changes:

1 ) I extended the Java implementation of YogaNode to be able to get a full copy of a YogaNode object without copying the List of children of the original YogaNode. In other words, the new copy of the YogaNode will have the same data of the original YogaNode, but with an empty list of children.

2 ) We created a new method in Yoga.cpp called YGNodeInsertSharedChild. This new method is going to be used by Fabric in order to temporarily share a YogaNode between two "Yoga Trees" (the "current Yoga" tree and a partial "clone of the current Yoga tree"). We exposed this new functionality in the java implementation of Yoga (method addSharedChildAt)

I'm including sebmarkbage for more context.

Reviewed By: emilsjolander

Differential Revision: D7245421

fbshipit-source-id: 72578c8261f29e4a12fc6c72a91f2f891cd58d48
2018-04-01 18:35:13 -07:00