Skip to content

Remove label from GNode, move to node-label plugin#701

Merged
Yonava merged 17 commits into
mainfrom
yva/remove-label-composable
Jun 14, 2026
Merged

Remove label from GNode, move to node-label plugin#701
Yonava merged 17 commits into
mainfrom
yva/remove-label-composable

Conversation

@Yonava

@Yonava Yonava commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • Removes label from the core GNode type — labels are a product-level concern, not a graph primitive
  • Introduces @magic/graph-plugins package with a createNodeLabel plugin that manages label assignment, storage, and theme wiring
  • Wires createNodeLabel into all product graphs via useGraph.ts
  • Updates all theme callbacks across products to destructure { id } instead of receiving a full GNode
  • Cleans up useAdjacencyList — removes labelAdjacencyList and fullNodeAdjacencyList which depended on GNode.label
  • Removes newNodeLabelGetter from CoreGraphSettings and the old labels.ts composable
  • Consolidates per-package .gitignore files into root

Known issues / follow-ups

  • Bulk node additions (e.g. addElements) can assign duplicate labels due to a slice(0, -1) assumption in the label generator — tracked in [graph/plugins/node-label] bulk node additions assign duplicate labels #700
  • treeArrayToGraph.ts still passes label to addNode with a @ts-expect-error migration comment; binary trees need a proper migration off label-based node ids
  • Socket.io code in packages/server/src/sockets.ts is commented out (pre-existing, unrelated to this PR)

@Yonava Yonava merged commit 8658b25 into main Jun 14, 2026
1 check failed
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.

1 participant