Repository navigation
v0.1.2 — Bug fixes and performance improvements
🐛 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
flexBasisinstead ofmainSizeper 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()andmeasureGridSize()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