Flow aims to be a high-performance Flexbox layout engine that adheres closely to the Flexbox specification. It is based on Meta's Yoga library. For more details, refer to the Acknowledgements section.
Flow generates many of its tests automatically from HTML fixtures. These fixtures describe the node structure and are
rendered in Chrome to get expected layout outcomes. To add new fixtures, place them in the scripts/gentest/fixtures
directory.
<div id="my_test" style="width: 100px; height: 100px; align-items: center;">
<div style="width: 50px; height: 50px;"></div>
</div>
To generate new tests:
- Navigate to the
scripts/gentest
directory and runnpm install
to set up the test generator. - Execute
node index.js
in the same directory.
Roblox Studio is required to execute Flow's benchmarks unit tests. See this issue for more details.
To run tests in Roblox Studio:
- Use
just install-packages
to set up required packages. - Build the project via
rojo build --output Flow.rbxl
. - Open the generated Roblox file and toggle the
RunBench
orRunTests
scripts as needed (found underServerScriptService
). - Run the game and the results will be printed to the output.
TODO: Add benchmarks here
Flow is a Lua adaptation of Typeflex, a Typescript port of Yoga. It also incorporates some work by Roblox for Flexbox exploration 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.