Skip to content

docs(entity): make getGuid() part of the public API#8795

Merged
mvaligursky merged 1 commit into
mainfrom
mv-entity-getguid-public
May 27, 2026
Merged

docs(entity): make getGuid() part of the public API#8795
mvaligursky merged 1 commit into
mainfrom
mv-entity-getguid-public

Conversation

@mvaligursky

Copy link
Copy Markdown
Contributor

Summary

  • Removes @ignore from Entity.getGuid() so it shows up in the generated API docs.
  • Adds a note that the GUID is generated lazily on first access.

Why

Users have been relying on the private entity._guid because there was no public accessor — even though findByGuid() 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

  • Confirm getGuid() appears in the generated API reference.
  • No behavior change — existing internal callers are unaffected.

🤖 Generated with Claude Code

Removes @ignore from Entity.getGuid() so it appears in generated docs.
The method has been stable and is the natural counterpart to the
already-public findByGuid(). Resolves #7394.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@mvaligursky mvaligursky self-assigned this May 27, 2026
@mvaligursky mvaligursky merged commit 4be2fa9 into main May 27, 2026
8 checks passed
@mvaligursky mvaligursky deleted the mv-entity-getguid-public branch May 27, 2026 10:59
@willeastcott

Copy link
Copy Markdown
Contributor

If we're going to make this public, this would be better done as Entity#guid (getter).

@willeastcott

Copy link
Copy Markdown
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.

@mvaligursky

Copy link
Copy Markdown
Contributor Author

yep, I'll create a getter. Setter is risky due to this comment:

 * Set the GUID value for this Entity. Note that it is unlikely that you should need to change
 * the GUID value of an Entity at run-time. Doing so will corrupt the graph this Entity is in.

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>
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.

Public version of entity._guid

2 participants