feat: in-place resize via term.update() - #113
Draft
natemoo-re wants to merge 9 commits into
Draft
Conversation
Replaces the create-a-new-Term resize story (old 7.4) with a synchronous update transaction: reallocate renderer state in place within the existing wasm instance and linear memory, never re-instantiating over shared memory, so a TermInfo attachment survives resize. Accepts a discriminated options bag: explicit dimensions or an event array (resize events coalesce last-wins; non-resize events ignored). The event shape is structural, deliberately assignable from input's ResizeEvent without introducing a renderer->input dependency (11.4). After a non-no-op update the next render is a complete redraw, reusing the 7.6 generation-invalidation mechanism. Growth-only memory (high-water mark on downsize) is documented as accepted behavior. Output views are invalidated by update() since memory.grow detaches buffers; 7.3's validity window is widened accordingly.
…guard Review follow-up: 'let opsBuf!: number' plus a runtime '=== undefined' check sent conflicting signals. Allocating the fixed-size attached buffer once at declaration makes opsBuf always a number and removes the guard from layout().
Clay__RootContainer leaks into pointer-over ids (pre-existing, elastic per renderer-spec 12.4); the pointer suite matches with filters and toContainEqual rather than encoding the internal id, so do the same.
|
Size Increased — +3.0 KB 142.7 KB unpacked |
commit: |
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.
Termaway —term.update({ width, height })resizes it in place, synchronouslyterm.update({ events })picks out the resize events (last one wins, everything else ignored), so it folds right into a render loop next toinput.scan()terminfoattachment survives the resizeTermis discarded (spec'd as accepted behavior)init()was already re-entrantBuilds on #106 (based on
feat/terminfo).