Comments (12)
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.
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.
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.
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.
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.
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.
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.
Check it out! : )
Let me know if it is missing anything!
from pixi-viewport.
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.
@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.
My bad, David! I will get to this right now. : )
from pixi-viewport.
Awesome. Thanks!
from pixi-viewport.
Related Issues (20)
- How to moveCenter with easing? HOT 4
- How to check if the container inside pixi-viewport contains a point returned by the "on wheel" event? HOT 3
- Why I cannot destroy viewport on zoomed end event? HOT 1
- drag with space and left mouse OR middle mouse HOT 2
- Clampzoom doesn't seem to work HOT 1
- failed to import @pixi/core and @pixi/display HOT 1
- Problem with viewport.destroy() when React component gets dismounted HOT 3
- `import "pixi-viewport"` won't import properly in NextJS HOT 5
- Can multiple viewports share events?
- Will it support V8 version? HOT 7
- Pixi Viewport v5.2 release for Pixi v7 HOT 4
- Question: How to use Cmd+Scroll for zooming when on a Mac?
- [Docs] Suggestion: keep Jsdocs in npm package?
- "clicked" event failed to be triggered
- Missing event property from IViewportOptions HOT 3
- NPM Release Version Mismatch HOT 6
- `TypeError: Cannot set properties of undefined (setting '_parentID')` HOT 3
- Version 5.1.0 on NPM is not the same as 5.1.0 on GitHub HOT 6
- Update examples for pixi v8 HOT 6
- Is this project suitable for @pixi/react? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pixi-viewport.