-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Backwards Compatibility for 5.0.0-rc2 and Container.render method #5510
Comments
Oopsie. Same as "app.stop" but this thing is bigger. I was neutral about that change. Or maybe |
In v4, we had functions named In general, private methods don't have any guarantees that we won't change. However, we could add a deprecated warning for |
@aaclayton did the above renaming ( |
Hi @bigtimebuddy - I don't believe so. The issue (per my understanding, I may be wrong) is that in PIXI v4 the Container object did not have a Now in v5, the Container has a If, as in my case, a user of PIXI has defined the https://github.com/pixijs/pixi.js/blob/dev/packages/display/src/Container.js#L488 Does that clarify? EDIT: To be even a bit more specific -- the problem was that in v4 I was not making a conscious choice that I was overriding a method, I was just defining a method that was not already defined. The ground has shifted beneath me so that now that method IS overriding a base/core functionality. So the assumptions I was making when defining my |
Ahh okay, I understand now. Thanks for clarifying. Going from v4 to v5, we renamed Container's There is, however, no way for us to prevent your issue. Any user could've created any custom method or property that is now used v5. We really can't doing anything defensively to check internal name collisions or prevent a method from being overridden. I'm sorry that your thing wasn't working as expected; the change is to rename your function to something else unfortunately. The best I can offer you is a note in some migration documentation (which is currently work in-progress). |
Makes sense, and as I said in my original post, I am fine with changing my code and moving to a different method name. My concern is just around empathy for other developers as this issue was very difficult for me to debug - my containers were not rendering, there was no error message, there was no warning, just an unexpected failure. I think if you make this change it will be very important to help users who are migrating to v5 to understand that this is a key failure mode that could occur if they have defined this method to spare other users a frustrating experience. |
Totally agree with you. We're doing our best to push things forward and not break folks as much as possible. |
Added a note here: https://github.com/pixijs/pixi.js/wiki/v5-Migration-Guide which includes a link back to this issue. Feel free to modify the wiki or add any additional notes. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hi PIXI team,
Firstly thank you so much for your work on this software and for all the effort that has gone into 5.0.0.
I got my first chance to try out the release candidate build this evening and struggled for quite some time with some silent breakages in my application. The root cause ended up being the following:
I had extended the base
PIXI.Container
class and implemented arender()
method on my subclass (perhaps this was not advisable in the first place... but it made sense to me at the time) which performed some application specific steps related to drawing that particular container. Now, with 5.0.0, the baseContainer
class defines its ownrender(renderer)
method with behavior that is critical to core functionality.https://github.com/pixijs/pixi.js/blob/9076a8983ef73ef00152b68bb98cc0ea4083d27a/packages/display/src/Container.js#L488
My user experience was that nothing was working. My containers were not being drawn and it was quite tricky to debug due to the lack of any error message or warning.
Some thoughts:
render()
method for internal use and I am happy to change my own implementation, but it would be ideal to spare other users from several hours of confusion while they attempt to identify the root cause.PIXI.Container
subclasses which they would hope to migrate to 5.0.0, would it be possible to include some sort of sanity check on the Prototype that raises a warning of this criticalrender()
method has been changed or overridden?Steps to Reproduce
Define a subclass of
PIXI.Container
(presumably under v4.x) and implement arender()
method for that subclass which does.... something.Upgrade to PIXI 5.0.0.
Observe that your custom Container no longer functions as expected with no warnings or errors thrown.
Environment
pixi.js
version: 5.0.0-rc2The text was updated successfully, but these errors were encountered: