← Back to community index
# contributor·Active

anil - Is it necessary to be logged in before i...

Is it necessary to be logged in before importing JSON?

Started by anilMay 29, 202656 messages

Discussion

Last active 2 days ago · plain text
aniloriginal post
Is it necessary to be logged in before importing JSON?
Rishabh
I don't think so, you can make a fix for this
anil
oh okay, then i’ll add a fix for it 👍
anil
i have fixed this issue in that pr, Can you please take a look when you get a chance? https://github.com/tscircuit/tscircuit.com/pull/3533
anil
i found a new issue when i import a circuit json file that contains coppertext, the tsx code editor becomes empty. i'd be happy to investigate and fix it if you could let me know which repository the fix should go into. CC: <@757706909351411845> also
Seve
there's no issue in the screenshot you posted afaik
anil
The issue is that the footprint is empty without including the copper text when importing from circuit JSON. There is no copper text rendering in the PCB and 3D view.
anil
i'd be happy to investigate and fix it if you could let me know which repository the fix should go into
Seve
Oh i see
Seve
Im not sure- possible circuit-json-to-tscircuit?
Seve
That would be a good fix!!
anil
i have fixed this issue in that pr, Can you please take a look when you get a chance? https://github.com/tscircuit/circuit-json-to-tscircuit/pull/34
anil
Can you please take a look when you get a chance? https://github.com/tscircuit/core/pull/2362
anil
https://github.com/tscircuit/circuit-json-to-tscircuit/pull/34
Seve
Cc <@778624824875941908> for core pr
anil
<@778624824875941908> https://github.com/tscircuit/core/pull/2362
anil
Can you please take a look when you get a chance?
anil
CC <@778624824875941908> https://github.com/tscircuit/core/pull/2362
anil
Can you please take a look when you get a chance?
Seve
People dont really rotate sch 45
anil
okay yes that's make sense
anil
When I create a circuit and apply a 45° rotation on the PCB, everything works correctly, after importing the downloaded circuit JSON file, the capacitor pads are missing, and the courtyard does not retain its rotation. Where is the bug?
Seve
I would start by repro’ing inside tscircuit/core
Seve
Actually, this is like a tsx generation issue
Seve
Circuit json to tscircuit ig
anil
Okay let me try to fix there
anil
Yes you are right the bug inside tscircuit/core here is the repro https://github.com/tscircuit/core/pull/2445
anil
<@757706909351411845>
anil
Oh wow, I successfully fixed the capacitor pad and silkscreen text rotation issue. Now I'm moving on to the courtyard. It will probably need to be fixed in the same repository as well. Am I correct?
anil
<@757706909351411845> <@778624824875941908> https://github.com/tscircuit/core/pull/2489
anil
DONE!!!
shibo
now when you fix it make into a regression test
anil
I have a question. When I create a new PCB board, I use components such as resistors and capacitors. However, after downloading/exporting the circuit and then importing it again, those components are converted into objects like SMT pads, courtyards, silkscreen text, and paths instead of remaining as resistor or capacitor components. Is this expected behavior (a feature) or is it an issue? If it is expected, can we improve the import/export process so that the original component information is preserved and the components remain editable as resistor and capacitor footprints after re-importing?
anil
Object literal may only specify known properties, and 'pcbRotation' does not exist in type '{ width: string | number; height: string | number; layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | { name: "top" | "bottom" | "inner1" | ... 4 more ... | "inner6"; } | undefined; ... 25 more ...; isStrokeDashed?: boolean | undefined; }'.ts(2353)
anil
<@778624824875941908> <@757706909351411845> https://github.com/tscircuit/props/pull/700
anil
<@778624824875941908> https://github.com/tscircuit/core/pull/2491
anil
<@757706909351411845> I have a question. When I create a new PCB board, I use components such as resistors and capacitors. However, after downloading/exporting the circuit and then importing it again, those components are converted into objects like SMT pads, courtyards, silkscreen text, and paths instead of remaining as resistor or capacitor components. Is this expected behavior (a feature) or is it an issue? If it is expected, can we improve the import/export process so that the original component information is preserved and the components remain editable as resistor and capacitor footprints after re-importing?
Seve
can you record a video or something? I'm not sure what import feature you're using- it sounds like you might be using some kind of deprecated import
anil
Sorry, I was referring to the conversion of the circuit JSON to TSX code. When I import the circuit JSON, it displays <smtpad/> instead of <resistor/> or <capacitor> components. can we fix that?
Seve
Yea youre importing a footprint
anil
No, I am importing the circuit JSON that I previously generated from a circuit containing resistors and capacitors.
Seve
Corcuit json can be imported as multiple components or as a footprint, it is most commonly imported via direct import by users
Seve
Youre importing it as a footprint- despite what the ui may label the button, which is why its imported as a footprint
Seve
Direct import means “import circuitJson from “./circuit.json”
Seve
Then you pass the circuitJson to a subcircuit
anil
So, can we directly import the circuit JSON using `import circuitJson from "./circuit.json"` and get the resistor and capacitor components from it?
Seve
Should work
Seve
Just provide that to the subcircuit element
Seve
<subcircuit circuitJson={corcuitJson}
anil
interesting
anil
thank you
anil
Hey, I'm still running into the same issue. I fixed it in both the core and `circuit-json-to-tscircuit` about four days ago, but the problem is still happening. Do you know where the issue might be? Could you please help me figure it out?
Seve
Chatgpt understands the tscircuit dependency tree well, have you tried asking it what repos etc need the fix?
anil
Yeah, I'll ask ChatGPT what the issue is and see what's causing it.
anil
Yes, it is a dependency issue. I will update the dependency and then see what happens. ChatGPT helped me identify this issue.

Want to add to the conversation?

Reply in Discord so your notes stay connected to the source.
Continue in Discord ↗