Hacker News new | ask | show | jobs
by stupidcar 3313 days ago
I have never implemented a custom layout in JS because the browser's layout is slow. My JS-based layouts are always slower than using CSS.

I do layout in JS because the existing layout capabilities don't cover my use cases. I create complicated visualisations in SVG, and SVG's layout capabilities are so pathetically anaemic that I have no choice but to take over and use a mixture of D3 and custom JS to arrange things.

Similarly, I don't do synchronous layouts because I'm a moron who doesn't understand performance, but because I need to measure the size of various data-bound elements and feed those dimensions back into my custom multi-pass layout algorithm.

AFAIK, Houdini is an actual attempt to solve both of these problems: It will let run my custom layout algorithm in a worklet, and give it access to the font metrics and element sizes it needs to run efficiently.

The Houdini people seem to be the only web platform people who actually "get it" with respect to these kind of problems. Everyone else seems to be either ignorant or dismissive that these problems even exist.

1 comments

If you're actually using Houdini for custom layouts (including SVG—SVG doesn't really have any layout at all), then I don't have a problem with it. My issue is more with the performance-oriented Houdini specs, for example Animation Worklet.