Giter Site home page Giter Site logo

es5! about pixi-viewport HOT 12 CLOSED

davidfig avatar davidfig commented on August 28, 2024
es5!

from pixi-viewport.

Comments (12)

hassanshaikley avatar hassanshaikley commented on August 28, 2024 1

Yay, thanks David. PS I would happily contribute in more ways, if you have any smaller things you want done let me know. I have been meaning to test the pixi-more branch and give you feedback. I hope to get to that soon!

Thanks again for your awesome work!

from pixi-viewport.

davidfig avatar davidfig commented on August 28, 2024

Do you know how pixi.js handles es5? I know they use babel when they produce the pixi.min.js package. But not sure how they handle it for npm.

from pixi-viewport.

hassanshaikley avatar hassanshaikley commented on August 28, 2024

Looks like they use babel and something called pixify, especially made for PIXI! I will explore it more and see if I can come up with anything.

https://www.npmjs.com/package/pixify

from pixi-viewport.

hassanshaikley avatar hassanshaikley commented on August 28, 2024

check this out!

https://github.com/hassanshaikley/pixi-viewport/commit/babd0072a5d6d465594eb2bc3ceb9435a16d8bbd

Let me know what you think. Now I am getting the same error with pixi-ease. I can submit a PR to both of them or create separate forks for myself. It's your call, David! Thank you for your incredible work.

from pixi-viewport.

davidfig avatar davidfig commented on August 28, 2024

Does this mean we have to maintain two npm packages (similar to uglify-js / uglify-es)?

pixi.js, is transpiling/babelifying its es6 source code when running pixify. They place the transpiled files into the /lib directory, which is what they export for npm.

I wonder why they don't minify it during packaging and export that one file instead of the /lib directory since they're already using a map file.

It might make sense to come up with a similar solution. It's not like es6 runs faster than es5 (it's just much easier to code in). I'd love to deploy this in pixi-viewport, pixi-ease, and the rest of my npm'd projects, while maintaining the source code readability.

Thoughts?

from pixi-viewport.

hassanshaikley avatar hassanshaikley commented on August 28, 2024

What about a hook that transpiles before publishing to NPM? I don't think we would need 2 npm packages, I didn't want to assume that you would think transpiling was desirable. And I am a little shy to make a pull request.

I am not sure why they have it set up as separate files. I really didn't understand that bit. I suppose we could export it to one file if we wanted, but I don't imagine that makes much of a difference?

Do you have any other feedback on this, aside from maybe trying to turn it into one file?

from pixi-viewport.

davidfig avatar davidfig commented on August 28, 2024

It looks like pixi.js is following something close to this article: https://github.com/bookercodes/articles/blob/master/how-to-build-and-publish-es6-npm-modules-today-with-babel.md

It's similar to what you did. They transpile all the files and put it into a dist/ directory and then point npm to that directory. I'm happy to take a pull request if you want to try to finish the work.

Will have to do same for pixi-ease since its a dependent.

If you don't have time, I'll try to take a crack at it this week.

from pixi-viewport.

hassanshaikley avatar hassanshaikley commented on August 28, 2024

Check it out! : )

#29

Let me know if it is missing anything!

from pixi-viewport.

davidfig avatar davidfig commented on August 28, 2024

Nice! The pixi-more branch now supports es5. I'm hoping to push this to master soon after more testing. I also updated pixi-ease, so it should be a full es5 solution.

from pixi-viewport.

davidfig avatar davidfig commented on August 28, 2024

@hassanshaikley, since I added es5 support to pixi-viewport, do you mind deprecating pixi-viewport-es5 (npm deprecate pixi-viewport-es5 )?

It caused some confusion when I was providing support when someone thought they were using pixi-viewport but accidentally installed pixi-viewport-es5.

Thanks!

from pixi-viewport.

hassanshaikley avatar hassanshaikley commented on August 28, 2024

My bad, David! I will get to this right now. : )

from pixi-viewport.

davidfig avatar davidfig commented on August 28, 2024

Awesome. Thanks!

from pixi-viewport.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.