-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Add ::IDENTITY to node macro to return a ProtoNodeIdentifier that is always a &'static str
#2842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
ProtoNodeIdentifier of a Node be accessible and always a borrowed &'static stridentity() to node macro to return ProtoNodeIdentifier that is always a &'static str
87f93ab to
24eeb94
Compare
TrueDoctor
approved these changes
Jul 7, 2025
d76de01 to
4e9455e
Compare
…orrowed `&'static str`
4e9455e to
8e433f9
Compare
identity() to node macro to return ProtoNodeIdentifier that is always a &'static str::IDENTITY to node macro to return a ProtoNodeIdentifier that is always a &'static str
Keavon
approved these changes
Jul 7, 2025
urisinger
pushed a commit
to urisinger/Graphite
that referenced
this pull request
Jul 15, 2025
… is always a `&'static str` (GraphiteEditor#2842) * fix warnings on master * make the `ProtoNodeIdentifier` of a Node be accessible and always a borrowed `&'static str` * always generate `node_name::identifier()`, even with `skip_impl` * make `FrontendNodeType` use Cow * remove broken `DocumentNodeDefinition`s for old GPU nodes * don't reexport `graphic_element` in it's entirety, only data structures * adjust everything to use the new `node_name::identifier()` * fixup imports for wasm * turn identifier fn into a constant
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.
high churn PR
Every single node used to generate their
ProtoNodeIdentifiername on bootup with aLazyLock, now they are all&'static strto make them cheap to clone and compare. Would be curious if this improved bootup performance at all.Also makes them accessible from
gstd::ops::identity::IDENTIFIER: ProtoNodeIdentifierso instead of strings copy-pasted everywhere, we can now use this function to reference a node. This makes refactoring a lot easier, since you don't have to search the entire codebase for strings to fixup. (And yes, I already found a few that weren't adjusted or outright broken...)