Skip to content

docs(entity): expose guid as a public getter#8797

Merged
mvaligursky merged 2 commits into
mainfrom
mv-entity-guid-getter
May 28, 2026
Merged

docs(entity): expose guid as a public getter#8797
mvaligursky merged 2 commits into
mainfrom
mv-entity-guid-getter

Conversation

@mvaligursky
Copy link
Copy Markdown
Contributor

@mvaligursky mvaligursky commented May 27, 2026

Summary

  • Promotes Entity#guid to a public read/write property — the lazy GUID generation and _entityIndex bookkeeping now live in the getter/setter directly.
  • Entity#getGuid() and Entity#setGuid() are retained as @ignore + @deprecated wrappers that emit Debug.deprecated(...) and delegate to the property, so existing external callers (notably the editor) keep working.
  • Migrates every in-engine caller (14 src files, 12 test/asset files) off the deprecated methods so the engine doesn't trigger its own deprecation warnings.

Why

Follow-up to #8795 and #7394. Per review on the previous follow-up:

  • @willeastcott suggested making getGuid/setGuid deprecated wrappers that call the new property accessors.
  • Exposing the setter publicly is debatable, but keeping setGuid working (via @ignore + deprecation) doesn't add public API surface and avoids breaking the editor, which calls it in many places.

Test plan

  • Full test suite passes (npm test — 1720 passing).
  • Lint clean across all modified files.
  • Confirm Entity#guid appears in the generated API reference and getGuid/setGuid do not.
  • Confirm calling getGuid()/setGuid() from user code logs a single deprecation warning and still works.

🤖 Generated with Claude Code

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>
Comment thread src/framework/entity.js Outdated
@mvaligursky mvaligursky requested a review from willeastcott May 27, 2026 11:25
@mvaligursky mvaligursky merged commit 54a186c into main May 28, 2026
8 checks passed
@mvaligursky mvaligursky deleted the mv-entity-guid-getter branch May 28, 2026 10:07
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.

2 participants