Open travisleithead opened 2 years ago
♥ .reflow
!
Came to a similar naming convention for an in-progress design on #46, which I believe will subsume this use case too!
Well, #46 took a different turn, but having a reflow
is still a good idea worth adding IMO.
From comment raised by @yjbanov in PR #39:
And my comment in reply:
This is a very good use case to consider and to test for. My expectation at this early stage is that this case would be sub-optimal and that no caching/comparing of deltas between iterations of
format
are maintained.These were all good reasons to have a retained data model supported by the platform--changes to the data model could trigger invalidation (or not) and make formatting faster. However, we're making the trade-off with this new approach to remove any retained platform data model and rely on JS strings, and as a consequence, this issue is now very much a potential concern.
There may be an opportunity for a new feature here: given an existing retained metrics object, allow it to be "re-calculated" based only on changing the constraints--no changes to style or text content. Since no new input is needed except for the new constraint it seems possible to make a fast adjustment to the existing formatted metrics and output (or in-place update) new metrics.