Giter VIP home page Giter VIP logo

Comments (11)

Raynos avatar Raynos commented on May 29, 2024

disk space is cheap.

Having a local copy of examples, docs & test is invaluable.

Why bother keeping package size down ?

from mercury.

necolas avatar necolas commented on May 29, 2024

Hey. Local copies of those things seems to be very rarely used both in my experience and in how others describe their experiences. Cloning the repo is cheap if you need to reference all that stuff locally rather than online. What is a common situation though is checking in node_modules; leaving all this cruft in the repo is a hassle for developers. npm-shrinkwrap is not a solution to avoid checking-in code that will be part of production, because it doesn't make any promises about the byte-level integrity of a package.

from mercury.

Raynos avatar Raynos commented on May 29, 2024

For those who check node_modules in they should just ignore non javascript files inside node_modules.

If your going to check node_modules in you need a solution to deal with git weight / size / history problems.

There are multiple userland implementations of something like npm-shrinkwrap that have byte level integrity, i.e. implementations of checksums in userland.

I personally find local copies in node_modules really helpful for reading documentation offline, git cloning every module I use is not needed.

from mercury.

ahdinosaur avatar ahdinosaur commented on May 29, 2024

yeah, i'm torn, because on the one hand it makes sense to keep the package size down for 99% of cases where you don't need the docs and tests, but on the other hand i've had experiences with no internet access where having the docs and tests already available was awesome.

from mercury.

alexmingoia avatar alexmingoia commented on May 29, 2024

Packages are necessarily consumed for production but not necessarily consumed for development. For that reason, I don't packages should exclude development artifacts such as testing. Documentation is arguable, but I would lean against including that as well.

from mercury.

Raynos avatar Raynos commented on May 29, 2024

npm packages are not for production.

You want to build a production tarball, build one and strip it down however you want. You cannot fix npm to be how you want it to be, you will always need to do your own production tarballing.

Npm is an amazing tool because it optimizes for development workflows, good testing, good publishing, good authoring

from mercury.

necolas avatar necolas commented on May 29, 2024

we clearly have different perspectives on this.

your package is distributing a lot of JS files that aren't part of the functional module. rather than asking people to try to deal with excluding the idiosyncratic internals of individual packages, you could help to make sure that what ends up on npm is largely code required for this module to function. then you cater for the 99% case that most other people are catering for. there's a difference between building production assets and what is on the file system. git-clone is the better way to get the complete package code.

from mercury.

necolas avatar necolas commented on May 29, 2024

not going to push you on this. i respect what you want to do with your own project :). thanks for hearing me out and for working on this stuff!

from mercury.

Raynos avatar Raynos commented on May 29, 2024

@necolas would adding checksum support to ( https://github.com/uber/npm-shrinkwrap ) help with this problem ?

from mercury.

necolas avatar necolas commented on May 29, 2024

probably not for us, because we can't depend on npm being up to deploy (but we have a place to store copies of approved modules). but that package looks useful anyway because the from noise in the npm-shrinkwrap.json commits is pretty ridiculous.

from mercury.

Raynos avatar Raynos commented on May 29, 2024

We use npm-shrinkwrap in combination with a npm mirror we maintain.

npm-shrinkwrap just solves the determinism problem whilst only checking the minimal information into git.

We have a npm mirror to solve the "cant rely on npm" problem and we have a build artifact server to solve the "dont build the same git sha into a binary twice" problem.

from mercury.

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.