Summary:
Adds swift extension file as a separate subspec, as it is not required for the objc projects.
Also this fixes the current issue where the flipper sample app fails to build on xcode 11, as it fails to link the Swift specific literals.
Fixes this too https://github.com/facebook/yoga/issues/565
Reviewed By: SidharthGuglani
Differential Revision: D18373993
fbshipit-source-id: 0c058886a837c7ceafcd0167f878b3e0f7763aa1
Summary:
Use double for YGRoundValueToPixelGrid calculations as we were losing some precision in float operations
#Changelog:
[Internal][Yoga] Use double for YGRoundValueToPixelGrid calculations
Reviewed By: astreet
Differential Revision: D18225999
fbshipit-source-id: 69c05f56a0e0f3433bf0bd958aa07d26dd83fe02
Summary: Use compiler flags -ffunction-sections, -fdata-sections and -Wl,--gc-sections in both jni and yoga core
Reviewed By: amir-shalem
Differential Revision: D18029671
fbshipit-source-id: 5192fb6d682248b16781dead0d7b0a0377861fb6
Summary:
Using compiler flag -fvisibility=hidden and explicitly setting visibility to default to public methods
#Changelog:
[Internal] [Yoga] Use compiler flag -fvisibility=hidden for reducing yoga binary size
Reviewed By: astreet
Differential Revision: D18029030
fbshipit-source-id: 545e73f9c25f3108fc9d9bb7f08c157dbc8da005
Summary:
Yoga layout can be invoked on multiple threads, and gCurrentGenerationCount is a shared global without synchronization.
Changelog: [General] [Fixed] - Fix an internal thread safety issue in Yoga
Reviewed By: SidharthGuglani
Differential Revision: D18092734
fbshipit-source-id: 85753d139549b4e5507f97a56d589fb6854557fa
Summary:
setStyleInputs batching API was added to reduce the number of jni calls and although it improved performance in yoga world but was not impactful in litho and is not used anywhere.
Removing this saves around 500 bytes per architecture
#Changelog:
[Internal][Yoga] Removed unused code setStyleInputs batching API form Yoga
Reviewed By: amir-shalem
Differential Revision: D18036536
fbshipit-source-id: 7436b55dcd464dd9f9cc46406d4fd78d12babe55
Summary: UseVanillaJNI flag was missing for measure and baseline functions
Reviewed By: amir-shalem
Differential Revision: D17868201
fbshipit-source-id: 95d6843d643e90157a51550d6efbf059f0ca2c39
Summary: We can use getCurrentEnv() instead of passing environment variable around
Reviewed By: amir-shalem
Differential Revision: D17842042
fbshipit-source-id: 185b174ae7c08e746bc76c0600c2e326b15c4993
Summary: We can use getCurrentEnv() , no need to pass env around methods
Reviewed By: amir-shalem
Differential Revision: D17841281
fbshipit-source-id: a4a58292e70ac05b0f0b9eb962a82a8501ad0226
Summary: Move JNI_ONLoad to a separate file so that both fbjni native methods and vanillla jni native methods can be initialized correctly
Reviewed By: amir-shalem
Differential Revision: D17840166
fbshipit-source-id: 045df0df7a95bc331cbbefb3a118a349f3029465
Summary: set missing useVanillaJNI, it was causing part of the unit-tests to run in fbjni instead of vanillajni.
Reviewed By: SidharthGuglani
Differential Revision: D17852635
fbshipit-source-id: 5bc187d90fbdc430015be55a015a7d1e0ba0ebc6
Summary: Use TestParametrization to test both fbjni and vanilla jni versions
Reviewed By: amir-shalem
Differential Revision: D17788718
fbshipit-source-id: 0f3317b7403cadca7b7ccd9140f1933d746bf433
Summary: Add ScopedLocalRef, ScopedGlobalRef and some common methods to be used later.
Reviewed By: amir-shalem
Differential Revision: D17711284
fbshipit-source-id: be43d5e246bc2406765057783be11854877c41f1
Summary: This diff moves methods related to actions on YGNode like free node, reset node etc. to vanilla JNI
Reviewed By: amir-shalem
Differential Revision: D17668008
fbshipit-source-id: 03bfc51ec1fcf06569713400f984d551827e22fe
Summary: Moving common code to YGJNI.h header class so that same can be used in fbjni and vanilla jni implementations
Reviewed By: amir-shalem
Differential Revision: D17666457
fbshipit-source-id: 1e6cd2506fb773b8a17ebef277a2c7ef9728e66b
Summary:
Adds a flag useVanillaJNI in YogaConfig to determine whether to use FbJNI or JNI.
Currently default is set to false.
We will experiment based on this flag once all code have been migrated.
Reviewed By: Andrey-Mishanin
Differential Revision: D17601703
fbshipit-source-id: 377a5bd2a6f8a7584e84932e87fa7044d8165efd
Summary:
This diffs adds a separate file YGJNIVanilla.cpp to add jni methods which uses vanilla JNI instead of FBJNI.
In this diff only one method has been added to setup the experiment boolean setup.
At the end of this diff stack , we will be able to experiment between fbjni and vanilla jni in yoga and finally get rid of fbjni which saves us around 300Kb per architecture in yoga binary size.
Reviewed By: Andrey-Mishanin
Differential Revision: D17601591
fbshipit-source-id: a88520c625bd8b5d9ffcf8ab5f02fc71dc800081
Summary:
In D17439957, I noted that YogaLogger#log throws a NoMethodFoundException when called from C++ b/c C++ and Java's signatures of that method don't match. C++ uses YogaNodeJNIBase for the first param, Java uses YogaNode. Both my attempts to fix this failed.
Attempt #1 - Make Java use YogaNodeJNIBase. This doesn't work because the :java-interface target includes YogaLogger but not YogaNodeJNIBase. Moving YogaLogger to the impl target doesn't work either b/c other files in :java-interface reference YogaLogger.
Attempt #2 - Make C++ use YogaNode. This doesn't work b/c we try to call the log method with objects of fbjni type YogaNodeJNIBase. This would be fine in Java since YogaNodeJNIBase extends YogaNode. But fbjni's typing isn't advanced enough to know this, so the Yoga C++ fails to compile.
At this point, I was wondering what the value of having this param in the log function at all was. None of the implementations in our codebase use it today. It might be easier to just remove it all together. This also removes a bug with YGNodePrint where we pass a null layout context that eventually causes a SIG_ABRT when we use it to try to find a YogaNode to pass to this function. (https://fburl.com/diffusion/ssw9h8lv).
Reviewed By: amir-shalem
Differential Revision: D17470379
fbshipit-source-id: 8fc2d95505971a52af2399a9fbb60b63f27f0ec2
Summary: This diff fixes two issues with the JNI integration of YogaLogger#log. (1) The YogaLogger class descriptor was missing a semicolon. This causes a ClassNotFoundException whenever you try to call the log method from C++. (2) The C++ signature for the class was using YogaNodeJNIBase as an arg but the Java signature was using YogaNode. This causes a MethodNotFoundException whenever you try to call the method after fixing problem 1.
Reviewed By: astreet
Differential Revision: D17439957
fbshipit-source-id: be3c16512558050265565b3688fb09a7da31b9b2
Summary:
Split the yoga buck targets from interface to actual implementation.
This is currently done without moving any files folder, since only we will make the distinction between interface<-->implementation only this buck target (and not in the litho/reactnative yoga copies).
Buck does insures that the `java-interface` is pure since it doesn't depend on any fbjni code.
Reviewed By: SidharthGuglani
Differential Revision: D17266406
fbshipit-source-id: 46aa469b74c2c3114f1d3d762c41d32cfe269f57
Summary:
Remove YogaNode.create() from the abstract class after we made sure nothing uses it anymore
This is the final stage to make `YogaNode` a pure class without JNI references
Reviewed By: SidharthGuglani
Differential Revision: D17280571
fbshipit-source-id: bd0eb138f7a6a9de8988fc0a7b90badbf635dac5
Summary:
Split YogaConfig into the same way YogaNode is split today.
Into an abstract class defining the interface, and actual JNI implementation
Reviewed By: SidharthGuglani
Differential Revision: D17266404
fbshipit-source-id: 3d5d6aa65c55cfa61d47c662d140cdce6dcb0ea1
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/922
We are not using this dependency anywhere in yoga. Removed in this diff.
Reviewed By: passy
Differential Revision: D17131081
fbshipit-source-id: 5544b892f4ef5ca0207d9e21a5b97a2940ac6d53
Summary:
Expose native pointer thru an interface function for YogaConfig (its package private to `com.facebook.yoga` namespace),
This way we can make later on YogaConfig a pure abstract class.
Plus, it makes sure external users don't modify the pointer
Reviewed By: SidharthGuglani
Differential Revision: D17266401
fbshipit-source-id: f39b488cea0b73bc3578bb3aa90ab00139bf9271
Summary:
Update build tools version to 28.0.3 to fix the below warning
WARNING: The specified Android SDK Build Tools version (26.0.2) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.0.
Android SDK Build Tools 27.0.3 will be used.
Reviewed By: passy
Differential Revision: D17343575
fbshipit-source-id: aa12bf2b55666aacb18f09b1cca22eab05f38220
Summary: Bump version to 1.16.0-SNAPSHOT for new yoga release
Reviewed By: amir-shalem
Differential Revision: D17396540
fbshipit-source-id: ddd01454752d88548ae7490cfd9fccfb8c591ec9
Summary: Bump version to 1.16.0 for new yoga release
Reviewed By: amir-shalem
Differential Revision: D17395785
fbshipit-source-id: b01b31d58b5b1a2a9532e9cce0892c08960ec31c
Summary:
Fixes the yoga build 1:15:0 build issue
Could not find yoga:libfb:unspecified.
Required by:
project :app > com.facebook.yoga:yoga:1.15.0
libfb dependency was added to solve import issue in YogaPhantomJNIRefs but since we don't have that file now in codebase , it will not be a problem.
Reviewed By: amir-shalem
Differential Revision: D17395380
fbshipit-source-id: ab8eb2c89afe29b4688787db2214c328d875041e
Summary: Bumping version to 1.15.0 for new yoga release
Reviewed By: amir-shalem
Differential Revision: D17394805
fbshipit-source-id: de43e97a0c155f332ecbe4e98b78c2f7c9ffe771
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/927
When D16220924 brought a new fbjni copy (with new directories), we forgot to fix the cmake files which are used by gradle build system.
Reviewed By: SidharthGuglani
Differential Revision: D17367160
fbshipit-source-id: 3e7d20d4c53ff3012a164bf6e32f1000ecb3ffc2
Summary:
Add standalone factory classes which generate YogaNode + YogaConfig, later on it will allow us to separate the yoga interface and actual implementation buck targets (see D17266406)
We've done such breakage change previously in D14122974.
Reviewed By: SidharthGuglani
Differential Revision: D17258196
fbshipit-source-id: b12f1a0d23c3f82b14cee0731a1daf1c015ee32c
Summary:
Removed unused file YogaNodeJNIPhantomRefs.java as this was causing oss build failures because of an import.
````:yoga:compileDebugJavaWithJavac/home/travis/build/facebook/yoga/java/com/facebook/yoga/YogaNodeJNIPhantomRefs.java:9: error: package com.facebook.jni does not exist
import com.facebook.jni.DestructorThread;
^
/home/travis/build/facebook/yoga/java/com/facebook/yoga/YogaNodeJNIPhantomRefs.java:30: error: package DestructorThread does not exist
new DestructorThread.Destructor(node) {
^
2 errors
FAILED
Reviewed By: pasqualeanatriello
Differential Revision: D17257330
fbshipit-source-id: 98b0c5d5b7dcd94bee559b58194c13b07f47723d
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/925
Gradle is failing to compile yoga for two reasons:
1. Ever since `YogaNodeJNIPhantomRefs` was introduced which uses `DestructorThread.Destructor` from fbjni which was the first direct Java dependency from yoga java to fbjni java code.
2. Adding a missing gradle endpoint for `testutil` since it is now required for yoga unit-tests
Reviewed By: SidharthGuglani
Differential Revision: D17274226
fbshipit-source-id: 3df9648321162d34f81fd3675ca1474e8a1c6d3a
Summary:
clang 6.0 install was failing in yoga oss tests
Travis has made xenial as default distribution
https://changelog.travis-ci.com/xenial-as-the-default-build-environment-is-coming-97772
Added dist: trusty to the configuration to fix this.
Reviewed By: passy
Differential Revision: D17257300
fbshipit-source-id: f9fcd6ba774dad1c28bd953c0d850c7078d02015
Summary:
In order to foster healthy open source communities, we're adopting the
[Contributor Covenant](https://www.contributor-covenant.org/). It has been
built by open source community members and represents a shared understanding of
what is expected from a healthy community.
Reviewed By: josephsavona, danobi, rdzhabarov
Differential Revision: D17104640
fbshipit-source-id: d210000de686c5f0d97d602b50472d5869bc6a49
Summary:
Use the Yoga dependency instead which can be deduplicated by Gradle.
This solves (parts of) a bunch of issues concerning the use of
multiple FB libraries in one Android project.
Reviewed By: danielbuechele
Differential Revision: D16783243
fbshipit-source-id: 7f7915821dd286c51ec4ccbd95a2cdcb18b53bde
Summary: The artifacts generated otherwise can cause issues in Android projects.
Reviewed By: SidharthGuglani
Differential Revision: D16803253
fbshipit-source-id: db139560dfbddb917c27bdfd80e1bf5747e4a74b
Summary:
We need one place, any place really, to publish that good old `DoNotStrip` annotation
from that we currently copy across various repos, causing havoc for anybody who
tries to integrate more than one FB Android library into their project.
Yoga is very well positioned for this because it's already its own Gradle module and
all that's missing are these few lines.
Reviewed By: SidharthGuglani
Differential Revision: D16783035
fbshipit-source-id: 69b6224a725194d036c6a23a36bd76d3487b9811
Summary:
Use an array for counting measure callbacks due to each reason.
and this is now added as qpl metadata in Layout Calculation qpl event
Reviewed By: davidaurelio
Differential Revision: D16666786
fbshipit-source-id: ff85fba835148f06b9c5d90c4604e552a813777a
Summary:
No need for a copy here.
Pull Request resolved: https://github.com/facebook/yoga/pull/919
Differential Revision: D16701461
Pulled By: davidaurelio
fbshipit-source-id: 3a90adbb2b5c43d5aefe693a8525aa3a37e53b3d
Summary:
The test was broken and caused a few crashes on my project.
Pull Request resolved: https://github.com/facebook/yoga/pull/915
Differential Revision: D16701613
Pulled By: davidaurelio
fbshipit-source-id: 9ab5c43bb74e77593bc2426a249750a7ee8f4034
Summary:
This adds the root of the source tree to the include path, which allow `#include <yoga/YGEnums.h>` to work.
Fixes https://github.com/facebook/yoga/issues/908
Pull Request resolved: https://github.com/facebook/yoga/pull/909
Differential Revision: D16701716
Pulled By: davidaurelio
fbshipit-source-id: 0fdc6479e4f3119a3e4ddbcd4b48541b282c1bbd
Summary:
As far as I can tell now. Would be nice if you had an actual changelog somewhere!
Pull Request resolved: https://github.com/facebook/yoga/pull/907
Differential Revision: D16701738
Pulled By: davidaurelio
fbshipit-source-id: cf32dc96eca5258979bcaa9947d6ed6b5496398d
Summary: Replaces the usage of C++ bitfields with our portable `Bitfield` class.
Reviewed By: SidharthGuglani
Differential Revision: D16656361
fbshipit-source-id: 05f679e2e994e109b2bd1090c879d6850fabdc40
Summary:
@public
Removes the style properties bitmask. We have used this for experimentation, and it's no longer necessary.
This simplifyies the code, and allows us to cut over to `Bitfield.h` more easily.
Reviewed By: astreet
Differential Revision: D16648862
fbshipit-source-id: 17c0899807af976f4ba34db54f8f0f6a3cd92519
Summary:
@public
Our usage of C++ bit fields has lead to quite some problems with different compiler setups. Problems include sign bits, alignment, etc.
Here we introduce a portable implementation as a variadic template, allowing the user to store a number of booleans and enums (defined with `YG_ENUM_SEQ_DECL`) in an unsigned integer type of their choice.
This will replace all usages of bit fields across the Yoga code base.
Differential Revision: D16647801
fbshipit-source-id: 230ffab500885a3ad662ea8f19e35a5e9357a563
Summary: We want to use the yoga playground as a standalone package as well. This adds a webpack config to bundle the playground for npm. The package can then be distributed as `yoga-playground` via npm
Reviewed By: fabiomassimo
Differential Revision: D16583334
fbshipit-source-id: 84807ddd8983ba9f0fb43570b518c975f35544ab
Summary:
Added an array to maintain the counts of each of the reason of measure callbacks
and this is now added as qpl metadata in Layout Calculation qpl event
Reviewed By: davidaurelio
Differential Revision: D16516379
fbshipit-source-id: 201c5d2463f0a921841a0bbfec8f4d5e007000c8
Summary:
We had flex as a reason for both layout and measure. Now creating separating reason flexLayout and flexMeasure in this diff.
Also changed ordering of items in Enum to group layout and measure reasons
Reviewed By: davidaurelio
Differential Revision: D16562350
fbshipit-source-id: 75501f9d4dde0974009193b3991a8acc97b02ad0
Summary:
Fixes vulnerability in mem dependency by updating the version of flow-copy-source in javascript/yarn.lock
da4e4398cb
Reviewed By: danielbuechele
Differential Revision: D16542191
fbshipit-source-id: e900ac2d358883fc269688b93faad3ffbec10f0d
Summary:
This diffs removes the usages of getInstanceCount as it has been removed from yoga.
We will add event support in js later to handle these test cases
Reviewed By: davidaurelio
Differential Revision: D16560269
fbshipit-source-id: 52590c426faf87209f8635602b401fd5760af8ab
Summary: Update build file to include subdirectories of yoga also in sources
Reviewed By: davidaurelio
Differential Revision: D16560253
fbshipit-source-id: 5dee4379912e003d4a1fa611882fbf736321615c
Summary:
# Disclaimer:
I might be missing something as the solution I implemented here seems like something that was considered by original author. If this solution isn't good, I have a plan B.
# Problem:
`onDismiss` prop isn't being called once the modal is dismissed, this diff fixes it.
Also I've noticed that `onDismiss` is meant to only work on iOS, why is that? By landing this diff, it'll be called on Android as well so we need to change the docs (https://facebook.github.io/react-native/docs/modal.html#ondismiss).
## Video that shows the problem
Following code is in playground.js P70222409 which just increments number everytime onDismiss is called
{F166303269}
Reviewed By: shergin
Differential Revision: D16109536
fbshipit-source-id: 3fba56f5671912387b217f03b613dffd89614c9d
Summary: Adds a subclass of `YogaNodeJNIBase` that uses `PhantomReference` for deallocating native memory rather than `Object#finalize()`. This should help making garbage collection more efficient.
Reviewed By: amir-shalem
Differential Revision: D16182667
fbshipit-source-id: d310fdb6af184168c43462b24f5e18ab5d0d7ad0
Summary: Adds internal API that we can use to conduct experiments.
Reviewed By: SidharthGuglani
Differential Revision: D16340463
fbshipit-source-id: 07a8bb7dbc4a02c5c95f1ad29b18845ab43752cf
Summary: Using enum struct for using enums in form ENUM_NAME::ENUM_VALUE for better code readablility
Reviewed By: davidaurelio
Differential Revision: D16356562
fbshipit-source-id: cbe7adadad78eb5d0756c44679c0e102b7d31ec6
Summary:
`YGStyle` puts Yoga enums (which are signed integers by default) into bitfields: https://fburl.com/7fowlunu
Mixing signed values and bit-fields can be error-prone and it also fails to build on Windows with `clang-cl` due to `-Wbitfield-constant-conversion` warning being treated as error:
```
stderr: In file included from xplat\yoga\yoga\YGLayout.cpp:8:
In file included from xplat\yoga\yoga/Utils.h:8:
In file included from xplat\yoga\yoga/YGNode.h:13:
xplat\yoga\yoga/YGStyle.h(110,9): error: implicit truncation from 'YGAlign' to bit-field changes value from 4 to -4 [-Werror,-Wbitfield-constant-conversion]
alignItems_(YGAlignStretch),
```
This diff fixes the problem by making all enums unsigned integers. This change can be problematic only if values of the enums are serialized somewhere. CC: David Aurelio
Reviewed By: davidaurelio
Differential Revision: D16336729
fbshipit-source-id: ee4dabd7bd1ee429e644bd322b375ec2694cc742
Summary:
Upgrades Yoga’s copy of *fbjni* to the latest version.
This will enable us
- to move from `finalize()` to `PhantomReference` to deallocate native memory, with the potential of making GC more efficient.
- to remove the internal dependency to *libfb,* allowing apps without an own dependency to ship less code
Reviewed By: passy
Differential Revision: D16220924
fbshipit-source-id: e8233fe2b5403946ff51f43cb6def558ded52fda
Summary:
Before we can upgrade to latest fbjni, we need to make sure our shared libraries are named the same.
Currently when we compile libfbjni it is named as `liblib_fb_fbjni.so`, where as the regular fbjni is expected to be named as `libfbjni.so`
Reviewed By: davidaurelio
Differential Revision: D16250801
fbshipit-source-id: 9a7f0f803d7e525985b40a49edcc0e660e9025f5
Summary: Removed classes YogaNodeJNI and YogaNodeJNIBatching and all the logic have been moved to base class
Reviewed By: davidaurelio
Differential Revision: D16221484
fbshipit-source-id: 830819f5bc6010291b8bc0c6d90897cea991909f
Summary: Removes config param useBatchingForLayoutOutputs and now we are using batching of layout outputs as float array while passing data from c++ to java
Reviewed By: davidaurelio
Differential Revision: D16221483
fbshipit-source-id: 326c668d4dfd13b2cf031f98a84bfa50b1440513
Summary:
- Events are our new approach to instrumentation, and keeping debug code out of the core library
- This has run internally at FB for some time now
- Enabling for OSS, too, to make Java tests pass
Reviewed By: SidharthGuglani
Differential Revision: D16202541
fbshipit-source-id: c13f5270f04bba59f9f0a06d9c793da92b73d4ff
Summary:
Fixes test execution for open source:
- adds hamcrest jar and dependency, as required by buck (to not throw `"Unable to locate hamcrest on the classpath. Please add as a test dependency."`)
- enables events for OSS, to make tests pass
Reviewed By: SidharthGuglani
Differential Revision: D16202542
fbshipit-source-id: a56069de162f739b3b989961b5dc00f3d37f5849
Summary: Add tests for measure and baseline events , same as we had in InstrumentationTests for marker based approach
Reviewed By: davidaurelio
Differential Revision: D16074402
fbshipit-source-id: 8b11cd6468420428701fd5be5c57700cbd913d23
Summary: Adds Baseline start and end events to be handled later for instrumentation
Reviewed By: davidaurelio
Differential Revision: D16048790
fbshipit-source-id: 8409dbb633168753a7bf8fab20bc6551d113ddd6
Summary: Using layoutPassStart and LayoutPassEnd events instead of YGMarkerLayout for instrumentation
Reviewed By: davidaurelio
Differential Revision: D16048789
fbshipit-source-id: 041a35bc2cb1b7281ca83cf9d35041b4011cfeb9
Summary: Add tests for layout pass start and end , same as what we had in InstrumentationTests for marker based approach
Reviewed By: davidaurelio
Differential Revision: D16073121
fbshipit-source-id: 838f01cb2a41d2d2764ba7ce2f317147f737b287
Summary: We are now using custom TypedEventTestData for test cases as we need to copy some data passed from the yoga event system
Reviewed By: davidaurelio
Differential Revision: D16090931
fbshipit-source-id: 4d11bdbdd73b67172ad4bba4b294c71f1c24cc10
Summary:
GCC 8.3.0 (and possibly all gcc 7+) identified several warnings for signed unsigned integer comparison. With `-Werror` enabled this broke compiling tests. I suspect the warning is related to google/googletest#683. This diff updates those `ASSERT_EQ` calls that attempt to compare signed and unsigned errors by specifically declaring the literals to be unsigned.
There is also an issue with Buck where it will not link to pthreads. facebook/buck#1443. Adding a `prebuilt_cxx_library` for pthread fixes that issue and the tests will compile and run.
Finally, there was a warning about a missing return after a switch in `InstrumentationTest.cpp`. I added a `return ""` as a default, but it might be better to throw something. Thoughts?
Pull Request resolved: https://github.com/facebook/yoga/pull/895
Reviewed By: davidaurelio
Differential Revision: D15393082
Pulled By: davidaurelio
fbshipit-source-id: 4f13ec2f016af39537c08fb591b188a6a0ed55ce
Summary:
Instead of checking whether `YG_ENABLE_EVENTS` is defined for every publish, we simply wrap the body of the `publish` function macro that delegates to the method that actually publishes the event.
This way we get
1. easier to write code where we publish events
2. more type safety when editing, enabling editors/IDEs to show errors without knowing about `YG_ENABLE_EVENTS`
Reviewed By: SidharthGuglani
Differential Revision: D16049888
fbshipit-source-id: cbf362d6f7be5053c3f377125d303b7137d6a241
Summary: Removes time measurements for measure callbacks. This functionality should not be part of Yoga/core, and can now be done by event subscribers themselves, as we have two events per measure callback.
Reviewed By: SidharthGuglani
Differential Revision: D16049812
fbshipit-source-id: e16556f3854e42f4bada39a97a668e718719b22c
Summary: Publishing two events will allow us to replace marker functionality completely with events. This also allows us to remove measuring time spent from Yoga itself.
Reviewed By: SidharthGuglani
Differential Revision: D16049810
fbshipit-source-id: 98628a92ed3c94d479e9fbcd53fac90c5f524087
Summary:
@public
Removes the declaration of `YGRoundValueToPixelGrid` from `Yoga-internal.h`, as it is already declared in `Yoga.h`. `Yoga.h` is included from `Yoga-internal.h`
Reviewed By: SidharthGuglani
Differential Revision: D16047832
fbshipit-source-id: 72d9d2510372c983eedacc5d7af406b9346f18e6
Summary:
Continuing https://github.com/facebook/yoga/pull/791
nokia6686 is a former member of our team, so we are trying to pick up what he left and carry out the pull request.
# Solution
Improved from previous solution with jpap's suggestions.
2. Passing ```gDepth``` and ```gCurrentGenerationCount``` (renamed to **_depth_** and **_generationCount_** respectively) between function calls that stem from ```YGNodeCalculateLayout```.
In ```YGNodeCalculateLayout```, pass ```depth``` as value 0, to indicate the root depth.
Pull Request resolved: https://github.com/facebook/yoga/pull/852
Reviewed By: SidharthGuglani
Differential Revision: D15537450
Pulled By: davidaurelio
fbshipit-source-id: 338f51383591ba27702ebe759f6c47c2dede3530
Summary:
Due to testutil depending on :yoga, we are always linking against both
:yoga and :yogaForDebug in tests. This is only working right now due to luck in
how Buck orders the link line. Adding a dependency is silly but it enforces
that Buck maintain the ordering that we currently have even when it changes how
it does its traversal.
Reviewed By: philipjameson
Differential Revision: D15973581
fbshipit-source-id: 3d18aff578ee4d56175ce5efae52b56aeb2d9586
Summary: Passing whether layout cache or measure cache was used or not
Reviewed By: davidaurelio
Differential Revision: D15920937
fbshipit-source-id: a6728e7af07ea228a285f824fbdfddc8130c5990
Summary:
Added event NodeLayoutEnd and this is being used now instead of NodeLayout
It will be used later to add more information about caches
Reviewed By: davidaurelio
Differential Revision: D15920935
fbshipit-source-id: c9f5e193bc8cc70d26ff5d84882d483c9b09f67d
Summary: Replaces the relative include to `YGEnums.h` in `yoga/event/event.h` with `#include <yoga/YGEnums.h>
Reviewed By: SidharthGuglani
Differential Revision: D15778634
fbshipit-source-id: 2bceeb58f26c0d9d0df6c0e7ea20b8ddf68a1ee5
Summary:
In "regular" header mode, Buck will symlink from `buck-out/` to the actual header file. This works fine with GCC and clang, but not with MSVC. Headers will be treated as different file, sidestepping `#pragma once` directives.
As a result, all kinds of symbols get declared twice, leading to compile errors.
Reviewed By: davidaurelio
Differential Revision: D15781947
fbshipit-source-id: a3b4e211b8b74b9ef44fc39471a3009b2cf47260
Summary:
Adds the ability to `MarkerSection` to end the marker before it goes out of scope.
This unlocks two scenarios:
- reuse the data associated with a marker after ending it.
- end markers in the middle of a function without adding arbitrary blocks.
Reviewed By: SidharthGuglani
Differential Revision: D15837840
fbshipit-source-id: c0afaeeabd169c65189b5028be54ea7dac3e3b84
Summary: Counts how many times measure callbacks have been invoked during a layout pass. This is made available via the marker and event APIs.
Reviewed By: SidharthGuglani
Differential Revision: D15836983
fbshipit-source-id: 3835bef94e497375821c9f2ad8209447b4f11518
Summary:
Passing Measure callback data - width, widthMeasureMode, height, heightMeasureMode, measuredWidth and measuredHeight along with NodeMeasure event
This data is then propagated to java layer in this diff
Reviewed By: davidaurelio
Differential Revision: D15697523
fbshipit-source-id: 615463da237175ff88abef3f6528b55333ccd915
Summary: Removes `unsetOwner` from Yoga. This was temporarily for patching a crash.
Reviewed By: colriot
Differential Revision: D15737613
fbshipit-source-id: 8ab93ecf7ffb913df6207fe5db47a8cc93eded2c
Summary: Listen to NodeLayout event and passes this event callback to java layer along with the information whether layout or measure was done in this pass
Reviewed By: davidaurelio
Differential Revision: D15696021
fbshipit-source-id: 8c5ca69330a9baca26b77052d4965cc67fe97c75
Summary: We are passing layout context from yoga as event data for Layout Pass End event and it is being then used to get the local reference of node so that we can pass it as method parameter to java layer
Reviewed By: davidaurelio
Differential Revision: D15619640
fbshipit-source-id: 5f6c29d9e6acb73a8d87f8e0cb1577d35a271aeb
Summary: Move PtrJNodeMap to header file so that it can be accessed in events subscribers outside yoga
Reviewed By: davidaurelio
Differential Revision: D15619629
fbshipit-source-id: 1bf213efd38ec7bcac6a38070f21fa837c5f17da
Summary:
`/*` is the standard throughout open source code. For example, Firefox uses single /*: https://hg.mozilla.org/mozilla-central/file/21d22b2f541258d3d1cf96c7ba5ad73e96e616b5/gfx/ipc/CompositorWidgetVsyncObserver.cpp#l3
In addition, Rust considers `/**` to be a doc comment (similar to Javadoc) and having such a comment at the beginning of the file causes `rustc` to barf.
Note that some JavaScript tooling requires `/**`. This is OK since JavaScript files were not covered by the linter in the first place, but it would be good to have that tooling fixed too.
Reviewed By: zertosh
Differential Revision: D15640366
fbshipit-source-id: b4ed4599071516364d6109720750d6a43304c089
Summary: We are passing layout context from yoga as event data for Layout Pass End event and it is being then used to get the local reference of node so that we can pass it as method parameter to java layer
Reviewed By: davidaurelio
Differential Revision: D15602923
fbshipit-source-id: 54b25956af098700cea25c4f7f8ffe0b9117432c
Summary: Move PtrJNodeMap to header file so that it can be accessed in events subscribers outside yoga
Reviewed By: davidaurelio
Differential Revision: D15602627
fbshipit-source-id: bb5bd5bbf8dcb279f5f87a4fd7287909d4e895d8
Summary:
Adds a data structure that holds a series of values that can be *borrowed* for exclusive writing.
That means, that only a single consumer can write to any value owned by the data structure.
In addition, the data structure exposes read access via iteration over all contained values.
A typical use case would be a counter with thread-local values that are accumulated by readers in other parts of a programm. The design carefully avoids the use of atomics or locks for reading and writing. This approach avoids cache flushes and bus sync between cores.
Borrowing and returning a value go through a central lock to guarantee the consistency of the underlying data structure.
Values are allocated in a `std::forward_list`, which typically should avoid two values in the same cache line -- in that case, writing to one value would still cause cache flushing on other cores. An alternative approach would be to allocate values continuously on cache line boundaries (with padding between them). We can still change the code if the current approach turns out to be too naive (non-deterministic).
Reviewed By: SidharthGuglani
Differential Revision: D15535018
fbshipit-source-id: 212ac88bba9682a4c9d4326b46de0ee2fb5d9a7e
Summary:
Replace the *copy on write* vector with an atomic pointer to a linked list.
This allows to publish without locking a mutex, at the cost of the slower traversal of a linked list (a vector has better locality).
At the moment, the typical use case is to have one subscriber, meaning that the afforementioned slower traversal is not a problem.
Adding subscribers is implemented as atomic *compare and swap.*
Reviewed By: SidharthGuglani
Differential Revision: D15546964
fbshipit-source-id: 41bfa41f1ac6be5c9b6bf4288ea3271ee995877e
Summary:
We want to phase out usage of config pointers on nodes. Setting configs is no longer needed, as a config is unly used during construction.
Here we deprecate the setter, as it is no longer working as it used to (e.g. changing `useWebDefaults` after a node is constructed).
Reviewed By: SidharthGuglani
Differential Revision: D15416474
fbshipit-source-id: a2cc06cad0c5148cecce056ece5f141b3defe9a9
Summary: Removes a check introduced in D6969537, comparing `totalFlexGrowFactors` and `resolveFlexGrow` to both `0.0` *and* undefined.
Reviewed By: SidharthGuglani
Differential Revision: D15431425
fbshipit-source-id: 13c8f24e1bc8c49496097a6aa78e20ee5d3964a7
Summary:
`YGNode::setAndPropogateUseLegacyFlag` was only used for debugging purposes.
Here, we replace it with a free function in `Yoga.cpp`.
Now that we have events, the diffing functionality should go into a separate debugging package and be implemented in terms of an event listener. Let's do that as soon as we can support multiple listeners.
Reviewed By: SidharthGuglani
Differential Revision: D15316863
fbshipit-source-id: db929eba7c2de8aa1550e362dd2c175929c0070e
Summary:
In order to remove the config pointer from nodes, we have to keep track of whether the node is using web defaults.
This information fits into one bit that we can place in padding (i.e. no extra memory needed).
This allows us to get rid of config usage withing `YGNode` with some exceptions:
- `iterChildrenAfterCloningIfNeeded` -- this function will simply receive the configuration, or the cloning callback.
- `setAndPropogateUseLegacyFlag` -- will be removed in D15316863
- in `YGNode::reset` -- will go away utomatically once we remove the config pointer
Reviewed By: SidharthGuglani
Differential Revision: D15391536
fbshipit-source-id: 0fa0d0805c6862bd741fe4a7d9b637ed534f56a4
Summary: Using Mutex lock_guard mechanism when writing to subscribers and when accessing them in publish to make a copy
Reviewed By: davidaurelio
Differential Revision: D15391679
fbshipit-source-id: 16713ff28ce1762a5ca4c48c152897a92417e80b
Summary:
Adds one byte of private storage to `YGNode`, intended to be used by Yoga itself.
This is in previously unused alignment space, and won’t cause more memory to be allocated.
Reviewed By: SidharthGuglani
Differential Revision: D15296732
fbshipit-source-id: 3caf0a3cd506e4e324e51c31869c69be5781d476
Summary: Style bits had overlap, because `dimensionBit` was set with an incorrect increment.
Reviewed By: SidharthGuglani
Differential Revision: D15335134
fbshipit-source-id: 370e1a73547d76b0e26bc6ab67acb96d33ddf180
Summary:
using shared_ptr for vector of subscribers
Further changes in commit stack support the mutiple subscribers in event system
Reviewed By: davidaurelio
Differential Revision: D15352512
fbshipit-source-id: fac7f4268abf9ca4277734aca2f21cd711eb7d6e
Summary:
Replaced global event subscriber with a vector of subscriber functions
Further changes in commit stack support the mutiple subscribers in event system
Reviewed By: davidaurelio
Differential Revision: D15352451
fbshipit-source-id: 7ca6f0943735bf1f76a906c23e15e14ae3c5f42c
Summary:
Adds YogaEventListener interface and it's implementation which will be used in flipper for events coming from Yoga
After this diff , we will start getting layout calculate events in flipper listener
Reviewed By: davidaurelio
Differential Revision: D15316928
fbshipit-source-id: da3a53374a52386037b553d460038d988b0162c2
Summary:
On MacOS, the following steps result in build errors:
```
mkdir build
cd build
cmake ..
make
```
The problem is that yogacore uses C++11 features (`constexpr`) but C++11 isn't specified in CMakeLists.txt.
This PR solves the poblem by adding the following code to the bottom of CMakeLists.txt:
```
set_target_properties(yogacore PROPERTIES CXX_STANDARD 11)
```
This solution was derived from https://stackoverflow.com/questions/45688522/how-to-enable-c17-in-cmake
Pull Request resolved: https://github.com/facebook/yoga/pull/887
Differential Revision: D15334282
Pulled By: davidaurelio
fbshipit-source-id: a599d8a8f555f7f9cd8dc333e12dc2387d5b2d7a
Summary:
Adds `LayoutPassStart` and `LayoutPassEnd` events.
The existing `NodeLayout` event in isolation is not as useful as it could be. Having events that mark start and end of a layout pass are a useful addition.
Differential Revision: D15305467
fbshipit-source-id: 14af6f65e698fb1e3112eb2ffd87a74d31df4840
Summary:
@public
`YGNodeGetInstanceCount` was only ever meant for tests, and caused data races in multi-threaded environments.
It was completely replaced with event-based counting for tests.
Here we remove public API around the counter, and the counter itself.
Reviewed By: SidharthGuglani
Differential Revision: D15174857
fbshipit-source-id: 228e85da565bac9e8485121e956a2e41910b11c8
Summary:
@public
replaces the global node counter with the event-based one for all tests.
Reviewed By: SidharthGuglani
Differential Revision: D15174856
fbshipit-source-id: f4401d502bdbaf3b6e4632a4d985aac260cb35a8
Summary:
@public
Test utility on top of the new event system that maintains a counter of instantiated nodes. Meant to replace the global node counter.
Reviewed By: SidharthGuglani
Differential Revision: D15174855
fbshipit-source-id: 6998472f95a09b8da652257a26596164bdcf43d6
Summary:
@public
Publish two events, `NodeAllocation` and `NodeDeallocation`, in the same places where the global node counter is changed.
Reviewed By: SidharthGuglani
Differential Revision: D15174858
fbshipit-source-id: 6e4e9add88513b9e987189ca5035d76da2a1de55
Summary:
@public
Reduces measure cache size to a number that is enough for 95% of nodes, according to our (FB-internal) measurements.
Node size: 776b -> 584b
Reviewed By: SidharthGuglani
Differential Revision: D15183567
fbshipit-source-id: 9ae8cc78074271a015e7618b931ba0356de87a0c
Summary: We conducted an experiment with different measure cache sizes. This has now been deallocatedi (D15183473). Remove the necessary APIs.
Reviewed By: SidharthGuglani
Differential Revision: D15183486
fbshipit-source-id: a38fa5a3ab0321c2521265f7d1cd6b495efd76cf
Summary:
@public
`YGConfig::YGConfig(YGConfig*)` was not initializing the same fields as the default constructors.
Here, we make the default constructor delegate to the more specialized one to remove duplication.
Reviewed By: SidharthGuglani
Differential Revision: D15164599
fbshipit-source-id: 27247709091b7664386057d09ac67d481877871f
Summary:
@public
We want to enable tooling, instrumentation, and statistics within Yoga without coupling these functionalities to our core code.
This commit introduces the foundations of a simple, global event system.
For the time being, we will only support a single subscriber. Should we require more than one, we can add support for it later.
Reviewed By: SidharthGuglani
Differential Revision: D15153678
fbshipit-source-id: 7d96f4c8def646a6a1b3908f946e7f81a6dba9c3
Summary:
@public
Makes bitfield getters/setters part of the bitfield ref template.
Since we introduced the tracking bit as template parameter in D14933022, every bitfield ref is an individual class anyway, and having function pointers doesn’t potentially lead to less code generation anyway.
Furthermore, this change can (in the absence of tracking bits) avoid less specialized templates dealing with refs, and to dynamic dispatch as a consequence.
Reviewed By: SidharthGuglani
Differential Revision: D15085495
fbshipit-source-id: 0dd70fa05e9d43a29e38a619cddb642c9ca3f7ab
Summary:
@public
In order to optimise property storage, we have to know how style properties are used in our apps.
Here, we add a bitmask that allows us to track which properties are set explicitely, and use that for our analysis.
Reviewed By: SidharthGuglani
Differential Revision: D14933022
fbshipit-source-id: 1ab8af562b14baba1d02057e527aa36d5c9a7823
Summary:
@public
The extra overload of `updateStyle` introduced in D15078961 can also handle `BitfieldRef`.
That means that we can remove the more specific implementation previously introduced for `BitfieldRef`
Reviewed By: SidharthGuglani
Differential Revision: D15081069
fbshipit-source-id: 98f1f3478627974c5273c85d268ca07350f303d7
Summary:
@public
Change style property accessors to return `Ref` instances instead of references to `CompactValue`.
This will allow to track assignments to properties later on, e.g. for instrumentation or dynamic property storage.
Reviewed By: SidharthGuglani
Differential Revision: D15078961
fbshipit-source-id: 259f05f7d30f093c04bf333c5bd4fb3601b8e933
Summary:
@public
Adds `YGStyle::ValueRepr` to make code depending on the actual type easier to write.
So far, we have treated `yoga::detail::CompactValue` as an implementation detail, and that’s what it’s supposed to stay.
React Native Fabric has one value conversion overload that depends on that type, though, and used `decltype(YGStyle{}.margin()[0])` until now.
That’s problematic for two reasons:
- we want to constrain the parameter of `operator[](...)` to enum types, making the `0` unsuitable
- we want to return the non-const overload of the operator to return a custom `Ref` type, which is not the type needed by Fabric.
Making the storage type explicit allows to write more forward-compatible code.
Reviewed By: SidharthGuglani
Differential Revision: D15078960
fbshipit-source-id: 932c27ef2f2cdc6ce965b79894268170f0ccdce5
Summary:
@public
Some `YGNode*` passed as `const YGNode*`, some const refs to sub-objects introduced.
This helps selecting the desired methods in more places, i.e. `const` overloads of accessors on `YGStyle`.
Reviewed By: SidharthGuglani
Differential Revision: D15078963
fbshipit-source-id: 5013721d6edcc68f42f4504f5c331da647a294bd
Summary:
@public
Having binary operators as member functions has disadvantages:
- the left hand side cannot be converted to `YGFloatOptional` implicitly (which we need for `YGStyle` refs)
- Operators are not necessarily commutative.
By moving these operators into free functions, and adding overloads for both variants if one operand is `float`, we get these properties.
Reviewed By: SidharthGuglani
Differential Revision: D15078962
fbshipit-source-id: 2e228a2ef90a8083c91788caa9eedfd4d140677f
Summary:
@public
Takes a const reference to the style of the printed node once, instead of using repeated calls to `node->getStyle()`.
Makes the code a bit shorter, and ensures that we are operating on `const YGStyle&`, which helps selecting the correct methods further up the stack.
Reviewed By: SidharthGuglani
Differential Revision: D14999094
fbshipit-source-id: 814f06b7e3179ac8cfb43d79fbec48ee4115d6e3
Summary:
@public
Introduces `YGNodeConstRef` as `const YGNode*`, i.e. a pointer to a constant `YGNode`.
We also use it for all style getters, which will avoid casts to `const YGNode*` in diffs up the stack.
We should use this pointer type for all functions that do not modify the underlying node.
Reviewed By: SidharthGuglani
Differential Revision: D14999095
fbshipit-source-id: 61cc53bb35e787a12ae12e70438d84c0a4983752
Summary:
@public
In order to encapsulate property access on `YGStyle`, as a first measure we wrap all fields with accessors.
This will e.g. enable dynamic property storage and instrumentation in the future.
All accessors have a `const` version that allows direct access via `const&`. For mutation, bit fields are wrapped with a custom reference object.
This style allows for the least amount of changes in client code. Property access simply needs appended parens, eg `style.direction` becomes `style.direction`.
Reviewed By: shergin
Differential Revision: D14999096
fbshipit-source-id: fbf29f7ddab520513d4618f5e70094c4f6330b30
Summary:
@public
Remove unnecessary `const` and `extern` specifiers from `Yoga.h`.
- Function declarations are `extern` by default
- The removed `const` specifiers for pass-by-valye parameters are only meaningful for the *definition* of functions, not for the declaration.
In this specific case, I found `const YGNodeRef` particularly confusing, as it is a `typedef` for a pointer type. `const` does not refer to the pointed-to object, but to the parameter itself, i.e. `const YGNodeRef` is `YGNode * const`, and not `const YGNode *`.
Reviewed By: SidharthGuglani
Differential Revision: D14999097
fbshipit-source-id: 8350870cb67f4a34722f796c4f4a2fc7dde41b99
Summary:
@public
This allows short methods defined in class declarations to occupy a single line.
The change makes class declarations more readable.
Reviewed By: SidharthGuglani
Differential Revision: D14950012
fbshipit-source-id: 1321949475184181c6cceb86613f730e430763e2
Summary:
We were using four edges for margin, padding and border. This diff changes the array size in YGLayout for margin, padding, border to reduce YGNode size and corresponding changes while we are setting values in YGLayout.
Reduces the YGNode size by 24 bytes
Reviewed By: davidaurelio
Differential Revision: D14892666
fbshipit-source-id: 94013d5183ee869901267c4c9941fd94fa05d848
Summary:
This directory was excluded from Black formatting in D14888843 when Black
was turned on for all of `xplat/`. Since there aren't a lot of `.py` files in
this directory, the opt-out is being removed, and the outstanding issues fixed.
Reviewed By: d16r
Differential Revision: D14889104
fbshipit-source-id: 440077c1efcb4c653151bca1da5636212978add5
Summary:
@public
compiler flags were pushed to C++14, but we don’t currently have any code that requires it. Setting to `-std=c++11` in order to fix the OSS build.
Reviewed By: SidharthGuglani
Differential Revision: D14833737
fbshipit-source-id: df2cd7da8c7124e89863c90d7b77bcf86c495618
Summary:
@public
Push version to *1.14.0.*
This release contains some bug fixes around `align-content`.
Reviewed By: colriot
Differential Revision: D14833417
fbshipit-source-id: f653d5fbb36f307c92b14c091c3206290256f036
Summary:
@public
Regenerating the “golden master” tests with chrome surfaced different bugs around `align-content`:
- a misunderstanding that values in `align-content` only applied *if there is only one line.* In fact, it applies *every time* a container is set to `flex-wrap: wrap`. Chrome had this wrong, and as such our tests were generated with incorrect parameters.
- empty children growing to the cross axis size of the container, even when `align-content` is different from `stretch`. This was implemented incorrectly in Chrome as well. Here, we fix it with an extra check.
Reviewed By: SidharthGuglani
Differential Revision: D14725402
fbshipit-source-id: a45bebdadb9c694dc0eb7e27cb52b3d247f81c50
Summary:
@public
In order to get out of pre-releases again, we move `YGSetUsedCachedEntries` from `Yoga.h` to `Yoga-internal.h`.
This way, it’s obvious that the function is not public, and we can remove it from future versions without breaking semver contracts.
Reviewed By: SidharthGuglani
Differential Revision: D14726029
fbshipit-source-id: 8d7e747e843bf5c4b5e1d4cfbfa37ca9d240dffb
Summary: I have released a new yoga and yogakit pod with 1.12.0-pre.2
Reviewed By: davidaurelio
Differential Revision: D14722676
fbshipit-source-id: 7b379ee41d04a15e25dcb2e992f361d9403269c4
Summary: As of today, Google URL shortener is retired. Moving to tinyURL instead. However, tinyURL doesn't support CORS headers, therefore additionally adding a CORS proxy.
Reviewed By: davidaurelio
Differential Revision: D14722636
fbshipit-source-id: 2ec41bb43287102543f1ac31bb76df57d71ba134
Summary:
The state of the playground was stores in a hash appended to the URL. However, tinyURL ignores the hash part of the URL. For this reason, we are using the search part of the URL instead.
Before: `yogalayout.com/playground#ey...`
After: `yogalayout.com/playground?ey...`
Reviewed By: davidaurelio
Differential Revision: D14722638
fbshipit-source-id: ed135f60269e9136bb850c4c661bd88f8ee19323
Summary:
Using a config flag to switch between different implementations of transferring layout outputs
- YogaNodeJNI uses multiple access of java fields to pass all properties like width, height, margin etc...
- YogaNodeJNIBatching uses a float array to pass all the data in one java field access
Reviewed By: davidaurelio
Differential Revision: D14378301
fbshipit-source-id: 0da5b28e6a67ad8fd60eb7efe622d9b2deaf177f
Summary: This diff adds the logic to transfer layout outputs using a float array
Reviewed By: davidaurelio
Differential Revision: D14368120
fbshipit-source-id: d1f22283bcea051d15657f42c15b90edaa0a8a7a
Summary: This diff adds a test for reset method in YogaNodeJNI to verify all layout outputs are reset properly
Reviewed By: davidaurelio
Differential Revision: D14643926
fbshipit-source-id: fffbcd07ccb6d2df83fc0bf187d992ef194f3bd0
Summary:
Moved layout outputs transfer logic from YogaNodeJNIBase to YogaNodeJNI.
This change set is for adding experiment for layout outputs batching using a float array
Reviewed By: davidaurelio
Differential Revision: D14642995
fbshipit-source-id: 5d0bc7fa18c1985be7e216d7351f5eab2e03861d
Summary:
@public
Messed this one up when fixing the test generation script.
Reviewed By: SidharthGuglani
Differential Revision: D14684224
fbshipit-source-id: 2696ce9ff7d825d00c7ad1ab1627a5ffe56d123f
Summary: Xcode 10.2 drops the support of swift version 3.0. Thus updated the swift version and also the yoga dependency.
Reviewed By: SidharthGuglani
Differential Revision: D14684332
fbshipit-source-id: d42e5979639c9fceec81627d4ac153566c2c0ab1
Summary:
@public
We use Chrome for generating test cases, which since v67 (or so) for `min-width` and `min-height` has a default value of either `0px` (CSS 2) or `auto` (CSS 3), depending on style properties.
Our setup only allowed for a single default value, and our test cases produce *both.*
This changes the test gen logic to allow for more than one value.
Reviewed By: SidharthGuglani
Differential Revision: D14682387
fbshipit-source-id: e76361f5cc0b88f9c2d74a5f3248c66abd6907a7
Summary:
@public
This gets flagged by the linter. Remove it.
Reviewed By: SidharthGuglani
Differential Revision: D14682386
fbshipit-source-id: 612508b0906285e6420a553ac7a96d1024f1eac6
Summary:
@public
Adapts the license header text to the format we currently use.
Reviewed By: SidharthGuglani
Differential Revision: D14653591
fbshipit-source-id: f79446e4f85623326f770fe73482eab00edd9234
Summary: This workspace should ease yoga development
Reviewed By: dinhviethoa
Differential Revision: D14600002
fbshipit-source-id: 49f6d36680acad5835fcf96e80bcd547b667c0c8
Summary:
Moved layout outputs transfer logic from YogaNodeJNIBase to YogaNodeJNI.
This change set is for adding experiment for layout outputs batching using a float array
Reviewed By: davidaurelio
Differential Revision: D14368107
fbshipit-source-id: 75ca330c1e7f07adc0ab8e7a5927d93977088918
Summary:
@public
I would like to get rid of implicit conversions between `YGValue` and `CompactValue`, because they don’t come for free.
That’s why I am adding `CompactValue` specific overrides for `YGResolveValue` and `YGValueEqual`, that do explicit casts. Up the commit stack, we will be able mark both `CompactValue(const YGValue&)` and `CompactValue::operator YGValue()` as `explicit`.
Reviewed By: SidharthGuglani
Differential Revision: D14598447
fbshipit-source-id: 75dc15cefb2dddcf8def891c5fb37893cacd9d46
Summary:
@public
Xcode does not like it
Reviewed By: astreet
Differential Revision: D14580168
fbshipit-source-id: 6d26b3961b45a59ef9dc977b21493e60e3cf9396
Summary:
@public
After changing native methods to return `long` rather than `YogaValue`, we switch them to JNI fast calls, as there is no more interaction with the Java GC.
Reviewed By: pasqualeanatriello
Differential Revision: D14576815
fbshipit-source-id: b5a33caef7343ba1de3d9634a50dc82ab3148cc7
Summary:
@public
Passing primitive data via JNI is more efficient than passing objects.
Here, we avoid creating `YogaValue` (Java) instances via JNI, and rather pass a `long` back to Java. The instance is then created by extracting the necessary bytes on the Java side.
Reviewed By: foghina
Differential Revision: D14576755
fbshipit-source-id: 22d09ad50c3ac6c49b0a797a0dad639ea4829df9
2019-03-22 10:36:55 -07:00
478 changed files with 20330 additions and 8776 deletions
Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please [read the full text](https://code.fb.com/codeofconduct/) so that you can understand what actions will and will not be tolerated.
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies within all project spaces, and it also applies when
an individual is representing the project or its community in public spaces.
Examples of representing a project or community include using an official
project e-mail address, posting via an official social media account, or acting
as an appointed representative at an online or offline event. Representation of
a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at <opensource-conduct@fb.com>. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
Yoga builds with [buck](https://buckbuild.com). Make sure you install buck before contributing to Yoga. Yoga's main implementation is in C, with bindings to supported languages and frameworks. When making changes to Yoga please ensure the changes are also propagated to these bindings when applicable.
Yoga builds with [buck](https://buckbuild.com). Make sure you install buck before contributing to Yoga. Yoga's main implementation is in C++, with bindings to supported languages and frameworks. When making changes to Yoga please ensure the changes are also propagated to these bindings when applicable.
## Testing
For testing we rely on [gtest](https://github.com/google/googletest) as a submodule. After cloning Yoga run `git submodule init` followed by `git submodule update`.
spec.summary = 'Yoga is a cross-platform layout engine which implements Flexbox.'
spec.description = 'Yoga is a cross-platform layout engine enabling maximum collaboration within your team by implementing an API many designers are familiar with, and opening it up to developers across different platforms.'
@@ -23,12 +22,20 @@ podspec = Pod::Spec.new do |spec|
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.