cujojs / when

A solid, fast Promises/A+ and when() implementation, plus other async goodies.
Other
3.44k stars 396 forks source link

Add alternative instructions to browserify section #418

Closed warpr closed 9 years ago

warpr commented 9 years ago

This is a suggestion for https://github.com/cujojs/when/issues/349#issuecomment-68289062 . Feel free to reject this PR if you don't agree with these changes, they're just a suggestion.

The goal of this change is to make sure someone can start developing with when as quickly as possible. Especially when prototyping a new project I find it useful to keep things simple at first (which is a bunch of <script> tags), and graduate to using something like cujojs/curl or requirejs when the project matures.

briancavalier commented 9 years ago

Hey @warpr, thanks for the PR. I'm trying to understand the situation in which you'd need to browserify when.js separately from your application code. When I've built browser applications using npm, browserify, and when.js in the past, I've just browserified my entire app at once. That way, all dependencies, including when.js, were built into app in one step, without the need to browserify dependencies separately.

It seems your situation is different, though. Could you explain a bit, so I can get up to speed? Thanks!

BTW, the Travis failure seems to be a glitch with sauce labs. They seem to have been having issues recently--we've had lots of spurious failed builds recently :(

warpr commented 9 years ago

@briancavalier for me it's just about different stages of development. All projects start small, and in my case that often means I just have a package.json and an index.html with some inline javascript. At this stage I don't have any Makefile or grunt/gulp/etc... infrastructure to concatenate and minify all the javascript. Nothing is getting browserified, everything is included manually as a <script> tag.

As the project grows or matures I will eventually add such things, because without them managing a large number of third-party dependencies becomes a problem. But a promise library is often one of the first libraries I want in a project, long before it has any build infrastructure.

EDIT: Happy New Year! :)

briancavalier commented 9 years ago

@warpr Happy New Year to you too! Thanks for the explanation. I'm cool with merging this.

On a side note, you may want to have a look at RaveJS. It's a zero-config module system (and more). Basically, you can start with npm and modules in the browser with almost no effort ... ie no fiddling with grunt/gulp/browserify configs just to get going.

warpr commented 9 years ago

Thanks @briancavalier, RaveJS looks pretty interesting.