Skip to content

refactor(components): remove redundant get data() overrides#8670

Merged
willeastcott merged 1 commit into
mainfrom
refactor/remove-redundant-data-getters
May 3, 2026
Merged

refactor(components): remove redundant get data() overrides#8670
willeastcott merged 1 commit into
mainfrom
refactor/remove-redundant-data-getters

Conversation

@willeastcott

Copy link
Copy Markdown
Contributor

Summary

Removes six byte-identical get data() overrides in component subclasses. The base Component class in src/framework/components/component.js already defines this getter, and every override was flagged with a // TODO: Remove this override in upgrading component comment — they existed purely to narrow the JSDoc return type (@type {XxxComponentData} vs base @type {*}).

Since the getter is @ignore / internal, the narrower type had no public API benefit. All subclasses now transparently inherit the base getter.

Affected files:

  • src/framework/components/button/component.js
  • src/framework/components/collision/component.js
  • src/framework/components/element/component.js
  • src/framework/components/particle-system/component.js
  • src/framework/components/scroll-view/component.js
  • src/framework/components/scrollbar/component.js

No behavioral change, no public API change. 60 lines of dead code removed.

Test plan

  • npm run lint — passes (only pre-existing unrelated warning in utils/rollup-build-target.mjs).
  • npm test — 1672 tests passing.

Co-authored-by: Cursor <cursoragent@cursor.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Removes redundant get data() overrides from several component subclasses now that the base Component class already provides an identical internal getter, reducing duplicated code without changing runtime behavior.

Changes:

  • Deleted six byte-identical get data() overrides from component subclasses.
  • Relied on Component#get data() (internal / @ignore) for all affected components.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/framework/components/button/component.js Removes redundant data getter override so the class inherits Component#get data().
src/framework/components/collision/component.js Removes redundant data getter override to use the base Component implementation.
src/framework/components/element/component.js Removes redundant data getter override; no behavior change since base getter is identical.
src/framework/components/particle-system/component.js Removes redundant data getter override; continues to use the inherited base getter.
src/framework/components/scroll-view/component.js Removes redundant data getter override and inherits the base getter.
src/framework/components/scrollbar/component.js Removes redundant data getter override and inherits the base getter.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@willeastcott willeastcott merged commit 9fb9965 into main May 3, 2026
12 checks passed
@willeastcott willeastcott deleted the refactor/remove-redundant-data-getters branch May 3, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Request for a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants