Skip to content
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

Convert mixin-cache-as-bitmap to TS #6630

Merged
merged 3 commits into from
May 24, 2020
Merged

Convert mixin-cache-as-bitmap to TS #6630

merged 3 commits into from
May 24, 2020

Conversation

SerG-Y
Copy link
Contributor

@SerG-Y SerG-Y commented May 19, 2020

Description of change

Converted mixin-cache-as-bitmap to TS

Pre-Merge Checklist
  • Documentation is changed or added
  • Lint process passed (npm run lint)
  • Tests passed (npm run test)

@SerG-Y
Copy link
Contributor Author

SerG-Y commented May 19, 2020

Hi guys,
is it okay to cast some variables to any to be able to access some private fields (ex. _render, _tempDisplayObjectParent , _boundsID)?

@bigtimebuddy @ivanpopelyshev @themoonrat

@bigtimebuddy
Copy link
Member

Let's try to avoid the any casts. What's better is something like this so that we can maintain the internal properties in once place and we get the correct type.

interface RendererInternals extends Renderer {
  _tempDisplayObjectParent: Container;
}
this.parent = (renderer as RendererInternals)._tempDisplayObjectParent;

@SerG-Y
Copy link
Contributor Author

SerG-Y commented May 20, 2020

@bigtimebuddy it's not possible in this case because typescript doesn't allow to have the same property in one class private and public in another class/interface.
Any thoughts?
image

@bigtimebuddy
Copy link
Member

Then maybe don’t extend.

@ivanpopelyshev
Copy link
Collaborator

_tempDisplayObjectParent - just as any it, I'm gonna remove that object in another PR soon.

@bigtimebuddy bigtimebuddy added the ✅ Ready To Merge Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t label May 23, 2020
@bigtimebuddy bigtimebuddy merged commit 0e02eae into pixijs:dev May 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✅ Ready To Merge Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants