Comments (8)
Be thankful you don't have to include the three.js repo :)
from planck.js.
For mobile app development that's a problem
Could you please elaborate on what the problem is? My understanding is that your build and distribution files would just include the files that you use, rather than the entire npm package.
The files that are taking space are sourcemap files. I guess sourcemaps for unminified files might be unnecessary, we can consider removing them (it will reduce around 12mb). We will drop some of build formats in next major release.
npm packages typically don't include 0.6MB of source files and other distributed files for alternate versions of a project all in one package.
Some packages include source, some don't. Usually multi-package mono-repo projects (for example React) don't include source in each package, because it doesn't make sense. Otherwise it's a common practice to include almost entire repo with source, docs, different build formats, sourcemap, etc.
from planck.js.
I actually don't think I've ever seen an npm package include anything extra besides dist, types, and sometimes typescript source. But I could be wrong.
React is a bad example because people complain about it's size too. 😅 Try looking at just normal JavaScript libraries, not frameworks.
You shouldn't put the burden on users to exclude files from their build when you could just exclude them from the npm package to start. Just my opinion, but I think you could make planck with the testbed a separate package on npm too.
But yeah just removing the minified source maps would be great! Then the package would only be 6.5MB which is way better.
from planck.js.
Please don't remove the source maps. 18MB is nothing. It's not like it gets added to your project bundle size. It's just a one off install cost that's downloaded in seconds.
It's a nice convenience to have ready prepared, and not have to mess around wasting time generating them, all for the sake of a tiny fraction of a percent of drive space.
from planck.js.
Either way, 6.5MB is still too big imo. I'm just going to keep including planck.min.js (209kb) in p5play's npm package.
So maybe listen to @photonstorm instead!
from planck.js.
@photonstorm I have same opinion as you about dev-experience vs npm package size. I just wonder if source-map for "unminified" files is useful? (For minified files, source-map is definitely critical.)
from planck.js.
@photonstorm I have same opinion as you about dev-experience vs npm package size. I just wonder if source-map for "unminified" files is useful? (For minified files, source-map is definitely critical.)
Hmmm for me personally I'd say they are more useful during development (so unminified). That is when you want to save the most time debugging, so accurate function names and line numbers are great. Once I hit prod (minified) it's far less important.
Planck is a bit of an edge case in that lots of devs will just import it into their games, so they can generate the maps are part of their build process and don't need them in npm. But those who want to do quick script-tag type testing would need them!
from planck.js.
Thanks for letting me know, since they are being used it makes sense to keep them.
from planck.js.
Related Issues (20)
- When will version 1 be released? HOT 5
- Feature Request: Implementation of b2Draw, SetDebugDraw and DebugDraw HOT 7
- Changing a circle collider's friction doesn't make it roll slower HOT 1
- Feature Request: Add the ESM button to jsDelivr
- How to change a collider's center? HOT 5
- Why does displacement cause multiple begin and end contact events? HOT 6
- Typo in the Wiki HOT 4
- setActive(true) throwing error in v1 beta 8
- ERROR changing a collider's mass cancels its linearVelocity HOT 5
- World step error HOT 12
- possible testOverlap bug HOT 2
- Undefined Reading "x" error HOT 5
- Raycasts phasing through walls HOT 6
- clarification on the determinism limitation from docs HOT 1
- pointers on how to network planck HOT 8
- inconsistent Vec2 construction throughout examples
- DistanceJoint `getReactionForce` function not working HOT 4
- Script tag: Uncaught TypeError: t is null HOT 2
- Cannot read properties of undefined (reading "x") HOT 3
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 planck.js.