refactor(components): remove redundant get data() overrides#8670
Merged
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
There was a problem hiding this comment.
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.
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
Removes six byte-identical
get data()overrides in component subclasses. The baseComponentclass in src/framework/components/component.js already defines this getter, and every override was flagged with a// TODO: Remove this override in upgrading componentcomment — 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.jssrc/framework/components/collision/component.jssrc/framework/components/element/component.jssrc/framework/components/particle-system/component.jssrc/framework/components/scroll-view/component.jssrc/framework/components/scrollbar/component.jsNo behavioral change, no public API change. 60 lines of dead code removed.
Test plan
npm run lint— passes (only pre-existing unrelated warning inutils/rollup-build-target.mjs).npm test— 1672 tests passing.