Giter Club home page Giter Club logo

Comments (8)

photonstorm avatar photonstorm commented on May 24, 2024 2

Be thankful you don't have to include the three.js repo :)

from planck.js.

shakiba avatar shakiba commented on May 24, 2024

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.

quinton-ashley avatar quinton-ashley commented on May 24, 2024

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.

photonstorm avatar photonstorm commented on May 24, 2024

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.

quinton-ashley avatar quinton-ashley commented on May 24, 2024

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.

shakiba avatar shakiba commented on May 24, 2024

@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 avatar photonstorm commented on May 24, 2024

@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.

shakiba avatar shakiba commented on May 24, 2024

Thanks for letting me know, since they are being used it makes sense to keep them.

from planck.js.

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.