Skip to content

Cache utility-loaded 3D models#890

Open
genson1808 wants to merge 1 commit into
tscircuit:mainfrom
genson1808:fix-load3dmodel-cache
Open

Cache utility-loaded 3D models#890
genson1808 wants to merge 1 commit into
tscircuit:mainfrom
genson1808:fix-load3dmodel-cache

Conversation

@genson1808
Copy link
Copy Markdown

Fixes #93

/claim #93

Summary

  • add normalized model extension detection for URLs with query strings or hashes in load3DModel
  • cache in-flight and completed utility-loaded models by URL, ignoring only cachebust_origin
  • return cloned model instances with cloned geometry/materials so repeated model usage does not share mutable render state
  • add focused tests for extension detection, cache-key normalization, and clone isolation

Test plan

  • bun test tests/load-model.test.ts
  • bun run format:check src/utils/load-model.ts tests/load-model.test.ts
  • bun run build

AI-assisted with Codex; I reviewed the diff and kept the change scoped to the remaining load3DModel utility path.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 15, 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 15, 2026 2:20pm

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.

Improve 3d model loading to avoid laggy browser

1 participant