Repository navigation
feat(pool): optional page preview capture on reassignment (0.3.7) - #58
Merged
Merged
Conversation
ContinuousEnginePool renders a PNG preview (getBase64PngData) for every page it captures before reassigning a slot. Hosts that never use the preview (MathNotes) paid a native render + PNG encode + bridge transfer on every page shift for nothing. Add capturePreviewOnReassign (default true, so existing hosts are unchanged). Release 0.3.7.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
ContinuousEnginePoolrenders a PNG preview (getBase64PngData(0.5)) for every page it captures before reassigning a slot (added after 0.1.0). Hosts that never usepreviewUripay a native render + PNG encode + bridge transfer on every page shift. MathNotes, upgrading 0.1.0 → 0.3.x for the selection crash fixes, is one: its capture handler ignores the preview.Change
capturePreviewOnReassign?: booleanonContinuousEnginePool(defaulttrue, soInfiniteInkCanvas/OpenNotes are unchanged), threaded toPooledCanvasSlotthrough a ref likeshouldCaptureBeforeReassign, and included in both memo comparators.false, page data is still captured andonSlotCaptureBeforeUnmountreceivespreviewUri === undefined; no native preview render happens.Evidence
New test: capture with previews off calls the handler with
undefinedpreview and never callsgetBase64PngData; the existing test still covers the default (preview included). jest 83/83, typecheck, test:release, package build pass.Release
0.3.7 with CHANGELOG entry.