-
Notifications
You must be signed in to change notification settings - Fork 55
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
Import PIXI
instead of requiring it to exist globally.
#104
Comments
This is currently breaking the latest version of pixi-tilemap |
@eranimo please elaborate, whats wrong there? i still cant figure out how to make all those modules |
I think the package needs a bit of love to support the ES6 module system and CommonJS projects. I am currently struggling with this issue as well, and there are many pitfalls regarding that. I might come up with a pull-request to solve that. But I cannot guarantee that old projects still work correctly since I ultimately would deprecate the global |
we are experimenting with pixi-tilemap, and new pixi.js 5.4 rc1 , im waiting for rc2. When one plugin will be ready - i'll move everything else previously, when i tried to move to modules, it ended bad. several times. there's also something that is missing that's wasnt possible to do using es6 modules. The whole approach was fucked up because lack of necessary build tools. How did I unfuck it: I invented "global mixins" approach and it will be posted in 5.4 rc2 |
Hm, I've yet to see a mixin solution that brings something good to the table. |
This is the story: https://github.com/pixijs/pixi.js/pulls?q=is%3Apr+global+mixins+ This is one of files: https://github.com/pixijs/pixi.js/blob/dev/packages/mixin-cache-as-bitmap/global.d.ts |
I skimmed the issues and PR's, but I can't see when or how these global mixins are introduced. Anyway, I'll continue working on my fork and come up with a PR as soon as it is ready. |
Basically, we introduce interfaces in global scope, that we implement in PixiJS. That interface can be changed in other modules. To support this perversion and ensure correct generation of docs / types we had to experiment. a lot. |
Sounds interesting. Hopefully, it works out as planned. 👍 |
@ivanpopelyshev for the health and longevity for pixijs and its plugins I believe it would be really good to have this. I think a lot lof developers will be initially put off by some of these old school javascript paradigms and the hacks you have to apply to get it to work in a modern setup. |
#110 fixes the global |
When including
pixi-tilemap
in a bundle, being forced to make sure thatpixi,js
is included beforepixi-tilemap
is very prone to errors. For me, my IDE automatically reorders the imports to be in reverse order, which would cause problems in the future. Whilst easily work-aroundable, it would be very nice if pixi-tilemap would not implicitly rely on thePIXI
global existing, and rather import it.The text was updated successfully, but these errors were encountered: