refactor: remove dead this.controller references from AppBase and hide Controller class#8644
Merged
Merged
Conversation
…ide Controller class The `this.controller` property on AppBase is a legacy carry-over: it is never set, declared, or consumed anywhere in the PlayCanvas codebase, so both `if (this.controller)` guards (in `inputUpdate` and `destroy`) are permanently false. Remove the dead blocks. The standalone `Controller` class in `src/platform/input/controller.js` is the (likely intended) type those references held, but it is now completely orphaned - no engine code constructs it, no AppOptions wires it in, and no component uses it. Mark it `@ignore` so the API reference generator drops it. The runtime export from `src/index.js` is retained so any existing user code doing `new pc.Controller(...)` keeps working. Made-with: Cursor
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors input-related code by removing unused AppBase references to an unused controller field and hides the orphaned Controller input helper from the generated API docs (while keeping the runtime export for backwards compatibility).
Changes:
- Removed dead
this.controllerupdate and teardown blocks fromAppBase. - Marked
src/platform/input/controller.jsControllerclass as@ignoreso it no longer appears in the API reference.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/platform/input/controller.js | Switches Controller class JSDoc from @category Input to @ignore to remove it from generated docs while keeping export. |
| src/framework/app-base.js | Removes unused this.controller update and destroy logic from the app input loop and teardown. |
💡 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
if (this.controller) { ... }blocks fromAppBase.inputUpdateandAppBase.destroy. Workspace-wide grep (engine + editor + supersplat + react + web-components and the other first-party repos) turns up zero places that ever set, declare, subclass-override, or readapp.controller, so both guards are permanently false.Controllerclass (src/platform/input/controller.js) from the public API reference by swapping@category Inputfor@ignoreon its class-level JSDoc. No engine code constructs one, noAppOptionswires one in, and no component uses it.export { Controller }and the re-export viasrc/index.js) is kept, so any existing user code that doesnew pc.Controller(...)keeps working. Only the documentation surface changes.ACTION_*,AXIS_*) insrc/platform/input/constants.jsare left untouched: they're bareexport constdeclarations with no JSDoc, andtypedoc.jsonhas"excludeNotDocumented": true, so typedoc already omits them.Net diff:
+1 / -8across two files.Test plan
npm run lint(clean; only a pre-existing unused-disable-directive warning)npm run build:types(succeeds;Controllerstill emitted inbuild/playcanvas.d.ts)npm test(1652 passing, 2 pending, 0 failing)Controllerno longer listed in the Input category or elsewhere.