Skip to content

Dispose generated model resources on cleanup#907

Open
jeffreybarts-max wants to merge 1 commit into
tscircuit:mainfrom
jeffreybarts-max:codex/3d-viewer-dispose-generated-models
Open

Dispose generated model resources on cleanup#907
jeffreybarts-max wants to merge 1 commit into
tscircuit:mainfrom
jeffreybarts-max:codex/3d-viewer-dispose-generated-models

Conversation

@jeffreybarts-max
Copy link
Copy Markdown

Summary

  • Add a small Three.js cleanup helper that disposes mesh geometries and both single/material-array materials.
  • Dispose generated Footprinter and JSCAD model resources when React removes those generated objects.
  • Add unit coverage for nested mesh cleanup and material-array cleanup.

Testing

  • bunx biome check src/utils/dispose-three-object-resources.ts src/three-components/FootprinterModel.tsx src/three-components/JscadModel.tsx tests/dispose-three-object-resources.test.ts
  • bunx tsc --noEmit
  • bun run build
  • bun run test:node-bundle
  • Targeted Bun test for tests/dispose-three-object-resources.test.ts without the global snapshot preload

Note: the default repo-wide bun test path is blocked in this local Windows checkout by the unrelated sharp native module used by the snapshot preload, so I validated the new test in isolation plus the package build/type/bundle checks above.

/claim #93

@vercel
Copy link
Copy Markdown

vercel Bot commented May 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
3d-viewer Ready Ready Preview, Comment May 20, 2026 6:27pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant