⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@adamgerhant
Copy link
Collaborator

@adamgerhant adamgerhant commented Dec 6, 2025

Improves the definition reference system by referencing nodes with DefinitionIdentifier instead of strings. This means protonodes use their identifier to reference their definition, instead of an arbitrary string.

Sets the foundation for an improved migration system and linking nodes to their definition when serializing.

For example:
instead of

resolve_document_node_type("Star")

you would do

resolve_document_node_type(&DefinitionIdentifier::ProtoNode(graphene_std::vector::generator_nodes::star::IDENTIFIER))

Another example

resolve_document_node_type("Merge")

to

resolve_document_node_type(&DefinitionIdentifer::Network("Merge".to_string()))

This PR also moves

pub reference: Option<String>,

from struct DocumentNodePersistentMetadata to its descendant struct NodeNetworkPersistentMetadata (but only when it's a network node, not a proto node).

RegistryWidgetOverride::Custom(str) => InputMetadata::with_name_description_override(f.name, f.description, WidgetOverride::Custom(str.to_string())),
})
.collect(),
output_names: vec![output_type.to_string()],
Copy link
Collaborator Author

@adamgerhant adamgerhant Dec 9, 2025

Choose a reason for hiding this comment

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

Removed since the output name of a protonode should not be a single random output type, as this can change and should be based on the current graph state.

document.network_interface.set_input(&InputConnector::node(*node_id, 2), old_inputs[3].clone(), network_path);
}

if reference == "Flatten Vector Elements" {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

not possible to include this migration since it relies on changing reference to not run again, which is no longer possible.

@Keavon
Copy link
Member

Keavon commented Jan 12, 2026

Marking as a draft while a few issues with crashes on document opening are happening due to some weirdness with migrations. @adamgerhant has the files to reproduce this with in our chat.

Also, please help by fixing the tests that are failing, thanks!

@Keavon Keavon marked this pull request as draft January 12, 2026 07:15
Comment on lines +78 to +80
let mut last_segment = proto_node_identifier.as_str().split("::").last().unwrap_or_default().to_string();
last_segment = last_segment.strip_suffix("Node").unwrap_or(&last_segment).to_string();
last_segment
Copy link
Member

Choose a reason for hiding this comment

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

This branch should only be taken if the node is not registered by the node macro right? I don't think we have any nodes which are not registered by the node macro, so this should never be taken. Also if we do take it, the name would be weird, FlattenPath instead of Flatten Path

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, this branch is for nodes with #[node_macro::node(skip_impl)] like the monitor node. It could have a space added before each capital letter

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Would it be possible for the node macro to add metadata to NODE_METADATA for nodes with #[node_macro::node(skip_impl)] so its purpose is to only not add to the registry?

Copy link
Member

Choose a reason for hiding this comment

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

That is exactly how the node macro behaves, the metadata is generated regardless of whether the skip_impl is used. Again the only way I see for this branch being taken is if a node is not registered using the node macro

Copy link
Member

Choose a reason for hiding this comment

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

I was confident that was true, but then we looked into it and it seems (maybe due to a logic bug?) that it's surprisingly not actually so. Can you please double-check @adamgerhant's conclusion about this, and maybe suggest how it ought to be fixed if what I'm conveying is indeed accurate?

Copy link
Member

Choose a reason for hiding this comment

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

I mean you could have trusted my comment or double-checked by just looking at the code in codegen.rs but by design the skip_impl attribute only skips the addition of implementation and specifically not the metadata registration / implementation + codgen of the node so you add your own implementations in the node registry.
So adams first suggestion is not relevant since this entire branch is dead code. The only nodes I am aware of which are not generated with the macro are ones which would never be accessible to the user.
Regarding the second suggestion, that is how this feature has worked since I have implemented it

@Keavon Keavon marked this pull request as ready for review January 13, 2026 03:57
@Keavon Keavon merged commit a6052c5 into master Jan 13, 2026
4 checks passed
@Keavon Keavon deleted the improve-definitions branch January 13, 2026 07:09
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.

4 participants