Giter Club home page Giter Club logo

zpao / yoga Goto Github PK

View Code? Open in Web Editor NEW

This project forked from facebook/yoga

0.0 3.0 0.0 3.88 MB

Yoga is a cross-platform layout engine which implements Flexbox. Yoga enables maximum collaboration within your team by implementing an API familiar to many designers and opening it up to developers across different platforms.

Home Page: https://facebook.github.io/yoga

License: Other

Python 1.17% Objective-C 1.91% C 11.21% C# 19.83% C++ 43.85% Shell 0.19% HTML 1.48% JavaScript 2.89% Ruby 0.12% Java 17.36%

yoga's Introduction

Yoga Build Status

Building

Yoga builds with buck. 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 any changes you make you should ensure that all the tests are passing. In case you make any fixes or additions to the library please also add tests for that change to ensure we don't break anything in the future. Tests are located in the tests directory. Run the tests by executing buck test //:yoga.

Instead of manually writing a test which ensures parity with web implementations of Flexbox you can run gentest/gentest.rb to generated a test for you. You can write html which you want to verify in Yoga, in gentest/fixtures folder, such as the following.

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

Run gentest/gentest.rb to generate test code and re-run buck test //:yoga to validate the behavior. One test case will be generated for every root div in the input html.

You may need to install the latest watir-webdriver gem (gem install watir-webdriver) and ChromeDriver to run gentest/gentest.rb Ruby script.

.NET

.NET testing is not integrated in buck yet, you might need to set up .NET testing environment. We have a script which to launch C# test on macOS, csharp/tests/Facebook.Yoga/test_macos.sh.

Code style

For the main C implementation of Yoga clang-format is used to ensure a consistent code style. Please run bash format.sh before submitting a pull request. For other languages just try to follow the current code style.

Benchmarks

Benchmarks are located in benchmarks/YGBenchmark.c and can be run with buck run //benchmarks:benchmarks. If you think your change has affected performance please run this before and after your change to validate that nothing has regressed. Benchmarks are run on every commit in CI.

yoga's People

Contributors

aaronechiu avatar astreet avatar colineberhardt avatar csilzen avatar d16r avatar daviskoh avatar devongovett avatar emilsjolander avatar foghina avatar frantic avatar freakboy3742 avatar jaredly avatar javache avatar kmagiera avatar kyleamathews avatar lucasr avatar mattpodwysocki avatar mengjuew avatar mzlee avatar nicklockwood avatar pragmatrix avatar prenaux avatar robhogan avatar splhack avatar swolchok avatar tadeuzagallo avatar vjeux avatar woehrl01 avatar wpcarro avatar ymmuse avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.