Flow is a Flexbox layout engine with the goal of performance and spec conformance. If it's in the Flexbox spec, Flow wants to support it. We're based on Meta's Yoga, see Acknowledgements for more details.
Many of Flows'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:
- Run
npm install
in thegentest
directory to install dependencies of the test generator. - Run
node index.js
in thegentest
directory.
Roblox Studio is currently required to run Flow's unit test suite. See this issue for more details.
To test in Roblox Studio:
- Install packages with
just install-packages
. - Build the project with
rojo build --output Flow.rbxl
. This uses the default project file, which is made for tests. - Open the Roblox file and enable or disable the
RunBench
orRunTests
scripts depending on which you want to do. - Run the game and the results will be printed to the output.
TODO: Add benchmarks here
Flow is hand-translated from Typeflex, which itself is a Typescript port of Yoga. Some of Flow's internals are also based on (licensed) work done by Roblox internally to investigate Flexbox in Lua.
As time goes on, it's likely Flow will deviate from Typeflex and align more closely with upstream Yoga. See this issue for more details.