Skip to content

Conversation

imrishabh18
Copy link
Member

@imrishabh18 imrishabh18 commented Jan 21, 2025

  • add subcircuit_id and pcb_group_id to primitive components
  • is_subcircuit to the source_group

Copy link

vercel bot commented Jan 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tscircuit-core-benchmarks ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 22, 2025 5:50am

@tscircuitbot
Copy link
Contributor

Size Report

Bundle Size

  • Base branch size: 684K
  • PR branch size: 684K
  • Difference: 0

Install Size

  • Base branch size: 9.76mb
  • PR branch size: 9.88mb
  • Difference: +.12

Full Howfat Output (PR Branch)

@tscircuit/core@0.0.275 (22 deps, 9.88mb, 1035 files, ©undefined)
╭─────────────────────────────────────────┬──────────────┬───────────┬───────┬───────────┬──────────────┬───────────╮
│ Name                                    │ Dependencies │      Size │ Files │ Native    │ License      │ Deprec    │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @lume/kiwi@0.4.4                        │              │   121.6kb │    31 │           │ BSD-3-Clause │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/footprinter@0.0.97           │            2 │ 1010.98kb │    73 │           │ ISC          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/infgrid-ijump-astar@0.0.33   │              │  270.18kb │    15 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/math-utils@0.0.9             │              │   28.63kb │    31 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/props@0.0.130                │              │  718.07kb │    53 │           │ ISC          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/schematic-autolayout@0.0.6   │            3 │  806.89kb │    92 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/soup-util@0.0.41             │            1 │  329.98kb │    31 │           │ ISC          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ circuit-json-to-connectivity-map@0.0.17 │            1 │   54.54kb │    27 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ circuit-json@0.0.133                    │            2 │    1.35mb │    68 │           │ ISC          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ format-si-unit@0.0.2                    │              │    4.61kb │     6 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ nanoid@5.0.9                            │              │   10.69kb │    11 │           │ MIT          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ performance-now@2.1.0                   │              │   11.08kb │    17 │           │ MIT          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ react-reconciler-18@null                │              │        0b │       │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ react-reconciler@0.31.0                 │            1 │    1.48mb │    28 │           │ MIT          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ schematic-symbols@0.0.113               │              │    1.14mb │   172 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ transformation-matrix@2.16.1            │              │  430.45kb │    56 │           │ MIT          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ zod@3.24.1                              │              │  677.75kb │    52 │           │ MIT          │           │
╰─────────────────────────────────────────┴──────────────┴───────────┴───────┴───────────┴──────────────┴───────────╯

(aside)

@tscircuitbot
Copy link
Contributor

Size Report

Bundle Size

  • Base branch size: 684K
  • PR branch size: 684K
  • Difference: 0

Install Size

  • Base branch size: 9.76mb
  • PR branch size: 9.88mb
  • Difference: +.12

Full Howfat Output (PR Branch)

@tscircuit/core@0.0.275 (22 deps, 9.88mb, 1035 files, ©undefined)
╭─────────────────────────────────────────┬──────────────┬───────────┬───────┬───────────┬──────────────┬───────────╮
│ Name                                    │ Dependencies │      Size │ Files │ Native    │ License      │ Deprec    │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @lume/kiwi@0.4.4                        │              │   121.6kb │    31 │           │ BSD-3-Clause │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/footprinter@0.0.97           │            2 │ 1010.98kb │    73 │           │ ISC          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/infgrid-ijump-astar@0.0.33   │              │  270.18kb │    15 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/math-utils@0.0.9             │              │   28.63kb │    31 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/props@0.0.130                │              │  718.07kb │    53 │           │ ISC          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/schematic-autolayout@0.0.6   │            3 │  806.89kb │    92 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/soup-util@0.0.41             │            1 │  329.98kb │    31 │           │ ISC          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ circuit-json-to-connectivity-map@0.0.17 │            1 │   54.54kb │    27 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ circuit-json@0.0.133                    │            2 │    1.35mb │    68 │           │ ISC          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ format-si-unit@0.0.2                    │              │    4.61kb │     6 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ nanoid@5.0.9                            │              │   10.69kb │    11 │           │ MIT          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ performance-now@2.1.0                   │              │   11.08kb │    17 │           │ MIT          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ react-reconciler-18@null                │              │        0b │       │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ react-reconciler@0.31.0                 │            1 │    1.48mb │    28 │           │ MIT          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ schematic-symbols@0.0.113               │              │    1.14mb │   172 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ transformation-matrix@2.16.1            │              │  430.45kb │    56 │           │ MIT          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ zod@3.24.1                              │              │  677.75kb │    52 │           │ MIT          │           │
╰─────────────────────────────────────────┴──────────────┴───────────┴───────┴───────────┴──────────────┴───────────╯

(aside)

@imrishabh18 imrishabh18 requested a review from seveibar January 21, 2025 10:52
@imrishabh18 imrishabh18 changed the title feat: add subcircuit_id feat: add subcircuit_id and pcb_group_id Jan 21, 2025
@tscircuitbot
Copy link
Contributor

Size Report

Bundle Size

  • Base branch size: 684K
  • PR branch size: 688K
  • Difference: +4

Install Size

  • Base branch size: 9.76mb
  • PR branch size: 9.88mb
  • Difference: +.12

Full Howfat Output (PR Branch)

@tscircuit/core@0.0.275 (22 deps, 9.88mb, 1035 files, ©undefined)
╭─────────────────────────────────────────┬──────────────┬───────────┬───────┬───────────┬──────────────┬───────────╮
│ Name                                    │ Dependencies │      Size │ Files │ Native    │ License      │ Deprec    │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @lume/kiwi@0.4.4                        │              │   121.6kb │    31 │           │ BSD-3-Clause │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/footprinter@0.0.97           │            2 │ 1010.98kb │    73 │           │ ISC          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/infgrid-ijump-astar@0.0.33   │              │  270.18kb │    15 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/math-utils@0.0.9             │              │   28.63kb │    31 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/props@0.0.130                │              │  718.07kb │    53 │           │ ISC          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/schematic-autolayout@0.0.6   │            3 │  806.89kb │    92 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/soup-util@0.0.41             │            1 │  329.98kb │    31 │           │ ISC          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ circuit-json-to-connectivity-map@0.0.17 │            1 │   54.54kb │    27 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ circuit-json@0.0.133                    │            2 │    1.35mb │    68 │           │ ISC          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ format-si-unit@0.0.2                    │              │    4.61kb │     6 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ nanoid@5.0.9                            │              │   10.69kb │    11 │           │ MIT          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ performance-now@2.1.0                   │              │   11.08kb │    17 │           │ MIT          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ react-reconciler-18@null                │              │        0b │       │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ react-reconciler@0.31.0                 │            1 │    1.48mb │    28 │           │ MIT          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ schematic-symbols@0.0.113               │              │    1.14mb │   172 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ transformation-matrix@2.16.1            │              │  430.45kb │    56 │           │ MIT          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ zod@3.24.1                              │              │  677.75kb │    52 │           │ MIT          │           │
╰─────────────────────────────────────────┴──────────────┴───────────┴───────┴───────────┴──────────────┴───────────╯

(aside)

@tscircuitbot
Copy link
Contributor

Size Report

Bundle Size

  • Base branch size: 684K
  • PR branch size: 688K
  • Difference: +4

Install Size

  • Base branch size: 9.76mb
  • PR branch size: 9.89mb
  • Difference: +.13

Full Howfat Output (PR Branch)

@tscircuit/core@0.0.275 (22 deps, 9.89mb, 1035 files, ©undefined)
╭─────────────────────────────────────────┬──────────────┬───────────┬───────┬───────────┬──────────────┬───────────╮
│ Name                                    │ Dependencies │      Size │ Files │ Native    │ License      │ Deprec    │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @lume/kiwi@0.4.4                        │              │   121.6kb │    31 │           │ BSD-3-Clause │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/footprinter@0.0.97           │            2 │ 1010.98kb │    73 │           │ ISC          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/infgrid-ijump-astar@0.0.33   │              │  270.18kb │    15 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/math-utils@0.0.9             │              │   28.63kb │    31 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/props@0.0.130                │              │  718.07kb │    53 │           │ ISC          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/schematic-autolayout@0.0.6   │            3 │  806.89kb │    92 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/soup-util@0.0.41             │            1 │  329.98kb │    31 │           │ ISC          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ circuit-json-to-connectivity-map@0.0.17 │            1 │   54.54kb │    27 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ circuit-json@0.0.133                    │            2 │    1.35mb │    68 │           │ ISC          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ format-si-unit@0.0.2                    │              │    4.61kb │     6 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ nanoid@5.0.9                            │              │   10.69kb │    11 │           │ MIT          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ performance-now@2.1.0                   │              │   11.08kb │    17 │           │ MIT          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ react-reconciler-18@null                │              │        0b │       │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ react-reconciler@0.31.0                 │            1 │    1.48mb │    28 │           │ MIT          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ schematic-symbols@0.0.113               │              │    1.14mb │   172 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ transformation-matrix@2.16.1            │              │  430.45kb │    56 │           │ MIT          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ zod@3.24.1                              │              │  677.75kb │    52 │           │ MIT          │           │
╰─────────────────────────────────────────┴──────────────┴───────────┴───────┴───────────┴──────────────┴───────────╯

(aside)

Comment on lines 111 to 112
subcircuit_id: string | null = null
pcb_group_id: string | null = null
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's better to derive these on the fly rather than set them.

Generally you only want to store the ids you're creating so that there's only one source of truth

Suggested change
subcircuit_id: string | null = null
pcb_group_id: string | null = null

@@ -44,6 +45,7 @@ export class FabricationNotePath extends PrimitiveComponent<
}
}),
stroke_width: props.strokeWidth ?? 0.1,
subcircuit_id: subcircuit?.subcircuit_id ?? undefined,
Copy link
Contributor

Choose a reason for hiding this comment

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

this is correct!


export class Group<Props extends z.ZodType<any, any, any> = typeof groupProps>
extends NormalComponent<Props>
implements ISubcircuit
{
subcircuit_id?: string
Copy link
Contributor

Choose a reason for hiding this comment

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

let's bring this back, and also put pcb_group_id here

Copy link
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

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

this PR is mostly correct, just some minor things to move around!

@tscircuitbot
Copy link
Contributor

Size Report

Bundle Size

  • Base branch size: 684K
  • PR branch size: 688K
  • Difference: +4

Install Size

  • Base branch size: 9.76mb
  • PR branch size: 9.89mb
  • Difference: +.13

Full Howfat Output (PR Branch)

@tscircuit/core@0.0.275 (22 deps, 9.89mb, 1040 files, ©undefined)
╭─────────────────────────────────────────┬──────────────┬───────────┬───────┬───────────┬──────────────┬───────────╮
│ Name                                    │ Dependencies │      Size │ Files │ Native    │ License      │ Deprec    │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @lume/kiwi@0.4.4                        │              │   121.6kb │    31 │           │ BSD-3-Clause │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/footprinter@0.0.97           │            2 │ 1010.98kb │    73 │           │ ISC          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/infgrid-ijump-astar@0.0.33   │              │  270.18kb │    15 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/math-utils@0.0.9             │              │   28.63kb │    31 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/props@0.0.130                │              │  718.07kb │    53 │           │ ISC          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/schematic-autolayout@0.0.6   │            3 │  806.89kb │    92 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ @tscircuit/soup-util@0.0.41             │            1 │  329.98kb │    31 │           │ ISC          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ circuit-json-to-connectivity-map@0.0.17 │            1 │   54.54kb │    27 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ circuit-json@0.0.133                    │            2 │    1.35mb │    68 │           │ ISC          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ format-si-unit@0.0.2                    │              │    4.61kb │     6 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ nanoid@5.0.9                            │              │   10.69kb │    11 │           │ MIT          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ performance-now@2.1.0                   │              │   11.08kb │    17 │           │ MIT          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ react-reconciler-18@null                │              │        0b │       │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ react-reconciler@0.31.0                 │            1 │    1.48mb │    28 │           │ MIT          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ schematic-symbols@0.0.113               │              │    1.14mb │   172 │           │              │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ transformation-matrix@2.16.1            │              │  430.45kb │    56 │           │ MIT          │           │
├─────────────────────────────────────────┼──────────────┼───────────┼───────┼───────────┼──────────────┼───────────┤
│ zod@3.24.1                              │              │  677.75kb │    52 │           │ MIT          │           │
╰─────────────────────────────────────────┴──────────────┴───────────┴───────┴───────────┴──────────────┴───────────╯

(aside)

@seveibar
Copy link
Contributor

@imrishabh18 ok check out my fixes on this PR

@seveibar seveibar merged commit 303de14 into main Jan 22, 2025
8 checks passed
@seveibar seveibar deleted the feat/subcircuit_id branch January 22, 2025 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants