darsain / tooltip

JavaScript Tooltip component.
http://darsa.in/tooltip
190 stars 15 forks source link

Publish to NPM? #2

Closed KyleAMathews closed 10 years ago

KyleAMathews commented 10 years ago

Would be nice for us Browserify users.

darsain commented 10 years ago

Tooltip is a component(1). That means it leverages its ecosystem and micro dependencies. Publishing to npm and bower would mean that I'd have to build a standalone version and commit it into the repo, which I really dislike.

Besides, inlining dependencies is really inefficient. Tooltip depends on 4 other packages, which would be inlined in the standalone build, so instead of getting a few kb of tooltip and a reusable modules which other modules can depend on, you'll get more kb of tooltip with a bunch of inlined stuff that you can't reuse. That is a bad way how to develop for front end, and defeats the purpose of package manager.

And on top of that, neither npm nor bower provide any exports for css files, so you'd have to do this part manually anyway. Again defeating the purpose of package manager.

The standalone version with exports for AMD, CommonJS and global value is available only as "right click -> Save as" download for people that still develop like that (poor souls).

I think there is some componentify module that transforms component(1)s into bower requirable modules, but it still introduces inefficiencies like the final build having multiple components/modules with the same purpose because these two environments will always have a separate dependency trees.