feat(joint-react): make element/link data types unconstrained#3197
Draft
kumilingus wants to merge 6 commits intoclientIO:devfrom
Draft
feat(joint-react): make element/link data types unconstrained#3197kumilingus wants to merge 6 commits intoclientIO:devfrom
kumilingus wants to merge 6 commits intoclientIO:devfrom
Conversation
…tom mappers Remove `extends` constraints from framework generics so custom mapper users can use any data shape without extending FlatElementData/FlatLinkData. Rename GraphElement → FlatElementData, GraphLink → FlatLinkData, and related types (GraphElementPort → FlatElementPort, GraphLinkEnd → FlatLinkEnd, GraphLinkLabel → FlatLinkLabel). Remove unused GraphCell type and isGraphCell. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Unconstrained data types
extendsconstraints from all framework generics so custom mapper users can use any data shape without extendingFlatElementData/FlatLinkDataGraphElement→FlatElementData,GraphLink→FlatLinkData,GraphElementPort→FlatElementPort,GraphLinkEnd→FlatLinkEnd,GraphLinkLabel→FlatLinkLabel<Element extends GraphElement = GraphElement>to<ElementData = FlatElementData>(unconstrained with defaults)extendsconstraints since they destructure known propertiesGraphCelltype andisGraphCellfunctionIntroduce
CellIdtype aliasCellId = stringtype alias and replace alldia.Cell.IDand barestring(when used as cell identifiers) withCellIdacross the package (~35 files)as CellIdcasts at JointJS boundary points wheredia.Cell.ID(string | number) narrows toCellId(string)CellIdfrom the public APISimplify hook signatures
useNodeLayoutanduseLinkLayoutwith clean function overloadsuseLinkLayoutcontext return type (wasLinkLayout | undefined, now correctlyLinkLayout)Remove dead code (15 functions, 3 files deleted)
is.ts:Setter,isSetter,isDefined,isAttribute,isDiaId,isLinkInstance,isCellInstance,assertGraph; makehasChildrennon-exportedobject-utilities.ts:makeOptionslink-utilities.ts:getLinkPortId,getLinkMagnetfast-equality.ts:shallowArrayEqualscheduler.ts:createScheduleris-react-element.ts,noop-selector.ts,utils/clear-view.tsStorybook
with-render-linkexample with docs and toggle to switchrenderLinkon/offstressexample: removerenderLink/ custom mapper, use default JointJS link renderingTest plan
🤖 Generated with Claude Code