New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make Ticker.ts protected #10422
base: dev
Are you sure you want to change the base?
make Ticker.ts protected #10422
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 0ebc9e9:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Green light to hax!
Would you mind elaborating more on what you're modifying to Ticker? Perhaps there is a feature we are missing? It's a rare request someone would want to extend Ticker so I'm curious. My preference is to make protected only the bits you need to accomplish your inheritance/override. By making everything non-private, it changes the contract with devs that significant changes to these things would be breaking. Pixi already has a large API surface so we are mindful of not needlessly making it larger. |
Absolutely. Use case is more advanced "speed" management, applied to a subset of stage items. Used for masking certain CSTS/rollback behaviors for networked multiplayer, and additionally for slow motion replays of a subset of stage objects. We don't use the autoStart/raf features. Would not expect Ticker to support this case out-of-the-box. Just a couple very small tweaks to the built-in Ticker to integrate nicely with our other third party libs/tools.
I feel Although I agree in the broader sense, and all |
Prior to introducing TypeScript and having formal access modifiers, Pixi did have an informal access ES5 convention that anything prefixed with "_" is not considered a stable API. If there's still a consensus around that, then I have no problem with this PR. I'll defer to @Zyie on this one. |
Ticker is awesome, although we currently rely on
(this as any)._myProperty
overrides to subclass it. It would be helpful to retain types. Feel free to close PR if maintainers have an unexpectedly extreme opinion on high level encapsulation. Didn't see any prior art though. 😄🧵 Inb4 - Arguments for/against
Arguments against
Arguments for
Description of change
protected
Pre-Merge Checklist
Tests and/or benchmarks are includedn/aDocumentation is changed or addedn/aLint process passed (n/anpm run lint
)Tests passed (n/anpm run test
)