-
Notifications
You must be signed in to change notification settings - Fork 43
First tscircuit scripting guide, how to programmatically get the circuit size #314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First tscircuit scripting guide, how to programmatically get the circuit size #314
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for (const file of await Bun.glob("design-groups/*.tsx")) { | ||
| const { default: GroupComponent } = await import(`../${file}`); | ||
| const groupName = file.split("/").pop()?.replace(".tsx", ""); | ||
| const circuit = new RootCircuit(); | ||
| circuit.add(<GroupComponent />); | ||
| await circuit.renderUntilSettled(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use matching export type when glob-loading groups
The globbed loading example destructures default from each module, but the doc’s preceding snippet defines groups as named exports (export const Esp32Breakout ...). For files that follow the named-export guidance, GroupComponent becomes undefined and the call to circuit.add(<GroupComponent />) throws. Either import a named export or update the recommended group files to export a default component.
Useful? React with 👍 / 👎.
|
CC @Ayushjhawar8 the sidebar styling for this new page looks a bit weird |
|
Thank you for your contribution! 🎉 PR Rating: ⭐ Track your contributions and see the leaderboard at: tscircuit Contribution Tracker |
Summary
Testing
biomeCLI is not installed in the container)https://chatgpt.com/codex/tasks/task_b_690ce38d6a90832e90e3221be76e2996