Files
artcraft/frontend/libs
Tanish Manku 96e0b1065b artcraft: stabilize PageDraw bake hooks via latest-refs to stop cascading recreates
The bake chain (getCompositeCanvasFile → runCompositeBake → getCompositeFile /
scheduleCompositeBake → handleGenerate) used to rebuild every callback in the
chain on every base-image change, because getCompositeCanvasFile listed
baseImageBitmap/baseImageInfo as deps. Reading those via latest-refs makes
getCompositeCanvasFile stable (deps []) and the cascade collapses — listed
deps remain (lint-clean) but never trigger recreates.

Also list baseImageInfo explicitly in the dirty-effect deps so cache
invalidation no longer relies on the cascade's identity changes (baseImageInfo
syncs synchronously in setBaseImageInfo, but baseImageBitmap arrives async
after the image loads, so the two diverge in time).

Wrap getMaskArrayBuffer in useCallback([]) so handleGenerate can list it as a
dep without churning per render.
2026-05-09 13:49:37 -07:00
..
2026-05-08 22:01:21 -04:00
2026-03-10 21:04:53 +07:00