Skip to content

Cache GLTF model loads by URL#883

Open
a861046612-eng wants to merge 1 commit into
tscircuit:mainfrom
a861046612-eng:codex/cache-gltf-loader
Open

Cache GLTF model loads by URL#883
a861046612-eng wants to merge 1 commit into
tscircuit:mainfrom
a861046612-eng:codex/cache-gltf-loader

Conversation

@a861046612-eng
Copy link
Copy Markdown

Fixes #93

Summary

  • Add a shared GLTF/GLB loader cache keyed by model URL
  • Reuse in-flight and completed GLTF loads so repeated components do not trigger duplicate network requests
  • Return cloned scenes with cloned materials for each component instance so hover/translucency/env-map changes remain isolated
  • Clear failed cache entries so transient load failures can be retried

Testing

  • npx bun x tsc --noEmit
  • npx bun test tests/global-gltf-loader.test.ts tests/cad-model-transform.test.ts
  • npm run build

Note: full npx bun test still has pre-existing failures in SVG color / faux board Z-offset tests that are unrelated to GLTF loading.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 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 12, 2026 5:39pm

Request Review

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.

Improve 3d model loading to avoid laggy browser

1 participant