Skip to content

fix: cache render model loading - #917

Open
ktk-research-9185 wants to merge 3 commits into
tscircuit:mainfrom
ktk-research-9185:bounty-93-load3dmodel-cache
Open

fix: cache render model loading#917
ktk-research-9185 wants to merge 3 commits into
tscircuit:mainfrom
ktk-research-9185:bounty-93-load3dmodel-cache

Conversation

@ktk-research-9185

Copy link
Copy Markdown

Summary

  • add shared in-flight/completed caching for load3DModel in the render/SVG utility path
  • normalize cache keys by removing only cachebust_origin while preserving meaningful query params and hashes
  • pass explicit model formats from renderComponent so extensionless EasyEDA/CDN download URLs still load through the correct loader
  • return cloned model instances with cloned materials so per-render mutations do not leak into the cached template

Verification

  • npx @biomejs/biome@2.1.4 format src/utils/load-model.ts src/utils/render-component.tsx tests/load-model.test.ts
  • git diff --check
  • npm run build (blocked locally: npm install fails while extracting node_modules/three with TAR_ENTRY_ERROR in this Google Drive workspace, so tsup is unavailable)

/claim #93

@vercel

vercel Bot commented May 21, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
3d-viewer Ready Ready Preview, Comment May 21, 2026 11:35am

Request Review

@MikeGarciaAGM MikeGarciaAGM left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

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.

2 participants