T
tscircuit2mo ago
Seve

URGENT: 3d-viewer needs update

@shibo URGENT: We are setting up for the demo and need the latest 3d viewer working, what is the status of it? I thought you had an open PR that maybe Rishabh and I can take a look at
42 Replies
Seve
SeveOP2mo ago
CC @Rishabh
Seve
SeveOP2mo ago
No description
shibo
shibo2mo ago
This issue is caused by react version conflict, I think I solved it here in runframe in this pr https://github.com/tscircuit/runframe/pull/1032/files after that you need to resolve the conflict in tscircuit.com
shibo
shibo2mo ago
Im working on a long term solution by getting rid of react-fiber but you can get a faster solution by resolving the conflicts for now
Seve
SeveOP2mo ago
CC @Rishabh want to give it a go? we don't need to immediately update tscircuit.com in this case because we just need chat.tscircuit.com working
shibo
shibo2mo ago
@Seve 3d-viewer imports Footprinter3d from jscad-electronics, Footprinter3d has components that require jscad-fiber, how do we support Footprinter3d in the vanilla version?
No description
Seve
SeveOP2mo ago
i don't think you use Footprinter3d, there is an alternative @Abse introduced iiuc
shibo
shibo2mo ago
kk I think I get it now
Seve
SeveOP2mo ago
getJscadModelForFootprint then you somehow convert that to ThreeJS
shibo
shibo2mo ago
now my local 3d-viewer only imports from jscad-electronics/vanilla but since jscad-fiber is a peerdependency of jscad-electronics it gets installed because it's found in circuit-to-svg:
npm ls jscad-fiber
@tscircuit/3d-viewer@0.0.342 /home/shibo/tscircuit/3d-viewer
├─┬ circuit-to-svg@0.0.176
│ └─┬ tscircuit@0.0.593
│ ├─┬ @tscircuit/eval@0.0.284
│ │ └── jscad-fiber@0.0.84 deduped invalid: "^0.0.85" from node_modules/jscad-electronics
│ └── jscad-fiber@0.0.83
└─┬ jscad-electronics@0.0.37
└── jscad-fiber@0.0.84 invalid: "^0.0.85" from node_modules/jscad-electronics
npm ls jscad-fiber
@tscircuit/3d-viewer@0.0.342 /home/shibo/tscircuit/3d-viewer
├─┬ circuit-to-svg@0.0.176
│ └─┬ tscircuit@0.0.593
│ ├─┬ @tscircuit/eval@0.0.284
│ │ └── jscad-fiber@0.0.84 deduped invalid: "^0.0.85" from node_modules/jscad-electronics
│ └── jscad-fiber@0.0.83
└─┬ jscad-electronics@0.0.37
└── jscad-fiber@0.0.84 invalid: "^0.0.85" from node_modules/jscad-electronics
Seve
SeveOP2mo ago
yea we need to make it an optional peer dep we're very close now if it's listed as an optional peer dep it won't be auto-installed
shibo
shibo2mo ago
then I need to remove it from deps of eval and tscircuit then update circuit-to-svg?
Seve
SeveOP2mo ago
🤔 yes i think so i have no idea why eval would have it
shibo
shibo2mo ago
@Seve
No description
Seve
SeveOP2mo ago
!!!! woot! @Rishabh the deed is done rejoice!
shibo
shibo2mo ago
https://github.com/tscircuit/3d-viewer/pull/428 @Seve graphite had some hot reviews, can you validate?
GitHub
migrate to vanilla jscad-electronics to not require react reconcile...
rely on vanilla jscad-electronics instead of jscad-fiber
Seve
SeveOP2mo ago
thanks for calling that out yea the effect dependencies is a legit concern, i commentted with the mitigation
shibo
shibo2mo ago
GitHub
migrate to vanilla jscad-electronics to not require react reconcile...
rely on vanilla jscad-electronics instead of jscad-fiber
shibo
shibo2mo ago
@Seve can you please review this?
Seve
SeveOP2mo ago
👍
shibo
shibo2mo ago
@Seve can I add "tscircuit" as a dev dep in runframe? I get this
shibo@DESKTOP-RC022VU:~/tscircuit/runframe$ npm ls jscad-fiber
@tscircuit/runframe@0.0.845 /home/shibo/tscircuit/runframe
└─┬ @tscircuit/pcb-viewer@1.11.207
└─┬ tscircuit@0.0.601 invalid: "^0.0.571" from node_modules/easyeda
├─┬ @tscircuit/eval@0.0.289
│ └── jscad-fiber@0.0.83 deduped
└── jscad-fiber@0.0.83

shibo@DESKTOP-RC022VU:~/tscircuit/runframe$ npm ls tscircuit
@tscircuit/runframe@0.0.845 /home/shibo/tscircuit/runframe
├─┬ @tscircuit/pcb-viewer@1.11.207
│ └─┬ tscircuit@0.0.601 invalid: "^0.0.571" from node_modules/easyeda
│ ├─┬ @tscircuit/circuit-json-flex@0.0.3
│ │ └── tscircuit@0.0.601 deduped invalid: "^0.0.571" from node_modules/easyeda
│ └─┬ @tscircuit/cli@0.1.200
│ └── tscircuit@0.0.601 deduped invalid: "^0.0.571" from node_modules/easyeda
├─┬ @tscircuit/schematic-viewer@2.0.28
│ └── tscircuit@0.0.601 deduped
├─┬ circuit-to-svg@0.0.179
│ └── tscircuit@0.0.601 deduped
└─┬ easyeda@0.0.217
└── tscircuit@0.0.601 deduped invalid: "^0.0.571" from node_modules/easyeda
shibo@DESKTOP-RC022VU:~/tscircuit/runframe$ npm ls jscad-fiber
@tscircuit/runframe@0.0.845 /home/shibo/tscircuit/runframe
└─┬ @tscircuit/pcb-viewer@1.11.207
└─┬ tscircuit@0.0.601 invalid: "^0.0.571" from node_modules/easyeda
├─┬ @tscircuit/eval@0.0.289
│ └── jscad-fiber@0.0.83 deduped
└── jscad-fiber@0.0.83

shibo@DESKTOP-RC022VU:~/tscircuit/runframe$ npm ls tscircuit
@tscircuit/runframe@0.0.845 /home/shibo/tscircuit/runframe
├─┬ @tscircuit/pcb-viewer@1.11.207
│ └─┬ tscircuit@0.0.601 invalid: "^0.0.571" from node_modules/easyeda
│ ├─┬ @tscircuit/circuit-json-flex@0.0.3
│ │ └── tscircuit@0.0.601 deduped invalid: "^0.0.571" from node_modules/easyeda
│ └─┬ @tscircuit/cli@0.1.200
│ └── tscircuit@0.0.601 deduped invalid: "^0.0.571" from node_modules/easyeda
├─┬ @tscircuit/schematic-viewer@2.0.28
│ └── tscircuit@0.0.601 deduped
├─┬ circuit-to-svg@0.0.179
│ └── tscircuit@0.0.601 deduped
└─┬ easyeda@0.0.217
└── tscircuit@0.0.601 deduped invalid: "^0.0.571" from node_modules/easyeda
Seve
SeveOP2mo ago
i think so it's strange that "tscircuit" is being requires by any dependency, it should ~always be a dev dependency for internal packages
Seve
SeveOP2mo ago
it's being accidentally added as a required peer :/
No description
Seve
SeveOP2mo ago
it's ok tho, yea just add as a dev dep
shibo
shibo2mo ago
@Seve 3d-viewer jscad models are broken, I fixed them and I'll merge before updating runframe @Rishabh are you testing runframe with chatgpt? Just want to know if the 3d-viewer would work
Seve
SeveOP2mo ago
I can do this now i think
Seve
SeveOP2mo ago
@shibo possible issue, not even on chatgpt yet
No description
Seve
SeveOP2mo ago
i will show you how to repro
Seve
SeveOP2mo ago
repro instructions
Seve
SeveOP2mo ago
@shibo i was able to get it to build with sourcemap with NODE_OPTIONS env, looks like a react issue
No description
Seve
SeveOP2mo ago
might be minicssgrid 😠
No description
Seve
SeveOP2mo ago
going to patch it now, but unclear if this is the root cause (probably not) wait i don't think i updated the 3d viewer properly...
Seve
SeveOP2mo ago
@shibo WORKING! Going to publish to ChatGPT to see if we get 3d models! @Rishabh we now have the latest 3d-viewer
No description
Rishabh
Rishabh2mo ago
Damn!! 🚀
Seve
SeveOP2mo ago
@shibo inside chatgpt the board doesn't render
No description
shibo
shibo2mo ago
Manifold too?
Seve
SeveOP2mo ago
manifold seems to have the embedded blob url still
No description
Seve
SeveOP2mo ago
it has to load from a CDN and it is not allowed to be fetched, so it needs to be imported like a script tag or something. Instead of fetching, try checking for window.MANIFOLD_3D and using that if it's available. We can hack that in to work
shibo
shibo2mo ago
How can I test any changes I make?
Seve
SeveOP2mo ago
the video above is how you can test locally, to know if it'll work in ChatGPT we would need to have a server that emulates their Content Security Policy
shibo
shibo2mo ago
And how can I reproduce the board issue, any idea?
Seve
SeveOP2mo ago
we could create such a server inside the circuit-preview repo, otherwise you'll have to follow this guide to test (which is what we do) https://docs.tscircuit.com/intro/quickstart-ChatGPT
Quickstart ChatGPT | tscircuit docs
Preview and iterate on tscircuit designs directly inside ChatGPT using a small CDN bundle and a simple repo convention.

Did you find this page helpful?