I know it's too early for speed optimizations, just wanted to point out some way of doing so for text measurement, because it's what runs frame rate in the app right now (it forces browser layout).
So the more optimized way for main thread might measuring with <canvas>'s 2d context's measureText() API. Which measure itself most likely won't be any faster, it won't be causing any forced layout issues in the DOM.
For the off-thread measurement, OffscreenCanvas probably can be used, once it's implemented and supports 2d context rendering.
Just wanted to file this issue so it could be tracked by others or additional thoughts added.
I know it's too early for speed optimizations, just wanted to point out some way of doing so for text measurement, because it's what runs frame rate in the app right now (it forces browser layout).
So the more optimized way for main thread might measuring with
<canvas>
's 2d context'smeasureText()
API. Which measure itself most likely won't be any faster, it won't be causing any forced layout issues in the DOM.For the off-thread measurement, OffscreenCanvas probably can be used, once it's implemented and supports 2d context rendering.
Just wanted to file this issue so it could be tracked by others or additional thoughts added.
Great work! 🎉