News for hackers. Stuff that matters.
Re:Let's Package JQuery: A JavaScript Packaging Dystopian No... by cloudsloth on Saturday May 02, 2015 @12:08AM (#9475827)
"265 unique packages, all to build jquery!"

Oh my goodness.

Re:Let's Package JQuery: A JavaScript Packaging Dystopian No... by madeofpalk on Saturday May 02, 2015 @12:46AM (#9475899)
To be fair, Node/Javascript prefers to have many small packages that do just one thing (hopefully well).
Re:Let's Package JQuery: A JavaScript Packaging Dystopian No... by AgentME on Saturday May 02, 2015 @01:44AM (#9476020)
Yeah, I have several modules on NPM that are each just a single function (with unit tests!) that I'm interested in using in more than one package. "265 unique packages" could possibly be "265 short functions" on one extreme end.
Re:Let's Package JQuery: A JavaScript Packaging Dystopian No... by moron4hire on Saturday May 02, 2015 @10:10AM (#9477091)
To what end? It seems like the package overhead would destroy any savings in package size to be able to mix and match rather than just having a larger, more complete package.
Re:Let's Package JQuery: A JavaScript Packaging Dystopian No... by AgentME on Sunday May 03, 2015 @12:12AM (#9479877)
What package overhead? With NPM, all a package needs is a "package.json" file which does little more than specify a name and version number.

And what would a more complete package look like? "AgentME's bag of useful functions"? Many of them don't make sense to group together.

Re:Let's Package JQuery: A JavaScript Packaging Dystopian No... by pluma on Monday May 04, 2015 @08:46AM (#9485764)
The alternative isn't having a single more complete package, it's having a few dozens of more complete, overlapping packages that each don't fully satisfy your needs.

The overhead is negligible: running `npm install` in production is considered an anti-pattern and because of how npm's dependency resolution works each dependency can have different copies of the same (second order) dependency. The likelihood that there will be version conflicts (and thus duplication) is far smaller when there are smaller more specialised packages instead of a few big ones.

It's not about package size. Nobody cares about package size (except for frontend code but it's fairly easy to pare those deps down to the bare minimum).

Also, nearly all of jQuery's deps are development deps not needed in production. Those deps are only interesting for maintainers -- building jQuery yourself is likely the wrong thing to do. It's only necessary because jQuery doesn't yet expose its "submodules" properly.

Re:Let's Package JQuery: A JavaScript Packaging Dystopian No... by davexunit on Saturday May 02, 2015 @09:18AM (#9476924)
But the packaging burden is the same, regardless of the size of the source code. There's still 265 unique dependencies for a distro to package to build jQuery from source in its entirety. That's rough.
Re:Let's Package JQuery: A JavaScript Packaging Dystopian No... by madeofpalk on Saturday May 02, 2015 @09:58AM (#9477050)
Nope. There's nothing rough about

    npm install jquery
If you want to build it from source, use the management tool that jQuery was designed to use, and was designed to support jQuery.

It would be just as ridiculous to complain about how hard it is to build ffmpeg from source by using npm as the package manager.

Re:Let's Package JQuery: A JavaScript Packaging Dystopian No... by davexunit on Saturday May 02, 2015 @10:24AM (#9477161)
Having a build process tied to a specific package manager is a big problem.
Re:Let's Package JQuery: A JavaScript Packaging Dystopian No... by pluma on Monday May 04, 2015 @08:54AM (#9485802)
It's not a specific package manager. It's the package manager. You use Node.js (or io.js, which is effectively the same as Node.js) to build jQuery, the Node.js package manager is NPM. jQuery is an NPM package and uses NPM's package.json to define its development dependencies.

This isn't really up to debate. There are other package managers for JS, but they aren't replacements for NPM. And no, Meteor doesn't count -- Meteor is its own strange quasi-incompatible microcosm. In fact, some projects which aren't node packages use NPM just to manage development dependencies.

Re:Let's Package JQuery: A JavaScript Packaging Dystopian No... by davexunit on Monday May 04, 2015 @10:03AM (#9486167)
I don't know how many other ways to say this: Downloading dependencies is not the job of a build system! One should be able to use npm to fetch dependencies, or get them via another means (your system package manager), and the build system shouldn't care. Coupling package managers to build systems is a mistake.
Re:Let's Package JQuery: A JavaScript Packaging Dystopian No... by pluma on Monday May 04, 2015 @03:30PM (#9488475)
You can use any build system you want, but you need to have the build system's dependencies installed and those dependencies vary from project to project.

If you're using Makefiles, you implicitly depend on make. If you're using Grunt, you're likely implicitly depending on grunt-cli. NPM allows you to make these dependencies explicit (if the dependencies can be resolved to other NPM packages).

Heck, you can install node packages globally and be able to use them as if they were installed locally.

I don't know how many other ways to say this: what is your problem? As long as your package manager knows how to make the packages visible to node, you don't need NPM as a package manager. But you likely won't want to put all NPM packages in your package manager of choice's repository because there's a metric fuckton of them and system-level package managers have a habit of being horrendously out of date for application-level dependencies.

With regard to dependencies, every node project folder is like virtualenv. And as a matter of fact, every Python developer I know considers the system-level Python packages (i.e. those installed with apt-get or your PM of choice) a pain in the ass and only favours them if installing the package with pip would require a lot of native dev libraries (e.g. the MySQL driver or the XML/HTML packages).

The only thing making NPM a "build system" is its "npm run" command which lets you run the scripts defined in your package.json. And for many projects having a couple of aliases is all you really need and Grunt/Gulp/Make/Jake/Rake is overkill.

Either you have no idea what you are talking about or you're very bad at communicating what you take issue with.

Re:Let's Package JQuery: A JavaScript Packaging Dystopian No... by cwmma on Saturday May 02, 2015 @09:23AM (#9476942)
build and test jquery

many of those dependencies are testing related including some large dependencies for virtual dom stuff to mock the browser. Plus it uses grunt which, while I don't really like it, it does have the benefit over make that it works out of the box on windows which is something jquery has to support.