cujojs / when

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

Publish browserified `when` build somewhere #473

Closed dominykas closed 8 years ago

dominykas commented 8 years ago

This has cropped up before and I'm happy npm run browserify works - but it would be great help if the build output was published somewhere... Results from npm run browserify-es6 do get published on npm - since the window.when based bundle is not there, I assume there are reasons for that?

I'm working on upgrading buster to latest nodes and all dependencies, but this includes using when as a global (at least for now - it would be too much to chew off in one go, to also remove the globals). I will then also like to set up http://greenkeeper.io - but npm run browserify step for when is a little bit cumbersome to automate - it'd be nice if the result was either on npm or on a CDN, or even published as part of Github releases (see here for a really simple example: https://github.com/h5o/h5o-js/blob/master/.travis.yml#L19)

I'm happy to contribute a PR, if you give me the direction this needs to go. I'd also love this to happen on 3.x branch...

In other news, when tests do pass at least on node side (works on my machine™) with https://github.com/busterjs/buster/tree/update-deps - I see there's some SauceLabs setup in .travis.yml - do you mind if I open a PR to test the browser side of things and keep it open until I finish the upgrades?

briancavalier commented 8 years ago

Hey @dominykas, it's cool to hear about the update-deps branch of buster. I def appreciate your working on it.

I wouldn't mind keeping a browserify build on github or on a cdn. It sounds like the simplest thing would be to simply include a built dist/browser/when.js, or something like that, in the npm package. Would that work for you?

As for browser tests, all when.js's unit tests current run on saucelabs. You can see them waaayyyy at the bottom of the travis log here. Is there something more you need in terms of browser testing?

dominykas commented 8 years ago

If there are no objections to publish that on npm - happy days - I'll PR - was mostly wondering if there was some specific reason it's not included already (that's why I suggested GH releases/CDN)? At the moment, browserify outputs to build/when.js - do you want me to change that or copy the file over as the whole build/ is .npmignored?

As for saucelabs - I think that's enough - I'll open a second PR for testing purposes, not to be merged and see where that takes me.

briancavalier commented 8 years ago

If there are no objections to publish that on npm - happy days - I'll PR

Yep, that'll work.

do you want me to change that or copy the file over

Sure. How about we build it to dist/browser/when.js, and then update the "browser" field in package.json to:

"browser": {
    "when": "./dist/browser/when.js",
    "vertx": false,
}

Seem ok? I'm totally open to other options, as well.

dominykas commented 8 years ago

I added the "when": "./dist/browser/when.js", bit, but now I'm having second thoughts - browserify will happily resolve everything even without it. Are there any other build tools that make use of this field?

briancavalier commented 8 years ago

@dominykas Is there more you want/need to do related this, or that I can help with before we consider releasing 3.7.6 with the new build from #476?

dominykas commented 8 years ago

Nope, I think once #476 is out on npm this issue can be closed, thanks!

briancavalier commented 8 years ago

It's up on npm now :) Thanks for all your help!

dominykas commented 8 years ago

Thanks!