Skip to content

fix: migrate to renderGLTFToPNGFromGLB and widen snapshot types to Uint8Array#3310

Open
rushabhcodes wants to merge 3 commits into
tscircuit:mainfrom
rushabhcodes:update-render-glb-to-png-api-to-poppygl-new
Open

fix: migrate to renderGLTFToPNGFromGLB and widen snapshot types to Uint8Array#3310
rushabhcodes wants to merge 3 commits into
tscircuit:mainfrom
rushabhcodes:update-render-glb-to-png-api-to-poppygl-new

Conversation

@rushabhcodes

@rushabhcodes rushabhcodes commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Bumps `poppygl` from `0.0.20` to `0.0.24` and migrates all call sites from the deprecated `renderGLTFToPNGBufferFromGLBBuffer` to the new `renderGLTFToPNGFromGLB`. The new function returns `Uint8Array` instead of `Buffer`, so snapshot types and `compareAndCreateDiff` are widened accordingly — avoiding unnecessary `Buffer.from` conversions at call sites.

Changes

  • cli/build/worker-output-generators.ts — updated import and call site
  • cli/build/build-preview-images.ts — updated import and call site
  • lib/shared/process-snapshot-file.ts — updated import, call site, and `png3d` type (`Buffer → Uint8Array`)
  • lib/shared/compare-images.ts — widened `compareAndCreateDiff` params to `Uint8Array`; internal `Buffer.from` cast before passing to `looksSame`
  • Updated 3D snapshot baselines to match new renderer output

Why

Using the deprecated export risks breakage on the next major `poppygl` bump. The new function name is consistent with the rest of the `poppygl` API surface (`renderGLTFToPNGFromURL`, `renderGLTFToPNGBuffer`, etc.).

Test plan

  • Type check passes (`tsc --noEmit`)
  • 3D snapshot baselines updated
  • `bun test` passes

…nderGLTFToPNGFromGLB

Bump poppygl to 0.0.24 and replace the deprecated export with the new
renderGLTFToPNGFromGLB across all three call sites. Updated 3D snapshot
baselines reflect the new renderer output.
…Buffer

Widen png3d and compareAndCreateDiff params to Uint8Array to match the
return type of renderGLTFToPNGFromGLB, avoiding unnecessary Buffer.from
conversions. looksSame still receives Buffer via an internal cast.
@rushabhcodes rushabhcodes changed the title fix: migrate from deprecated renderGLTFToPNGBufferFromGLBBuffer to renderGLTFToPNGFromGLB fix: migrate to renderGLTFToPNGFromGLB and widen snapshot types to Uint8Array Jun 15, 2026
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