Files
Nick Gerlemanandmeta-codesync[bot] 65f58f6d9d Remove CocoaPods Support (#1877)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1877

CocoaPods is deprecated, and the repository is going read-only by the end of the year. This change removes the logic for the version of Yoga we have been publishing to CocoaPods trunk. https://cocoapods.org/pods/Yoga

This change does not effect React Native, which keeps its own Yoga podspec.

The mainline Yoga repo keeps a continually validated SwiftPM build, that should be used for new versions of Yoga.

Reviewed By: cortinico, cipolleschi

Differential Revision: D93553409

fbshipit-source-id: 5df4f0222fa53c2388ee227c3e22514fec794177
2026-02-18 20:05:29 -08:00

1.8 KiB

Yoga npm Maven Central SPM

Yoga is an embeddable and performant flexbox layout engine with bindings for multiple languages.

Building

Yoga's main implementation targets C++ 20 with accompanying build logic in CMake. A wrapper is provided to build the main library and run unit tests.

./unit_tests <Debug|Release>

While not required, this script will use ninja if it is installed for faster builds.

Yoga is additionally part of the vcpkg collection of ports maintained by Microsoft and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

Adding Tests

Many of Yoga's tests are automatically generated, using HTML fixtures describing node structure. These are rendered in Chrome to generate an expected layout result for the tree. New fixtures can be added to gentest/fixtures.

<div id="my_test" style="width: 100px; height: 100px; align-items: center;">
  <div style="width: 50px; height: 50px;"></div>
</div>

To generate new tests from added fixtures:

  1. Ensure you have yarn classic installed.
  2. Run yarn install to install dependencies for the test generator.
  3. Run yarn gentest in the yoga directory.

Debugging

Yoga provides a VSCode "launch.json" configuration which allows debugging unit tests. Simply add your breakpoints, and run "Debug C++ Unit tests (lldb)" (or "Debug C++ Unit tests (vsdbg)" on Windows).