Skip to content

chore(ci): bump socket-registry action refs to main (6147a08c)#111

Closed
jdalton wants to merge 4 commits intomainfrom
chore/ci-sfw-shim
Closed

chore(ci): bump socket-registry action refs to main (6147a08c)#111
jdalton wants to merge 4 commits intomainfrom
chore/ci-sfw-shim

Conversation

@jdalton
Copy link
Copy Markdown
Collaborator

@jdalton jdalton commented Apr 5, 2026

Summary

  • Bump socket-registry action refs to 6147a08c (sfw-free shim support)
  • Remove inline pnpm alias blocks (now handled by shared install action)

jdalton added 4 commits April 4, 2026 22:25
- lib/native.d.ts: Full type definitions for all 248 node-api bindings
- lib/index.mjs: Platform-detecting loader with RGBA class and enums
- lib/index.d.ts: Type declarations for the wrapper module
- test/bindings.test.mjs: 25 integration tests covering module loading,
  renderer, buffer, text buffer, edit buffer, editor view, syntax style,
  and links
- Updated package.json exports with proper entry points
- Fixed vitest config to only run package tests
137 tests covering: module loading, RGBA helper, constants,
renderer lifecycle, optimized buffer operations (clear, fill, draw,
scissor, opacity, resize, compositing), text buffer (append, clear,
reset, defaults, tabs, highlights, memory buffers), text buffer view
(wrapping, selection, viewport, measurement), edit buffer (text ops,
cursor movement, undo/redo, line operations, word boundaries,
coordinate conversion), editor view (viewport, wrapping, selection,
visual cursor, drawing), syntax style (registration, lookup, attribute
combos, bulk styles), links (alloc, resolve, attribute packing),
hit grid, and buffer+view integration drawing.
Threadsafe callbacks (no more TODOs/no-ops):
- setLogCallback: TSFN bridge for log messages from native render thread
- setEventCallback: TSFN bridge for native events (input, resize, etc.)
- streamSetCallback: TSFN bridge for NativeSpanFeed stream notifications
All three properly create/release napi_threadsafe_function, handle
undefined/null to clear callbacks, and use nonblocking queue mode.

Performance APIs for zero-copy buffer access:
- bufferGetCharArrayBuffer/FgArrayBuffer/BgArrayBuffer/AttributesArrayBuffer:
  Return external ArrayBuffers backed by native memory (no copy)
- bufferDrawTextEncoded: Accept pre-encoded Uint8Array to skip
  per-call UTF-8 conversion overhead
- editBufferGetCursorInto/editorViewGetCursorInto/getCursorStateInto:
  Write cursor state into reusable typed arrays (no object allocation)

JS wrapper additions:
- BufferView class: Lazy typed array views over native buffer memory
  with direct cell writes (bypass FFI for bulk updates)
- CursorState class: Reusable cursor reader (zero allocation per read)
- encodeText(): Cached TextEncoder for pre-encoding text

napi.zig additions:
- createThreadsafeFunction/callThreadsafeFunction/releaseThreadsafeFunction
- acquireThreadsafeFunction for multi-thread access
- getTypedArrayInfo for reading typed array data pointers
@jdalton jdalton closed this Apr 5, 2026
@jdalton jdalton deleted the chore/ci-sfw-shim branch April 5, 2026 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant