Replace node definition string-based lookups with DefinitionIdentifier instances (#3451)

* create definition identifier and integrate it

* Bug fixes and code review

* formatting

* Fix migrations

* Fix remove handles migration

* formatting

* Fix test

* Fix tests 2

* fix deserialization

* Code review

* Small fixes

* Consolidate 'Morph' node migrations

* Add old SamplePointsNode name to migrations list

* Fix tests

* Unrelated small fix

* Fix migration crashes

* Fix tests

* Final code review

* fmt

* Add metadata

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Adam Gerhant
2026-01-12 23:09:43 -08:00
committed by GitHub
co-authored by Keavon Chambers
parent 4fea2b0fe7
commit a6052c5819
63 changed files with 843 additions and 802 deletions
+11 -7
View File
@@ -100,12 +100,10 @@ export class UpdateNodeGraphTransform extends JsMessage {
readonly transform!: NodeGraphTransform;
}
const NodeDescriptions = Transform(({ obj }) => new Map(obj.nodeDescriptions));
export class SendUIMetadata extends JsMessage {
@NodeDescriptions
readonly nodeDescriptions!: Map<string, string>;
@Type(() => FrontendNode)
@Transform(({ obj }) => new Map(obj.nodeDescriptions))
readonly nodeDescriptions!: Map<DefinitionIdentifier, string>;
readonly nodeTypes!: FrontendNodeType[];
}
@@ -222,10 +220,12 @@ export class FrontendNode {
readonly canBeLayer!: boolean;
readonly reference!: string | undefined;
readonly reference!: DefinitionIdentifier | undefined;
readonly displayName!: string;
readonly implementationName!: string;
readonly primaryInput!: FrontendGraphInput | undefined;
readonly exposedInputs!: FrontendGraphInput[];
@@ -251,6 +251,8 @@ export class FrontendNode {
}
export class FrontendNodeType {
readonly identifier!: DefinitionIdentifier;
readonly name!: string;
readonly category!: string;
@@ -258,6 +260,8 @@ export class FrontendNodeType {
readonly inputTypes!: string[];
}
export type DefinitionIdentifier = { type: "Network" | "ProtoNode"; data: string };
export class NodeGraphTransform {
readonly scale!: number;
readonly x!: number;
@@ -827,7 +831,7 @@ export class UpdateDocumentLayerDetails extends JsMessage {
export class LayerPanelEntry {
id!: bigint;
reference!: string;
reference!: DefinitionIdentifier;
alias!: string;