Skip to content

v0.1.2 — Bug fixes and performance improvements

Choose a tag to compare

@BaselAshraf81 BaselAshraf81 released this 30 Mar 19:19
· 32 commits to main since this release

🐛 Bug Fixes

  • Fixed absolute container positioning — Absolute containers now correctly report their resolved x/y position instead of inheriting from the first child
  • Fixed crash at 65k+ nodes — Replaced spread operator patterns that hit V8's call stack limit, enabling layouts with 100k+ nodes
  • Fixed flex-shrink calculation — Now uses flexBasis instead of mainSize per CSS Flexbox spec
  • Fixed magazine column overflow — Content blocks can now flow across unlimited columns instead of being truncated after 2

⚡ Performance

  • Optimized measureNode — Added lightweight measureFlexSize() and measureGridSize() paths that avoid allocating full layout records, eliminating O(n²) work for nested flex containers
  • Added flex row fast-path — Horizontal fixed-size lists now use an O(n) fast path, matching the existing column optimization

📊 Benchmarks

Scenario LayoutSans vs DOM vs Yoga WASM
100 flex boxes 0.25ms 32× faster 3× faster
10,000 flex boxes 8.55ms 94× faster 1× (comparable)
100,000 var-height items 50.01ms ∞× (DOM crashes) 2× faster

What's Changed
Full changelog: https://github.com/BaselAshraf81/layout-sans/blob/main/CHANGELOG.md

Install

npm install layout-sans@0.1.2