docs(entity): make getGuid() part of the public API#8795
Merged
Conversation
Contributor
|
If we're going to make this public, this would be better done as |
Contributor
|
And there could be an argument to make the setter public too. I'm guessing our own Editor has to circument the API when loading scenes. |
Contributor
Author
|
yep, I'll create a getter. Setter is risky due to this comment: |
4 tasks
mvaligursky
added a commit
that referenced
this pull request
May 28, 2026
* docs(entity): expose guid as a public getter Adds `Entity#guid` as a read-only getter that delegates to the existing `getGuid()` method. Re-marks `getGuid()` as @ignore so it stays callable for existing external tools (e.g. the editor) but no longer surfaces in the generated API reference. Follow-up to #8795, addressing review feedback to prefer a property over a getter method. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * update --------- Co-authored-by: Martin Valigursky <mvaligursky@snapchat.com> Co-authored-by: Claude Opus 4.7 <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
@ignorefromEntity.getGuid()so it shows up in the generated API docs.Why
Users have been relying on the private
entity._guidbecause there was no public accessor — even thoughfindByGuid()is fully public.getGuid()is already widely used internally (scene parser, element-input, component systems, scroll-view, button, render, anim, script, rigid-body, screen, collision), so the contract is stable; it just wasn't documented for external use.setGuid()is intentionally left@ignore— its existing JSDoc warns that misuse "will corrupt the graph this Entity is in", so it should stay an internal API.Resolves #7394.
Test plan
getGuid()appears in the generated API reference.🤖 Generated with Claude Code