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
CC @Rishabh

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
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
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
@Seve 3d-viewer imports Footprinter3d from jscad-electronics, Footprinter3d has components that require jscad-fiber, how do we support Footprinter3d in the vanilla version?

i don't think you use Footprinter3d, there is an alternative @Abse introduced iiuc
kk I think I get it now
getJscadModelForFootprint
then you somehow convert that to ThreeJSnow 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:
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
then I need to remove it from deps of eval and tscircuit then update circuit-to-svg?
🤔 yes i think so
i have no idea why eval would have it
@Seve

!!!!
woot!
@Rishabh the deed is done
rejoice!
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
thanks for calling that out
yea the effect dependencies is a legit concern, i commentted with the mitigation
@Seve this commit seperates the useeffect logic: https://github.com/tscircuit/3d-viewer/pull/428/commits/67c715193151bcd04f2dffe9ced192c88a5f0837
GitHub
migrate to vanilla jscad-electronics to not require react reconcile...
rely on vanilla jscad-electronics instead of jscad-fiber
@Seve can you please review this?
👍
@Seve can I add "tscircuit" as a dev dep in runframe?
I get this
i think so
it's strange that "tscircuit" is being requires by any dependency, it should ~always be a dev dependency for internal packages
it's being accidentally added as a required peer :/

it's ok tho, yea just add as a dev dep
@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
I can do this now i think
@shibo possible issue, not even on chatgpt yet

i will show you how to repro
repro instructions
@shibo i was able to get it to build with sourcemap with NODE_OPTIONS env, looks like a react issue

might be minicssgrid 😠

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...
@shibo WORKING! Going to publish to ChatGPT to see if we get 3d models! @Rishabh we now have the latest 3d-viewer

Damn!! 🚀
@shibo inside chatgpt the board doesn't render

Manifold too?
manifold seems to have the embedded blob url still

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 workHow can I test any changes I make?
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
And how can I reproduce the board issue, any idea?
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.